@@ -439,14 +439,21 @@ def __init__(self,prog):
439
439
Option1 = '--AUGUSTUS_CONFIG_PATH=' + AUGUSTUS
440
440
Option2 = '--BAMTOOLS_PATH=' + BAMTOOLS_PATH
441
441
Option3 = '--GENEMARK_PATH=' + GENEMARK_PATH
442
- with open (braker_log , 'w' ) as logfile :
443
- if args .organism == 'fungus' :
444
- subprocess .call (['braker.pl' , '--fungus' , '--cores' , str (args .cpus ), Option1 , Option2 , Option3 , '--gff3' , '--softmasking' , '1' , genome , species , bam ], stdout = logfile , stderr = logfile )
445
- else :
446
- subprocess .call (['braker.pl' , '--cores' , str (args .cpus ), Option1 , Option2 , Option3 , '--gff3' , '--softmasking' , '1' , genome , species , bam ], stdout = logfile , stderr = logfile )
442
+ #check if output is already there
443
+ if not os .path .isdir (os .path .join (args .out , 'predict_misc' , 'braker' )):
444
+ with open (braker_log , 'w' ) as logfile :
445
+ if args .organism == 'fungus' :
446
+ subprocess .call (['braker.pl' , '--fungus' , '--cores' , str (args .cpus ), Option1 , Option2 , Option3 , '--gff3' , '--softmasking' , '1' , genome , species , bam ], stdout = logfile , stderr = logfile )
447
+ else :
448
+ subprocess .call (['braker.pl' , '--cores' , str (args .cpus ), Option1 , Option2 , Option3 , '--gff3' , '--softmasking' , '1' , genome , species , bam ], stdout = logfile , stderr = logfile )
449
+ #move braker output folder
450
+ if os .path .isdir ('braker' ):
451
+ if os .path .isdir (os .path .join (args .out , 'predict_misc' , 'braker' )):
452
+ shutil .rmtree (os .path .join (args .out , 'predict_misc' , 'braker' ))
453
+ os .rename ('braker' , os .path .join (args .out , 'predict_misc' , 'braker' ))
447
454
#okay, now need to fetch the Augustus GFF and Genemark GTF files
448
- aug_out = os .path .join ('braker' , aug_species , 'augustus.gff3' )
449
- gene_out = os .path .join ('braker' , aug_species , 'GeneMark-ET' , 'genemark.gtf' )
455
+ aug_out = os .path .join (args . out , 'predict_misc' , 'braker' , aug_species , 'augustus.gff3' )
456
+ gene_out = os .path .join (args . out , 'predict_misc' , 'braker' , aug_species , 'GeneMark-ET' , 'genemark.gtf' )
450
457
#now convert to EVM format
451
458
Augustus = os .path .join (args .out , 'predict_misc' , 'augustus.evm.gff3' )
452
459
with open (Augustus , 'w' ) as output :
@@ -462,11 +469,6 @@ def __init__(self,prog):
462
469
with open (GeneMarkTemp , 'rU' ) as input :
463
470
lines = input .read ().replace ("Augustus" ,"GeneMark" )
464
471
output .write (lines )
465
- if os .path .isdir ('braker' ):
466
- if os .path .isdir (os .path .join (args .out , 'predict_misc' , 'braker' )):
467
- shutil .rmtree (os .path .join (args .out , 'predict_misc' , 'braker' ))
468
- os .rename ('braker' , os .path .join (args .out , 'predict_misc' , 'braker' ))
469
-
470
472
471
473
if args .pasa_gff and not Augustus :
472
474
#use pasa models to train Augustus if not already trained
0 commit comments