Skip to content

Commit 9d6722d

Browse files
Jon PalmerJon Palmer
authored andcommitted
fix protein/transcript output
1 parent eaf4715 commit 9d6722d

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

bin/funannotate-predict.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -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):
997997
final_gbk = os.path.join(args.out, 'predict_results', base + '.gbk')
998998
final_tbl = os.path.join(args.out, 'predict_results', base + '.tbl')
999999
final_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
10021002
shutil.copyfile(os.path.join('tbl2asn', 'genome.fasta'), os.path.join('tbl2asn', 'genome.fsa'))
10031003
discrep = os.path.join(args.out, 'predict_results', base + '.discrepency.report.txt')
10041004
lib.log.info("Converting to final Genbank format")
10051005
subprocess.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)
10071006
shutil.copyfile(os.path.join('tbl2asn', 'genome.gff'), final_gff)
10081007
shutil.copyfile(os.path.join('tbl2asn', 'genome.gbf'), final_gbk)
10091008
shutil.copyfile(os.path.join('tbl2asn', 'genome.tbl'), final_tbl)
10101009
lib.log.info("Collecting final annotation files")
1010+
lib.gb2output(final_gbk, final_proteins, final_transcripts, final_fasta)
10111011

10121012
lib.log.info("Funannotate predict is finished, output files are in the %s/predict_results folder" % (args.out))
10131013
lib.log.info("Note, you should fix any tbl2asn errors now before running functional annotation.")

0 commit comments

Comments
 (0)