Giter Club home page Giter Club logo

Comments (4)

daler avatar daler commented on September 13, 2024

By the way, keep in mind #6 when adding infrastructure for this issue.

from gffutils.

daler avatar daler commented on September 13, 2024

From #20:

In ENSEMBL, exons have different ENSE ids if they are of different frames. Ideally, the same exon locus exon:chr1:100-200:+:. would be a parent to both CDS:chr1:100-200:+:2 and CDS:chr1:100-150:+:0. So somehow the parent exon locus would have to match up with the different ENSE ids of the CDSs

Assuming the existence of FeatureDB.add_relation, would this work? :

db = FeatureDB('filename.db')
exon = db["exon:chr1:100-200:+:."]

# Get CDSs that fall within this exon
for cds in db.region(exon, featuretype='CDS', completely_within=True):

    # Maybe some filtering here to confirm that these are the 
    # CDSs you're looking for...

    def child_func(parent, child):
        child.attributes['parent_exon'] = parent['ENSE']
        return child

    db.add_relation(
        parent=exon, child=cds, level=1,
        parent_func=lambda x: x, child_func=child_func)

from gffutils.

olgabot avatar olgabot commented on September 13, 2024

Yes I think this would work!

from gffutils.

daler avatar daler commented on September 13, 2024

As of 715a615 there's now an add_relation method. Can you give it a shot when you get a chance? Usage should be what I sketched out above.

from gffutils.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.