Skip to content

Commit

Permalink
Interpret : or = for gene token in fasta files
Browse files Browse the repository at this point in the history
  • Loading branch information
davidemms committed Jan 6, 2021
1 parent cab6c69 commit 425347e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion tools/primary_transcript.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ def ScanTags_with_fn(fn, gene_name_fn):
# print(sorted(genes)[:10])

def GetGeneName(acc_line):
tokens = [t.split(":")[1] for t in acc_line.rstrip().split() if "gene:" in t]
tokens = [(t.split("=") if "=" in t else t.split(":"))[1] for t in acc_line.rstrip().split() if ("gene:" in t or "gene=" in t)]
if len(tokens) != 1: return None
return tokens[0]

Expand Down

0 comments on commit 425347e

Please sign in to comment.