Skip to content

Commit

Permalink
gtf: use gene_id or gene if gene_name is missing
Browse files Browse the repository at this point in the history
  • Loading branch information
e-sollier committed Nov 15, 2024
1 parent 088a63f commit d455a58
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 5 deletions.
2 changes: 1 addition & 1 deletion figeno/cli/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

from figeno.cli import gui, init,make

__version__ = "1.6.2"
__version__ = "1.6.3"

def main():
parser = ArgumentParser("figeno",formatter_class=ArgumentDefaultsHelpFormatter)
Expand Down
6 changes: 6 additions & 0 deletions figeno/genes.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,9 @@ def read_genes_gtf(gtf_file,chr=None,start=None,end=None,gene_names=None,collaps
if x.lstrip(" ").startswith("gene_name"):
x = x[x.find("\"")+1:]
gene_name = x[:x.find("\"")]
elif (x.lstrip(" ").startswith("gene_id") or x.lstrip(" ").startswith("gene")) and gene_name=="":
x = x[x.find("\"")+1:]
gene_name = x[:x.find("\"")]
elif x.lstrip(" ").startswith("transcript_name"):
x = x[x.find("\"")+1:]
transcript_name = x[:x.find("\"")]
Expand Down Expand Up @@ -156,6 +159,9 @@ def read_genes_gtf(gtf_file,chr=None,start=None,end=None,gene_names=None,collaps
elif x.lstrip(" ").startswith("gene_name"):
x = x[x.find("\"")+1:]
gene_name = x[:x.find("\"")]
elif (x.lstrip(" ").startswith("gene_id") or x.lstrip(" ").startswith("gene")) and gene_name=="":
x = x[x.find("\"")+1:]
gene_name = x[:x.find("\"")]

if (gene_names is not None) and (not gene_name.upper() in gene_names): continue
if collapsed: name = gene_name
Expand Down
4 changes: 2 additions & 2 deletions figeno/gui/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion figeno/gui/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "figeno",
"version": "1.6.2",
"version": "1.6.3",
"private": true,
"homepage": "./",
"dependencies": {
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ packages = ["figeno", "figeno.data", "figeno.cli", "figeno.gui"]

[project]
name = 'figeno'
version = "1.6.2"
version = "1.6.3"
description = 'Package for generating genomics figures.'
readme = 'README.md'
authors = [
Expand Down

0 comments on commit d455a58

Please sign in to comment.