Skip to content

Commit

Permalink
Add gene_id as a 2nd option to get GTF names
Browse files Browse the repository at this point in the history
  • Loading branch information
lpantano committed Aug 5, 2016
1 parent 13eb826 commit e167c54
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions seqcluster/libs/annotation.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ def read_gtf_line(cols):
group = cols[2]
attrs = cols[8].split(";")
name = [attr.strip().split(" ")[1] for attr in attrs if attr.strip().split(" ")[0].lower().endswith("name")]
if not name:
name = [attr.strip().split(" ")[1] for attr in attrs if attr.strip().split(" ")[0].lower().endswith("gene_id")]

biotype = [attr.strip().split(" ")[1] for attr in attrs if attr.strip().split(" ")[0].lower().endswith("biotype")]
if biotype:
group = biotype[0]
Expand Down

0 comments on commit e167c54

Please sign in to comment.