Skip to content

Commit

Permalink
lower feature_id to ignore capital cases
Browse files Browse the repository at this point in the history
  • Loading branch information
lpantano committed Aug 10, 2016

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
1 parent 5cdb7b9 commit c6a7db6
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion seqcluster/libs/annotation.py
Original file line number Diff line number Diff line change
@@ -8,13 +8,15 @@

def read_gtf_line(cols, field="name"):
"""parse gtf line to get class/name information"""
field = field.lower()
try:
group = cols[2]
attrs = cols[8].split(";")
name = [attr.strip().split(" ")[1] for attr in attrs if attr.strip().split(" ")[0].lower().endswith(field)]
if not name:
name = [attr.strip().split(" ")[1] for attr in attrs if attr.strip().split(" ")[0].lower().endswith("gene_id")]

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

0 comments on commit c6a7db6

Please sign in to comment.