Skip to content

Commit

Permalink
rstrip(*) from proteins if GFF/FASTA passed; #508 i was wrong!
Browse files Browse the repository at this point in the history
  • Loading branch information
Jon Palmer committed Oct 30, 2020
1 parent d6c3899 commit 05f0691
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 18 deletions.
27 changes: 9 additions & 18 deletions funannotate/annotate.py
Expand Up @@ -434,12 +434,9 @@ def __init__(self, prog):
else:
Scaffolds = args.fasta
GFF = args.gff
Proteins = os.path.join(
outputdir, 'annotate_misc', 'genome.proteins.fa')
Transcripts = os.path.join(
outputdir, 'annotate_misc', 'genome.transcripts.fasta')
annotTBL = os.path.join(
outputdir, 'annotate_misc', 'genome.tbl')
Proteins = os.path.join(outputdir, 'annotate_misc', 'genome.proteins.fa')
Transcripts = os.path.join(outputdir, 'annotate_misc', 'genome.transcripts.fasta')
annotTBL = os.path.join(outputdir, 'annotate_misc', 'genome.tbl')
prefix = None
if args.rename:
prefix = args.rename.replace('_', '')
Expand All @@ -449,12 +446,9 @@ def __init__(self, prog):
GFF, prefix, Scaffolds, Proteins, Transcripts, annotTBL, external=True)
else:
genbank = args.genbank
Scaffolds = os.path.join(
outputdir, 'annotate_misc', 'genome.scaffolds.fasta')
Proteins = os.path.join(
outputdir, 'annotate_misc', 'genome.proteins.fasta')
Transcripts = os.path.join(
outputdir, 'annotate_misc', 'genome.transcripts.fasta')
Scaffolds = os.path.join(outputdir, 'annotate_misc', 'genome.scaffolds.fasta')
Proteins = os.path.join(outputdir, 'annotate_misc', 'genome.proteins.fasta')
Transcripts = os.path.join(outputdir, 'annotate_misc', 'genome.transcripts.fasta')
GFF = os.path.join(outputdir, 'annotate_misc', 'genome.gff3')
annotTBL = os.path.join(outputdir, 'annotate_misc', 'genome.tbl')
lib.log.info("Checking GenBank file for annotation")
Expand Down Expand Up @@ -523,12 +517,9 @@ def __init__(self, prog):
lib.log.error(
"Found existing output directory %s. Warning, will re-use any intermediate files found." % (outputdir))
lib.log.info("Parsing input files")
Scaffolds = os.path.join(
outputdir, 'annotate_misc', 'genome.scaffolds.fasta')
Proteins = os.path.join(
outputdir, 'annotate_misc', 'genome.proteins.fasta')
Transcripts = os.path.join(
outputdir, 'annotate_misc', 'genome.transcripts.fasta')
Scaffolds = os.path.join(outputdir, 'annotate_misc', 'genome.scaffolds.fasta')
Proteins = os.path.join(outputdir, 'annotate_misc', 'genome.proteins.fasta')
Transcripts = os.path.join(outputdir, 'annotate_misc', 'genome.transcripts.fasta')
if TBL:
lib.log.info('Existing tbl found: {:}'.format(TBL))
shutil.copyfile(TBL, annotTBL)
Expand Down
4 changes: 4 additions & 0 deletions funannotate/library.py
Expand Up @@ -1994,9 +1994,13 @@ def _sortDict(d):
Transcript = str(v['transcript'][i])
except IndexError:
print((k, v))
if v['strand'] == '-':
Transcript = RevComp(Transcript)
tranout.write('>%s %s\n%s\n' % (x, k, softwrap(Transcript)))
if v['type'] == 'mRNA':
Prot = v['protein'][i]
if Prot.endswith('*'):
Prot = Prot.rstrip('*')
protout.write('>%s %s\n%s\n' % (x, k, softwrap(Prot)))

return len(Genes), geneDB
Expand Down

0 comments on commit 05f0691

Please sign in to comment.