Skip to content

Commit 056cb21

Browse files
author
Jon Palmer
committed
fix braker to work with docker, update to v1.1.1
1 parent 92f3f90 commit 056cb21

File tree

2 files changed

+98
-98
lines changed

2 files changed

+98
-98
lines changed

funannotate.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ def fmtcols(mylist, cols):
3131
for i in range(0,num_lines))
3232
return "\n".join(lines)
3333

34-
version = '1.1.0'
34+
version = '1.1.1'
3535

3636
default_help = """
3737
Usage: funannotate <command> <arguments>

util/BRAKER/braker.pl

+97-97
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@
1313
# #
1414
# This script is under the Artistic Licence #
1515
# (http://www.opensource.org/licenses/artistic-license.php) #
16-
# #
16+
#
17+
# Edited Jan 29th, 2018 by Jon Palmer, remove calls to ln -s as fails in virtual env, fix --version#
1718
####################################################################################################
1819

1920
use Getopt::Long;
@@ -212,7 +213,7 @@
212213

213214

214215

215-
my $version = 2.0.3; # braker.pl version number
216+
my $version = "2.0.3b"; # braker.pl version number
216217
my $logString; # stores log messages produced before opening log file
217218
my $printString;
218219
my $alternatives_from_evidence = "true"; # output alternative transcripts based on explicit evidence from hints
@@ -221,60 +222,11 @@
221222
my $augustus_bin_path; # path to augustus folder binaries folder
222223
my $augustus_scripts_path; # path to augustus scripts folder
223224
my $AUGUSTUS_CONFIG_PATH;
224-
if(defined($ENV{'AUGUSTUS_CONFIG_PATH'})){
225-
if(-e $ENV{'AUGUSTUS_CONFIG_PATH'}){
226-
$printString = "\# ".(localtime).": Found environment variable \$AUGUSTUS_CONFIG_PATH.\n";
227-
print STDOUT $printString;
228-
$logString .= $printString;
229-
$AUGUSTUS_CONFIG_PATH = $ENV{'AUGUSTUS_CONFIG_PATH'};
230-
}
231-
}else{
232-
$printString = "\# ".(localtime).": Did not find environment variable \$AUGUSTUS_CONFIG_PATH (either variable does not exist, or the path given in variable does not exist). Will try to set this variable in a different way, later.\n";
233-
print STDOUT $printString;
234-
$logString .= $printString;
235-
}
236225
my $AUGUSTUS_BIN_PATH;
237-
if(defined($ENV{'AUGUSTUS_BIN_PATH'})){
238-
if(-e $ENV{'AUGUSTUS_BIN_PATH'}){
239-
$printString = "\# ".(localtime).": Found environment variable \$AUGUSTUS_BIN_PATH.\n";
240-
print STDOUT $printString;
241-
$logString .= $printString;
242-
$AUGUSTUS_BIN_PATH = $ENV{'AUGUSTUS_BIN_PATH'};
243-
}
244-
}else{
245-
$printString = "\# ".(localtime).": Did not find environment variable \$AUGUSTUS_BIN_PATH (either variable does not exist, or the path given in variable does not exist). Will try to set this variable in a different way, later.\n";
246-
print STDOUT $printString;
247-
$logString .= $printString;
248-
}
249-
250226
my $AUGUSTUS_SCRIPTS_PATH;
251-
if(defined($ENV{'$AUGUSTUS_SCRIPTS_PATH'})){
252-
if(-e $ENV{'$AUGUSTUS_SCRIPTS_PATH'}){
253-
$printString = "\# ".(localtime).": Found environment variable \$AUGUSTUS_SCRIPTS_PATH.\n";
254-
print STDOUT $printString;
255-
$logString .= $printString;
256-
$AUGUSTUS_SCRIPTS_PATH = $ENV{'AUGUSTUS_SCRIPTS_PATH'};
257-
}
258-
}else{
259-
$printString = "\# ".(localtime).": Did not find environment variable \$AUGUSTUS_SCRIPTS_PATH (either variable does not exist, or the path given in variable does not exist). Will try to set this variable in a different way, later.\n";
260-
print STDOUT $printString;
261-
$logString .= $printString;
262-
}
263227
my @bam; # bam file names
264228
my $bamtools_path;
265229
my $BAMTOOLS_BIN_PATH;
266-
if(defined($ENV{'BAMTOOLS_PATH'})){
267-
if(-e $ENV{'BAMTOOLS_PATH'}){ # path to bamtools executable, higher priority than $BAMTOOLS_BIN_PATH on system
268-
$printString = "\# ".(localtime).": Found environment variable \$BAMTOOLS_PATH.\n";
269-
print STDOUT $printString;
270-
$logString .= $printString;
271-
$BAMTOOLS_BIN_PATH = $ENV{'BAMTOOLS_PATH'}; # bamtools environment variable
272-
}
273-
}else{
274-
$printString = "\# ".(localtime).": Did not find environment variable \$BAMTOOLS_PATH (either variable does not exist, or the path given in variable does not exist). Will try to set this variable in a different way, later.\n";
275-
print STDOUT $printString;
276-
$logString .= $printString;
277-
}
278230
my @bonus; # array of bonus values for extrinsic file
279231
my $bool_species = "true"; # false, if $species contains forbidden words (e.g. chmod)
280232
my $cmdString; # to store shell commands
@@ -291,18 +243,6 @@
291243
my $genbank; # genbank file name
292244
my $genemarkDir; # directory for GeneMark-ET output
293245
my $GENEMARK_PATH;
294-
if(defined($ENV{'GENEMARK_PATH'})){
295-
if(-e $ENV{'GENEMARK_PATH'}){
296-
$printString = "\# ".(localtime).": Found environment variable \$GENEMARK_PATH.\n";
297-
print STDOUT $printString;
298-
$logString .= $printString;
299-
$GENEMARK_PATH = $ENV{'GENEMARK_PATH'}; # path to 'gmes_petap.pl' script on system, environment variable
300-
}
301-
}else{
302-
$printString = "\# ".(localtime).": Did not find environment variable \$GENEMARK_PATH (either variable does not exist, or the path given in variable does not exist). Will try to set this variable in a different way, later.\n";
303-
print STDOUT $printString;
304-
$logString .= $printString;
305-
}
306246
my $GMET_path; # GeneMark-ET path, higher priority than $GENEMARK_PATH; will use the same variable for GeneMark-EP path
307247
my $genome; # name of sequence file
308248
my $genome_length = 0; # length of genome file
@@ -322,18 +262,6 @@
322262
my $perlCmdString; # stores perl commands
323263
my $printVersion = 0; # print version number, if set
324264
my $SAMTOOLS_PATH;
325-
if(defined($ENV{'SAMTOOLS_PATH'})){
326-
if(-e $ENV{'SAMTOOLS_PATH'}){
327-
$printString = "\# ".(localtime).": Found environment variable \$SAMTOOLS_PATH.\n";
328-
print STDOUT $printString;
329-
$logString .= $printString;
330-
my $SAMTOOLS_PATH = $ENV{'SAMTOOLS_PATH'}; # samtools environment variable
331-
}
332-
}else{
333-
$printString = "\# ".(localtime).": Did not find environment variable \$SAMTOOLS_PATH (either variable does not exist, or the path given in variable does not exist). Will try to set this variable in a different way, later.\n";
334-
print STDOUT $printString;
335-
$logString .= $printString;
336-
}
337265
my $SAMTOOLS_PATH_OP; # path to samtools executable, higher priority than $SAMTOOLS_PATH on system
338266
my $scriptPath=dirname($0); # path of directory where this script is located
339267
my $skipGeneMarkET = 0; # skip GeneMark-ET and use provided GeneMark-ET output (e.g. from a different source)
@@ -368,18 +296,6 @@
368296
my @prot_seq_files; # variable to store protein sequence file name
369297
my @prot_aln_files; # variable to store protein alingment file name
370298
my $ALIGNMENT_TOOL_PATH; # stores path to binary of gth, spaln or exonerate for running protein alignments
371-
if(defined($ENV{'ALIGNMENT_TOOL_PATH'})){
372-
if(-e $ENV{'ALIGNMENT_TOOL_PATH'}){
373-
$printString = "\# ".(localtime).": Found environment variable \$ALIGNMENT_TOOL_PATH.\n";
374-
print STDOUT $printString;
375-
$logString .= $printString;
376-
$ALIGNMENT_TOOL_PATH = $ENV{'ALIGNMENT_TOOL_PATH'};
377-
}
378-
}else{
379-
$printString = "\# ".(localtime).": Did not find environment variable \$ALIGNMENT_TOOL_PATH (either variable does not exist, or the path given in variable does not exist). Will try to set this variable in a different way, later.\n";
380-
print STDOUT $printString;
381-
$logString .= $printString;
382-
}
383299
my $ALIGNMENT_TOOL_PATH_OP; # higher priority than environment variable
384300
my %hintTypes; # stores hint types occuring over all generated and supplied hints for comparison
385301
my $rnaseq2utr_args; # additional parameters to be passed to rnaseq2utr
@@ -505,6 +421,91 @@
505421
print "braker.pl version $version\n";
506422
exit(0);
507423
}
424+
#move installation checks here so if you print version you don't pollute the terminal
425+
if(defined($ENV{'AUGUSTUS_CONFIG_PATH'})){
426+
if(-e $ENV{'AUGUSTUS_CONFIG_PATH'}){
427+
$printString = "\# ".(localtime).": Found environment variable \$AUGUSTUS_CONFIG_PATH.\n";
428+
print STDOUT $printString;
429+
$logString .= $printString;
430+
$AUGUSTUS_CONFIG_PATH = $ENV{'AUGUSTUS_CONFIG_PATH'};
431+
}
432+
}else{
433+
$printString = "\# ".(localtime).": Did not find environment variable \$AUGUSTUS_CONFIG_PATH (either variable does not exist, or the path given in variable does not exist). Will try to set this variable in a different way, later.\n";
434+
print STDOUT $printString;
435+
$logString .= $printString;
436+
}
437+
if(defined($ENV{'AUGUSTUS_BIN_PATH'})){
438+
if(-e $ENV{'AUGUSTUS_BIN_PATH'}){
439+
$printString = "\# ".(localtime).": Found environment variable \$AUGUSTUS_BIN_PATH.\n";
440+
print STDOUT $printString;
441+
$logString .= $printString;
442+
$AUGUSTUS_BIN_PATH = $ENV{'AUGUSTUS_BIN_PATH'};
443+
}
444+
}else{
445+
$printString = "\# ".(localtime).": Did not find environment variable \$AUGUSTUS_BIN_PATH (either variable does not exist, or the path given in variable does not exist). Will try to set this variable in a different way, later.\n";
446+
print STDOUT $printString;
447+
$logString .= $printString;
448+
}
449+
if(defined($ENV{'$AUGUSTUS_SCRIPTS_PATH'})){
450+
if(-e $ENV{'$AUGUSTUS_SCRIPTS_PATH'}){
451+
$printString = "\# ".(localtime).": Found environment variable \$AUGUSTUS_SCRIPTS_PATH.\n";
452+
print STDOUT $printString;
453+
$logString .= $printString;
454+
$AUGUSTUS_SCRIPTS_PATH = $ENV{'AUGUSTUS_SCRIPTS_PATH'};
455+
}
456+
}else{
457+
$printString = "\# ".(localtime).": Did not find environment variable \$AUGUSTUS_SCRIPTS_PATH (either variable does not exist, or the path given in variable does not exist). Will try to set this variable in a different way, later.\n";
458+
print STDOUT $printString;
459+
$logString .= $printString;
460+
}
461+
if(defined($ENV{'BAMTOOLS_PATH'})){
462+
if(-e $ENV{'BAMTOOLS_PATH'}){ # path to bamtools executable, higher priority than $BAMTOOLS_BIN_PATH on system
463+
$printString = "\# ".(localtime).": Found environment variable \$BAMTOOLS_PATH.\n";
464+
print STDOUT $printString;
465+
$logString .= $printString;
466+
$BAMTOOLS_BIN_PATH = $ENV{'BAMTOOLS_PATH'}; # bamtools environment variable
467+
}
468+
}else{
469+
$printString = "\# ".(localtime).": Did not find environment variable \$BAMTOOLS_PATH (either variable does not exist, or the path given in variable does not exist). Will try to set this variable in a different way, later.\n";
470+
print STDOUT $printString;
471+
$logString .= $printString;
472+
}
473+
if(defined($ENV{'GENEMARK_PATH'})){
474+
if(-e $ENV{'GENEMARK_PATH'}){
475+
$printString = "\# ".(localtime).": Found environment variable \$GENEMARK_PATH.\n";
476+
print STDOUT $printString;
477+
$logString .= $printString;
478+
$GENEMARK_PATH = $ENV{'GENEMARK_PATH'}; # path to 'gmes_petap.pl' script on system, environment variable
479+
}
480+
}else{
481+
$printString = "\# ".(localtime).": Did not find environment variable \$GENEMARK_PATH (either variable does not exist, or the path given in variable does not exist). Will try to set this variable in a different way, later.\n";
482+
print STDOUT $printString;
483+
$logString .= $printString;
484+
}
485+
if(defined($ENV{'SAMTOOLS_PATH'})){
486+
if(-e $ENV{'SAMTOOLS_PATH'}){
487+
$printString = "\# ".(localtime).": Found environment variable \$SAMTOOLS_PATH.\n";
488+
print STDOUT $printString;
489+
$logString .= $printString;
490+
my $SAMTOOLS_PATH = $ENV{'SAMTOOLS_PATH'}; # samtools environment variable
491+
}
492+
}else{
493+
$printString = "\# ".(localtime).": Did not find environment variable \$SAMTOOLS_PATH (either variable does not exist, or the path given in variable does not exist). Will try to set this variable in a different way, later.\n";
494+
print STDOUT $printString;
495+
$logString .= $printString;
496+
}
497+
if(defined($ENV{'ALIGNMENT_TOOL_PATH'})){
498+
if(-e $ENV{'ALIGNMENT_TOOL_PATH'}){
499+
$printString = "\# ".(localtime).": Found environment variable \$ALIGNMENT_TOOL_PATH.\n";
500+
print STDOUT $printString;
501+
$logString .= $printString;
502+
$ALIGNMENT_TOOL_PATH = $ENV{'ALIGNMENT_TOOL_PATH'};
503+
}
504+
}else{
505+
$printString = "\# ".(localtime).": Did not find environment variable \$ALIGNMENT_TOOL_PATH (either variable does not exist, or the path given in variable does not exist). Will try to set this variable in a different way, later.\n";
506+
print STDOUT $printString;
507+
$logString .= $printString;
508+
}
508509

509510
if($skipAllTraining){ # if no training is performed, existing parameters must be used
510511
$useexisting=1;
@@ -534,7 +535,6 @@
534535
}
535536

536537

537-
538538
# check the write permission of $workDir before building of the work directory
539539
if(! -w $workDir){
540540
$printString = "\# ".(localtime).":ERROR: Do not have write permission for $workDir.\nPlease use command 'chmod' to reset permissions, or specify another working directory with option --workingdir=...\n";
@@ -1400,7 +1400,7 @@
14001400

14011401
if(defined($geneMarkGtf)){
14021402
print LOG "\# ".(localtime).": creating softlink of $geneMarkGtf to $genemarkDir/genemark.gtf.\n";
1403-
$cmdString = "ln -s $geneMarkGtf $genemarkDir/genemark.gtf";
1403+
$cmdString = "cp $geneMarkGtf $genemarkDir/genemark.gtf";
14041404
print LOG "$cmdString\n";
14051405
system($cmdString)==0 or die("failed to execute: $cmdString!\n");
14061406
}
@@ -1471,8 +1471,8 @@
14711471
if(@prot_seq_files or @prot_aln_files or @hints){
14721472
separateHints();
14731473
}else{
1474-
print LOG "\# ".(localtime).": Creating softlink from $genemark_hintsfile to $hintsfile\n";
1475-
$cmdString = "ln -s $hintsfile $genemark_hintsfile";
1474+
print LOG "\# ".(localtime).": Copying $genemark_hintsfile to $hintsfile\n";
1475+
$cmdString = "cp $hintsfile $genemark_hintsfile";
14761476
print LOG "$cmdString\n";
14771477
system($cmdString)==0 or die("failed to execute: $cmdString!\n");
14781478
}
@@ -1813,8 +1813,8 @@ sub separateHints{
18131813
print LOG "$cmdString\n\n";
18141814
system($cmdString)==0 or die("Failed to execute: $cmdString\n");
18151815
}else{
1816-
print LOG "\n\# ".(localtime).": No other hint types found. Creating softlink from $genemark_hintsfile to $hintsfile\n";
1817-
$cmdString = "ln -s $hintsfile $genemark_hintsfile";
1816+
print LOG "\n\# ".(localtime).": No other hint types found. Copying $genemark_hintsfile to $hintsfile\n";
1817+
$cmdString = "cp $hintsfile $genemark_hintsfile";
18181818
print LOG "$cmdString\n";
18191819
system($cmdString)==0 or die("Failed to execute: $cmdString\n");
18201820
}
@@ -2394,7 +2394,7 @@ sub training{
23942394
}
23952395
close(FILTEREDGTH) or die ("Could not close file $gthTrainGeneFile.f!\n");
23962396
}else{
2397-
$cmdString = "ln -s $gthTrainGeneFile $gthTrainGeneFile.f";
2397+
$cmdString = "cp $gthTrainGeneFile $gthTrainGeneFile.f";
23982398
print LOG "$cmdString\n\n";
23992399
system("$cmdString")==0 or die("Failed to execute: $cmdString\n");
24002400
}
@@ -2438,14 +2438,14 @@ sub training{
24382438
if(not($trainFromGth) && not($gth2traingenes)){
24392439
# make genemark gb final
24402440
print LOG "\# ".(localtime).": creating softlink of $geneMarkGb to $otherfilesDir/genbank.good.gb.\n";
2441-
$cmdString = "ln -s $geneMarkGb $otherfilesDir/genbank.good.gb";
2441+
$cmdString = "cp $geneMarkGb $otherfilesDir/genbank.good.gb";
24422442
print LOG "$cmdString\n";
24432443
system($cmdString)==0 or die("failed to execute: $cmdString!\n");
24442444

24452445
}elsif($trainFromGth){
24462446
# make gth gb final
24472447
print LOG "\# ".(localtime).": creating softlink of $gthGb to $otherfilesDir/genbank.good.gb.\n";
2448-
$cmdString = "ln -s $gthGb $otherfilesDir/genbank.good.gb";
2448+
$cmdString = "cp $gthGb $otherfilesDir/genbank.good.gb";
24492449
print LOG "$cmdString\n";
24502450
system($cmdString)==0 or die("failed to execute: $cmdString!\n");
24512451

@@ -3756,7 +3756,7 @@ sub train_utr{
37563756
system("$cmdString") or die ("Failed to execute: $cmdString!\n");
37573757
}else{
37583758
print LOG "\# ".(localtime).": Creating softlink to bam file $bam[0]...\n";
3759-
$cmdString = "ln -s $bam[0] merged.bam";
3759+
$cmdString = "cp $bam[0] merged.bam";
37603760
print LOG "$cmdString\n";
37613761
system($cmdString)==0 or die("Failed to exectute: $cmdString!\n");
37623762
}

0 commit comments

Comments
 (0)