Skip to content

Commit

Permalink
Merge branch 'release-1.00'
Browse files Browse the repository at this point in the history
  • Loading branch information
pommevilla committed Jun 18, 2020
2 parents 7070dc5 + 97f89fc commit f1f6438
Showing 693 changed files with 253,373 additions and 5 deletions.
Binary file added src/PrimerDesign.jar
Binary file not shown.
2 changes: 1 addition & 1 deletion src/check_reqs.sh
Original file line number Diff line number Diff line change
@@ -18,7 +18,7 @@ echo "============="

printf "Checking if required programs are installed and executable.\n\n"

requirements="diamond python blastx cd-hit clustalo-1.2.4-Ubuntu-x86_64 parallel qsub"
requirements="diamond python blastx cd-hit clustalo-1.2.4-Ubuntu-x86_64 parallel qsub java"

missing_reqs=()
for req in $requirements
2 changes: 1 addition & 1 deletion src/count_abundance
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/python3
#!/usr/bin/python
"""
This script count how many hit found ; cutoff = 80 percent identity
usage: python make_count_diamond.py mgm4477807.3.fastq.m8 mgm4477807.3.fastq.m8
2 changes: 1 addition & 1 deletion src/count_presence
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/python3
#!/usr/bin/python
"""
Quantifies the presence of the genes within a directory of *.m8 files.
The presence of a gene is how many samples a gene appears in.
Binary file added src/lib/ReadSeq.jar
Binary file not shown.
Binary file added src/lib/commons-cli-1.2.jar
Binary file not shown.
Binary file added src/lib/commons-io-2.4.jar
Binary file not shown.
Binary file added src/lib/commons-lang-2.6.jar
Binary file not shown.
51 changes: 51 additions & 0 deletions src/lib/primersplot.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
#!/usr/bin/python

import sys
import matplotlib
# Force matplotlib to not use any Xwindows backend.
matplotlib.use('Agg')
import matplotlib.pyplot as plt
import matplotlib.ticker as mtick

f = open(sys.argv[1], 'r')
coverage_map = dict()
richness_map = dict()
for line in f:
data_list = line.split()
coverage_map[int(data_list[0])] = float(data_list[1]) * 100
richness_map[int(data_list[0])] = float(data_list[2])

width = int(sys.argv[3])
height = int(sys.argv[4])
dpiVal = int(sys.argv[5])

plt.figure(figsize=(width,height))
ax = plt.subplot(2, 1, 1)
plt.title('Coverage')
plt.xlabel('Position in the Alignment')
plt.ylabel('Proportional')
plt.ylim(0,100)
fmt = '%.0f%%'
yticks = mtick.FormatStrFormatter(fmt)
ax.yaxis.set_major_formatter(yticks)
coverage = coverage_map.values()
max_coverage = max(coverage)
if max_coverage == 0:
max_coverage = 1
fracs = [data/max_coverage for data in coverage]
jet = plt.get_cmap('jet')
plt.bar(range(len(coverage_map)), coverage, width=1, color=jet(fracs), linewidth=0.5)

plt.subplots_adjust(hspace=0.25)
ax = plt.subplot(2, 1, 2)
plt.title('Richness')
plt.xlabel('Position')
plt.ylabel('Number of Unique k-mers')
#plt.ylim(0,60)
richness = richness_map.values()
max_richness = max(richness)
if max_richness == 0:
max_richness = 1
fracs = [data/max_richness for data in richness]
plt.bar(range(len(richness_map)), richness, width=1, color=jet(fracs), linewidth=0.5)
plt.savefig(sys.argv[2], dpi=dpiVal)
5 changes: 4 additions & 1 deletion src/mfpdesign
Original file line number Diff line number Diff line change
@@ -226,7 +226,10 @@ echo "Oligo size range: ($min_oligo_length, $max_oligo_length)"

head <(job_header) > mfpdesign.$input_file.sb

echo "java -jar /mnt/research/germs/softwares/Primer_Design/PrimerDesign_latest/PrimerDesign.jar -subcommand select -input $input_file -productLengthMin $min_product_length -productLengthMax $max_product_length -oligoMinSize $min_oligo_length -oligoMaxSize $max_oligo_length -maxMismatches 0 -tempMin 55 -tempMax 63 -hairMax 24 -homoMax 35 -isTreeWeightNeeded f -isHenikoffWeightNeeded f -os linux -output $outdir.rdp -assayMax $assay_max -degenMax 0 -NoTEndFilter t -NoPoly3GCFilter t -PolyRunFilter 4 -GCFilterMin 0.15 -GCFilterMax 0.8" >> mfpdesign.$input_file.sb
SCRIPT=$(readlink -f "$0")
SCRIPTPATH=$(dirname "$SCRIPT")

echo "java -jar "$SCRIPTPATH/PrimerDesign.jar" -subcommand select -input $input_file -productLengthMin $min_product_length -productLengthMax $max_product_length -oligoMinSize $min_oligo_length -oligoMaxSize $max_oligo_length -maxMismatches 0 -tempMin 55 -tempMax 63 -hairMax 24 -homoMax 35 -isTreeWeightNeeded f -isHenikoffWeightNeeded f -os linux -output $outdir.rdp -assayMax $assay_max -degenMax 0 -NoTEndFilter t -NoPoly3GCFilter t -PolyRunFilter 4 -GCFilterMin 0.15 -GCFilterMax 0.8" >> mfpdesign.$input_file.sb

# To do: remove trailing .rdp from outdir.fa
echo "get_primer_from_design.py $outdir.rdp > $outdir.primers" >> mfpdesign.$input_file.sb
2 changes: 1 addition & 1 deletion src/mfpsearch
Original file line number Diff line number Diff line change
@@ -182,7 +182,7 @@ cd diamond_commands

printf "\nCreating job commands..."

for fin in $env_dir/*.{fasta,fa,fastq,faa}
for fin in $env_dir/*.{fasta,fa,fastq,faa,fna}
do
echo "diamond blastx --db ../$input_file --query $fin --out ../$(basename $fin).m8 --id 97"
done > commands.diamond.txt
339 changes: 339 additions & 0 deletions src/primer3-2.3.7/COPYING.txt

Large diffs are not rendered by default.

113 changes: 113 additions & 0 deletions src/primer3-2.3.7/cmp_settings.pl
Original file line number Diff line number Diff line change
@@ -0,0 +1,113 @@
#!/usr/bin/perl
#
# Logical compare (i.e. diff) of two settings files.
#
# For usage, see the usage statement in the code, below.
#
# ======================================================================
# (c) Copyright 1996,1997,1998,1999,2000,2001,2004,2006,2007,2008,2010,
# 2011,2012
# Whitehead Institute for Biomedical Research, Steve Rozen,
# Andreas Untergasser and Helen Skaletsky
# All rights reserved.
#
# This file is part of the primer3 suite.
#
# The primer3 suite is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
# published by the Free Software Foundation; either version 2 of the
# License, or (at your option) any later version.
#
# This software is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this file (file gpl-2.0.txt in the source distribution); if
# not, write to the Free Software Foundation, Inc., 51 Franklin St,
# Fifth Floor, Boston, MA 02110-1301 USA
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
# OWNERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
# ======================================================================



use strict;
use warnings "all";
use Getopt::Long;

my $file1;
my $file2;

my %tags1;
my %tags2;

sub read_file($$)
{
my ($file, $tags) = @_;
open IN, $file or die "open $file: $!\n";
# skip first line
my $line = <IN>;
while ($line = <IN>) {
chomp($line);
# skip empty lines and comments
if ($line =~ /^\s*$/) { next; }
if ($line =~ "^#") { next; }
unless ($line =~ /(\S*)=(.*)/) { print STDERR "wrong line format: $line\n"; next; }
my $tag = $1;
my $value = $2;
$tags->{$tag} = $value;
}
close IN;
}

if (!GetOptions("file1=s" => \$file1, "file2=s" => \$file2) || !defined($file1) || !defined($file2)) {
die "\nUsage:\n"
. "$0 -file1 <filename1> -file2 <filename2>\n";
}

read_file($file1, \%tags1);
read_file($file2, \%tags2);

my @only1;

# cmp tags1 with tags2 print anything common different
print "Common tags with different values:\n";
foreach my $tag (sort (keys %tags1)) {
if (defined($tags2{$tag})) {
if ($tags1{$tag} ne $tags2{$tag}) {
print "\t$tag:\n\t\t$file1: $tag=$tags1{$tag}\n\t\t$file2: $tag=$tags2{$tag}\n"
}
} else {
push(@only1, $tag);
}
}

print "Tags that exist only in $file1:\n";
foreach my $tag (@only1) {
print "\t$tag=$tags1{$tag}\n";
}

print "Tags that exist only in $file2:\n";
foreach my $tag (keys %tags2) {
if (!defined($tags1{$tag})) {
print "\t$tag=$tags2{$tag}\n";
}
}






16 changes: 16 additions & 0 deletions src/primer3-2.3.7/example
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
SEQUENCE_ID=example
SEQUENCE_TEMPLATE=GTAGTCAGTAGACNATGACNACTGACGATGCAGACNACACACACACACACAGCACACAGGTATTAGTGGGCCATTCGATCCCGACCCAAATCGATAGCTACGATGACG
SEQUENCE_TARGET=37,21
PRIMER_TASK=pick_detection_primers
PRIMER_PICK_LEFT_PRIMER=1
PRIMER_PICK_INTERNAL_OLIGO=1
PRIMER_PICK_RIGHT_PRIMER=1
PRIMER_OPT_SIZE=18
PRIMER_MIN_SIZE=15
PRIMER_MAX_SIZE=21
PRIMER_MAX_NS_ACCEPTED=1
PRIMER_PRODUCT_SIZE_RANGE=75-100
P3_FILE_FLAG=1
SEQUENCE_INTERNAL_EXCLUDED_REGION=37,21
PRIMER_EXPLAIN_FLAG=1
=
Loading

0 comments on commit f1f6438

Please sign in to comment.