Skip to content

Commit

Permalink
initial fix
Browse files Browse the repository at this point in the history
  • Loading branch information
mpoelchau committed Oct 16, 2023
1 parent 9b36c5c commit ed66755
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion gff3tool/bin/gff3_to_fasta.py
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,10 @@ def splicer(gff, ftype, dline, stype, embedded_fasta=False):
cname = child['attributes']['Name']
defline='>{0:s}'.format(cid)
if stype == "pep":
cid = re.sub(r'(.+-)(R)([a-zA-Z]+)', r'\1P\3', cid)
if 'protein_id' in child['attributes']:
cid = child['attributes']['protein_id']
else:
cid = re.sub(r'(.+-)(R)([a-zA-Z]+)', r'\1P\3', cid)
defline = '>{0:s}'.format(cid)
elif ftype[0] == 'CDS':
defline='>{0:s}-CDS'.format(cid)
Expand Down

0 comments on commit ed66755

Please sign in to comment.