Skip to content

Commit

Permalink
gtf: use gene attribute for finding gene coords
Browse files Browse the repository at this point in the history
  • Loading branch information
e-sollier committed Nov 15, 2024
1 parent d455a58 commit bcbdf46
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions figeno/genes.py
Original file line number Diff line number Diff line change
Expand Up @@ -347,7 +347,7 @@ def find_genecoord_gtf(gene_name,file):
linesplit = line.split("\t")
if linesplit[2] in ["gene","miRNA_gene","rRNA_gene"]:
for x in linesplit[8].split(";"):
if x.lstrip(" ").startswith("gene_name"):
if x.lstrip(" ").startswith("gene_name") or x.lstrip(" ").startswith("gene"):
x = x[x.find("\"")+1:]
name = x[:x.find("\"")]
if gene_name.upper()==name.upper():
Expand All @@ -362,7 +362,7 @@ def find_genecoord_gtf(gene_name,file):
else: break
if linesplit[2] in ["transcript"]:
for x in linesplit[8].split(";"):
if x.lstrip(" ").startswith("gene_name"):
if x.lstrip(" ").startswith("gene_name") or x.lstrip(" ").startswith("gene"):
x = x[x.find("\"")+1:]
name = x[:x.find("\"")]
if gene_name.upper()==name.upper():
Expand Down

0 comments on commit bcbdf46

Please sign in to comment.