Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

create annotator from 10x references genes.gtf.gz #21

Open
leezx opened this issue Mar 13, 2023 · 1 comment
Open

create annotator from 10x references genes.gtf.gz #21

leezx opened this issue Mar 13, 2023 · 1 comment

Comments

@leezx
Copy link

leezx commented Mar 13, 2023

encounter an error when creating annotator from 10x gtf file.

Modifying the get_exon_number function works for me.

def get_exon_number(row):
  if "exon_number" in row["attribute"]:
    # return int(row["attribute"].split("exon_number")[-1].split("\"")[1].split(";")[0])
    return int(row["attribute"].split(";")[8].split(" ")[-1])
@wook2014
Copy link

wook2014 commented Sep 6, 2023

I encounter the same error when creating annotator from gtf file.
ValueError: invalid literal for int() with base 10: 'ENSE00002234944.1'
It seemed that the function here want to get "exon_number" here but actually it turns for "exon_id".
I find the reason is that my gtf file don't have the quotation mark in "exon_number" field and here is one solution:
return int(row["attribute"].split("exon_number")[-1].split(";")[0].strip())
it returns the "exon_number" instead of "exon_id"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants