|
13 | 13 | # #
|
14 | 14 | # This script is under the Artistic Licence #
|
15 | 15 | # (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# |
17 | 18 | ####################################################################################################
|
18 | 19 |
|
19 | 20 | use Getopt::Long;
|
|
212 | 213 |
|
213 | 214 |
|
214 | 215 |
|
215 |
| -my $version = 2.0.3; # braker.pl version number |
| 216 | +my $version = "2.0.3b"; # braker.pl version number |
216 | 217 | my $logString; # stores log messages produced before opening log file
|
217 | 218 | my $printString;
|
218 | 219 | my $alternatives_from_evidence = "true"; # output alternative transcripts based on explicit evidence from hints
|
|
221 | 222 | my $augustus_bin_path; # path to augustus folder binaries folder
|
222 | 223 | my $augustus_scripts_path; # path to augustus scripts folder
|
223 | 224 | 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 |
| -} |
236 | 225 | 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 |
| - |
250 | 226 | 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 |
| -} |
263 | 227 | my @bam; # bam file names
|
264 | 228 | my $bamtools_path;
|
265 | 229 | 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 |
| -} |
278 | 230 | my @bonus; # array of bonus values for extrinsic file
|
279 | 231 | my $bool_species = "true"; # false, if $species contains forbidden words (e.g. chmod)
|
280 | 232 | my $cmdString; # to store shell commands
|
|
291 | 243 | my $genbank; # genbank file name
|
292 | 244 | my $genemarkDir; # directory for GeneMark-ET output
|
293 | 245 | 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 |
| -} |
306 | 246 | my $GMET_path; # GeneMark-ET path, higher priority than $GENEMARK_PATH; will use the same variable for GeneMark-EP path
|
307 | 247 | my $genome; # name of sequence file
|
308 | 248 | my $genome_length = 0; # length of genome file
|
|
322 | 262 | my $perlCmdString; # stores perl commands
|
323 | 263 | my $printVersion = 0; # print version number, if set
|
324 | 264 | 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 |
| -} |
337 | 265 | my $SAMTOOLS_PATH_OP; # path to samtools executable, higher priority than $SAMTOOLS_PATH on system
|
338 | 266 | my $scriptPath=dirname($0); # path of directory where this script is located
|
339 | 267 | my $skipGeneMarkET = 0; # skip GeneMark-ET and use provided GeneMark-ET output (e.g. from a different source)
|
|
368 | 296 | my @prot_seq_files; # variable to store protein sequence file name
|
369 | 297 | my @prot_aln_files; # variable to store protein alingment file name
|
370 | 298 | 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 |
| -} |
383 | 299 | my $ALIGNMENT_TOOL_PATH_OP; # higher priority than environment variable
|
384 | 300 | my %hintTypes; # stores hint types occuring over all generated and supplied hints for comparison
|
385 | 301 | my $rnaseq2utr_args; # additional parameters to be passed to rnaseq2utr
|
|
505 | 421 | print "braker.pl version $version\n";
|
506 | 422 | exit(0);
|
507 | 423 | }
|
| 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 | +} |
508 | 509 |
|
509 | 510 | if($skipAllTraining){ # if no training is performed, existing parameters must be used
|
510 | 511 | $useexisting=1;
|
|
534 | 535 | }
|
535 | 536 |
|
536 | 537 |
|
537 |
| - |
538 | 538 | # check the write permission of $workDir before building of the work directory
|
539 | 539 | if(! -w $workDir){
|
540 | 540 | $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 | 1400 |
|
1401 | 1401 | if(defined($geneMarkGtf)){
|
1402 | 1402 | 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"; |
1404 | 1404 | print LOG "$cmdString\n";
|
1405 | 1405 | system($cmdString)==0 or die("failed to execute: $cmdString!\n");
|
1406 | 1406 | }
|
|
1471 | 1471 | if(@prot_seq_files or @prot_aln_files or @hints){
|
1472 | 1472 | separateHints();
|
1473 | 1473 | }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"; |
1476 | 1476 | print LOG "$cmdString\n";
|
1477 | 1477 | system($cmdString)==0 or die("failed to execute: $cmdString!\n");
|
1478 | 1478 | }
|
@@ -1813,8 +1813,8 @@ sub separateHints{
|
1813 | 1813 | print LOG "$cmdString\n\n";
|
1814 | 1814 | system($cmdString)==0 or die("Failed to execute: $cmdString\n");
|
1815 | 1815 | }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"; |
1818 | 1818 | print LOG "$cmdString\n";
|
1819 | 1819 | system($cmdString)==0 or die("Failed to execute: $cmdString\n");
|
1820 | 1820 | }
|
@@ -2394,7 +2394,7 @@ sub training{
|
2394 | 2394 | }
|
2395 | 2395 | close(FILTEREDGTH) or die ("Could not close file $gthTrainGeneFile.f!\n");
|
2396 | 2396 | }else{
|
2397 |
| - $cmdString = "ln -s $gthTrainGeneFile $gthTrainGeneFile.f"; |
| 2397 | + $cmdString = "cp $gthTrainGeneFile $gthTrainGeneFile.f"; |
2398 | 2398 | print LOG "$cmdString\n\n";
|
2399 | 2399 | system("$cmdString")==0 or die("Failed to execute: $cmdString\n");
|
2400 | 2400 | }
|
@@ -2438,14 +2438,14 @@ sub training{
|
2438 | 2438 | if(not($trainFromGth) && not($gth2traingenes)){
|
2439 | 2439 | # make genemark gb final
|
2440 | 2440 | 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"; |
2442 | 2442 | print LOG "$cmdString\n";
|
2443 | 2443 | system($cmdString)==0 or die("failed to execute: $cmdString!\n");
|
2444 | 2444 |
|
2445 | 2445 | }elsif($trainFromGth){
|
2446 | 2446 | # make gth gb final
|
2447 | 2447 | 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"; |
2449 | 2449 | print LOG "$cmdString\n";
|
2450 | 2450 | system($cmdString)==0 or die("failed to execute: $cmdString!\n");
|
2451 | 2451 |
|
@@ -3756,7 +3756,7 @@ sub train_utr{
|
3756 | 3756 | system("$cmdString") or die ("Failed to execute: $cmdString!\n");
|
3757 | 3757 | }else{
|
3758 | 3758 | 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"; |
3760 | 3760 | print LOG "$cmdString\n";
|
3761 | 3761 | system($cmdString)==0 or die("Failed to exectute: $cmdString!\n");
|
3762 | 3762 | }
|
|
0 commit comments