Comments (4)
By the way, keep in mind #6 when adding infrastructure for this issue.
from gffutils.
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 bothCDS:chr1:100-200:+:2
andCDS: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.
Yes I think this would work!
from gffutils.
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)
- "ValueError: The ID field ID has more than one value" when updating database. HOT 2
- Map transcript coordinates to genome coordinates HOT 3
- db.parents(id) stops at level 2?
- Apologies - delete me!
- Handling of multi-line features with same ID HOT 3
- Inconsistent behaviour of trailing semicolon HOT 1
- gtf_extract command not found with conda installation HOT 4
- Please remove 'nose' dependencies from tests: nose is not maintained and doesn't work any more on many systems HOT 1
- Field separators in quoted attributes cause error HOT 4
- create_db() does not parse directives from GFF files starting in v0.11.0 HOT 3
- merge_strategy='create_unique' not always creating unique id's HOT 2
- Sqlite3.OptimizedUnicode deprecation warning HOT 1
- how to save the modified gff to the disk HOT 2
- How to get all the gene ids of the read gff file HOT 1
- Suggestion: Drop support for python < 3.7 and add support for newer python verison
- gffutils-cli incompatability with argh >= 0.30.0
- How to get closest features? HOT 1
- FeatureDB.update on disk db very slow HOT 2
- Value of Target attribute gains quotes when it shouldn't in round trip manipulation HOT 4
- Update an entry and retain children HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from gffutils.