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

db.parents(id) stops at level 2? #204

Open
dariober opened this issue Jan 12, 2023 · 0 comments
Open

db.parents(id) stops at level 2? #204

dariober opened this issue Jan 12, 2023 · 0 comments

Comments

@dariober
Copy link

dariober commented Jan 12, 2023

I'm applying db.parents(id) to features that have up to 3 parents, e.g. the nesting is id -> protein_match -> mRNA -> gene. It appears that the 3rd level, gene, is not returned. Am I missing something? Here's an example:

import gffutils

txt="""\
chr1 AUGUSTUS gene 68330 73621 1 - . ID=g1903;
chr1 AUGUSTUS mRNA 68330 73621 1 - . ID=g1903.t1;Parent=g1903;
chr1 Pfam protein_match 73372 73618 1 - . ID=g1903.t1.d1;Parent=g1903.t1;
chr1 Pfam protein_hmm_match 73372 73618 1 - . ID=g1903.t1.d1.1;Parent=g1903.t1.d1;
"""

db = gffutils.create_db(txt.replace(' ', '\t'), ':memory:', from_string=True)

Show the features:

for x in db.all_features():
    print(x)

chr1 AUGUSTUS gene              68330 73621 1 - . ID=g1903;
chr1 AUGUSTUS mRNA              68330 73621 1 - . ID=g1903.t1;Parent=g1903;
chr1 Pfam     protein_match     73372 73618 1 - . ID=g1903.t1.d1;Parent=g1903.t1;
chr1 Pfam     protein_hmm_match 73372 73618 1 - . ID=g1903.t1.d1.1;Parent=g1903.t1.d1;

Now, db.parents('g1903.t1.d1.1') returns as parents protein_match and the mRNA, but not the gene:

pp = db.parents('g1903.t1.d1.1')

for p in pp:
    print(p)

chr1	AUGUSTUS	mRNA	68330	73621	1	-	.	ID=g1903.t1;Parent=g1903;
chr1	Pfam	protein_match	73372	73618	1	-	.	ID=g1903.t1.d1;Parent=g1903.t1;

Shouldn't gene also be retrieved as a parent? Thanks!

This is with gffutils 0.11.1

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

1 participant