Commit 133c11df authored by Sebastien's avatar Sebastien

Threads config param

parent 7aaa87a1
......@@ -34,6 +34,9 @@ our $MAFFT;
our $DATE;
our $WORKDIR;
#our $ALIGNER = 'blast';
our $ALIGNER = 'diamond';
=head1 NAME
bbric_family-companion.pl - Family companion tool
......@@ -114,6 +117,7 @@ MAIN:
$fh_pid->close;
&SetGlobals();
$THREADS = $O_CONF->Get('threads') if ($O_CONF->IsDefined('threads'));
my $rh_analysis_params = &ValidAnalysisFile($o_param->Get('analysis_cfg'));
&ConfigureWorkdir($rh_analysis_params);
......@@ -188,7 +192,7 @@ sub RunOrthomcl
RunBlast($rh_analysis_params);
my $cmd =
"( cd $WORKDIR; $ORTHOMCL"
"( cd $WORKDIR; export BLAST_NOCPU=$THREADS; $ORTHOMCL"
. ' --mode 3 --fa_files '
. join('.fasta,', keys %{$rh_analysis_params->{'proteomes'}})
. '.fasta --blast_file all.blast ';
......@@ -220,23 +224,22 @@ sub RunOrthomcl
sub RunBlast
{
my $rh_analysis_params = shift;
#~ my $cmd =
#~ "( cd $WORKDIR; cat "
#~ . join('.fasta ', keys %{$rh_analysis_params->{'proteomes'}}) . '.fasta > all.fasta;'
#~ . "$FindBin::RealBin/../ext/usearch -makeudb_usearch $WORKDIR/all.fasta -output $WORKDIR/all.fasta.udb 2>$WORKDIR/all.fasta.makeudb.log)";
#~ my $cmd =
#~ "( cd $WORKDIR; cat "
#~ . join('.fasta ', keys %{$rh_analysis_params->{'proteomes'}}) . '.fasta > all.fasta;'
#~ . "$FindBin::RealBin/../ext/ncbi-blast/makeblastdb -in $WORKDIR/all.fasta -parse_seqids -dbtype prot 2>$WORKDIR/all.fasta.makeudb.log)";
my $cmd =
"( cd $WORKDIR; cat "
. join('.fasta ', keys %{$rh_analysis_params->{'proteomes'}}) . '.fasta > all.fasta;'
. "$FindBin::RealBin/../ext/diamond makedb --in $WORKDIR/all.fasta --db $WORKDIR/all.fasta.diamond 2>$WORKDIR/all.fasta.diamond.log)";
. "$FindBin::RealBin/../ext/ncbi-blast/makeblastdb -in $WORKDIR/all.fasta -parse_seqids -dbtype prot 2>$WORKDIR/all.fasta.makeudb.log)";
if ($ALIGNER eq 'diamond')
{
$cmd =
"( cd $WORKDIR; cat "
. join('.fasta ', keys %{$rh_analysis_params->{'proteomes'}}) . '.fasta > all.fasta;'
. "$FindBin::RealBin/../ext/diamond makedb --in $WORKDIR/all.fasta --db $WORKDIR/all.fasta.diamond 2>$WORKDIR/all.fasta.diamond.log)";
}
&System($cmd);
my $parameters = $rh_analysis_params->{'homologygroups'}->{'parameters'};
......@@ -246,8 +249,13 @@ sub RunBlast
foreach my $proteome (keys %{$rh_analysis_params->{'proteomes'}})
{
#~ print $fh_cmd_blast "nice $FindBin::RealBin/../ext/usearch -ublast $WORKDIR/$proteome.fasta -db $WORKDIR/all.fasta.udb -evalue 1 -blast6out $WORKDIR/all.fasta.$proteome.blast\n";
#~ print $fh_cmd_blast "nice $FindBin::RealBin/../ext/ncbi-blast/blastp -query $WORKDIR/$proteome.fasta -db $WORKDIR/all.fasta -evalue $evalue -out $WORKDIR/all.fasta.$proteome.blast -outfmt '6 std' -num_threads 2 -max_target_seqs 1000\n";
print $fh_cmd_blast "nice $FindBin::RealBin/../ext/diamond blastp --query $WORKDIR/$proteome.fasta --db $WORKDIR/all.fasta.diamond --evalue $evalue --out $WORKDIR/all.fasta.$proteome.blast --threads 2 --max-target-seqs 1000\n";
#~ print $fh_cmd_blast
my $cmd = "nice $FindBin::RealBin/../ext/ncbi-blast/blastp -query $WORKDIR/$proteome.fasta -db $WORKDIR/all.fasta -evalue $evalue -out $WORKDIR/all.fasta.$proteome.blast -outfmt '6 std' -num_threads 2 -max_target_seqs 1000";
if ($ALIGNER eq 'diamond')
{
$cmd = "nice $FindBin::RealBin/../ext/diamond blastp --sensitive --query $WORKDIR/$proteome.fasta --db $WORKDIR/all.fasta.diamond --evalue $evalue --out $WORKDIR/all.fasta.$proteome.blast --threads 2 --max-target-seqs 1000";
}
print $fh_cmd_blast "$cmd\n";
}
$fh_cmd_blast->close();
......
......@@ -10,7 +10,7 @@ portal_install_dir=/var/www/family-companion/
admin_mail=
threads=4
tmpdir=/tmp
......
......@@ -9,7 +9,7 @@ portal_http_root=/family-companion
portal_install_dir=/var/www/family-companion/
admin_mail=
threads=4
tmpdir=/tmp
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment