@@ -729,17 +729,17 @@ def __init__(self,prog):
729729 elif not any ([Transcripts ,Exonerate ]):
730730 evm_cmd = [sys .executable , EVM_script , os .path .join (args .out , 'logfiles' , 'funannotate-EVM_busco.log' ), str (args .cpus ), '--genome' , MaskGenome , '--gene_predictions' , Busco_Predictions , '--weights' , Busco_Weights , '--min_intron_length' , str (args .min_intronlen ), EVM_busco ]
731731 #run EVM
732- if not os .path .isfile (EVM_out ):
732+ if not os .path .isfile (EVM_busco ):
733733 subprocess .call (evm_cmd )
734734 try :
735- total = lib .countGFFgenes (EVM_out )
735+ total = lib .countGFFgenes (EVM_busco )
736736 except IOError :
737737 lib .log .error ("EVM did not run correctly, output file missing" )
738738 os ._exit (1 )
739739 #check number of gene models, if 0 then failed, delete output file for re-running
740740 if total < 1 :
741741 lib .log .error ("Evidence modeler has failed, exiting" )
742- os .remove (EVM_out )
742+ os .remove (EVM_busco )
743743 os ._exit (1 )
744744 else :
745745 lib .log .info ('{0:,}' .format (total ) + ' total gene models from EVM' )
@@ -753,12 +753,12 @@ def __init__(self,prog):
753753 evm_proteins = os .path .join (args .out , 'predict_misc' , 'busco.evm.proteins.fa' )
754754 busco_final = os .path .join (args .out , 'predict_misc' , 'busco.final.gff3' )
755755 with open (evm_proteins , 'w' ) as output :
756- subprocess .call ([EVM2proteins , EVM_out , MaskGenome ], stdout = output )
756+ subprocess .call ([EVM2proteins , EVM_busco , MaskGenome ], stdout = output )
757757 if not os .path .isdir (os .path .join (args .out , 'predict_misc' , 'busco_proteins' )):
758758 os .makedirs (os .path .join (args .out , 'predict_misc' , 'busco_proteins' ))
759759 with open (busco_log , 'a' ) as logfile :
760760 subprocess .call ([sys .executable , BUSCO , '-in' , os .path .abspath (evm_proteins ), '--lineage' , BUSCO_FUNGI , '-a' , aug_species , '--cpu' , str (args .cpus ), '-m' , 'OGS' , '-f' ], cwd = os .path .join (args .out , 'predict_misc' , 'busco_proteins' ), stdout = logfile , stderr = logfile )
761- subprocess .call ([os .path .join (parentdir , 'util' , 'filter_buscos.py' ), EVM_out , os .path .join (args .out , 'predict_misc' , 'busco_proteins' , 'run_' + aug_species , 'full_table_' + aug_species ), busco_final ], stdout = FNULL , stderr = FNULL )
761+ subprocess .call ([os .path .join (parentdir , 'util' , 'filter_buscos.py' ), EVM_busco , os .path .join (args .out , 'predict_misc' , 'busco_proteins' , 'run_' + aug_species , 'full_table_' + aug_species ), busco_final ], stdout = FNULL , stderr = FNULL )
762762 total = lib .countGFFgenes (busco_final )
763763 lib .log .info ('{0:,}' .format (total ) + ' gene models validated, using for training Augustus' )
764764
@@ -997,17 +997,17 @@ def __init__(self,prog):
997997final_gbk = os .path .join (args .out , 'predict_results' , base + '.gbk' )
998998final_tbl = os .path .join (args .out , 'predict_results' , base + '.tbl' )
999999final_proteins = os .path .join (args .out , 'predict_results' , base + '.proteins.fa' )
1000-
1000+ final_transcripts = os . path . join ( args . out , 'predict_results' , base + '.proteins.fa' )
10011001#run tbl2asn in new directory directory
10021002shutil .copyfile (os .path .join ('tbl2asn' , 'genome.fasta' ), os .path .join ('tbl2asn' , 'genome.fsa' ))
10031003discrep = os .path .join (args .out , 'predict_results' , base + '.discrepency.report.txt' )
10041004lib .log .info ("Converting to final Genbank format" )
10051005subprocess .call (['tbl2asn' , '-p' , 'tbl2asn' , '-t' , SBT , '-M' , 'n' , '-Z' , discrep , '-a' , 'r10u' , '-l' , 'paired-ends' , '-j' , ORGANISM , '-V' , 'b' , '-c' , 'fx' ], stdout = FNULL , stderr = FNULL )
1006- shutil .copyfile (os .path .join ('tbl2asn' , 'genome.fasta' ), final_fasta )
10071006shutil .copyfile (os .path .join ('tbl2asn' , 'genome.gff' ), final_gff )
10081007shutil .copyfile (os .path .join ('tbl2asn' , 'genome.gbf' ), final_gbk )
10091008shutil .copyfile (os .path .join ('tbl2asn' , 'genome.tbl' ), final_tbl )
10101009lib .log .info ("Collecting final annotation files" )
1010+ lib .gb2output (final_gbk , final_proteins , final_transcripts , final_fasta )
10111011
10121012lib .log .info ("Funannotate predict is finished, output files are in the %s/predict_results folder" % (args .out ))
10131013lib .log .info ("Note, you should fix any tbl2asn errors now before running functional annotation." )
0 commit comments