Last active
March 4, 2016 19:25
-
-
Save rmzelle/2dfd897a285c581c164b to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import gffutils | |
import os | |
genomeGFF = 'test.gff' | |
genomeGFFdb = 'test.db' | |
db = gffutils.create_db(genomeGFF, dbfn=genomeGFFdb, force=True, merge_strategy="merge") | |
def generatorModifyFeatures(featureFamilies): | |
for featureFamily in featureFamilies: | |
print featureFamily | |
print type(featureFamily) | |
yield featureFamily | |
featureFamilies = list(db.iter_by_parent_childs()) | |
db.update(generatorModifyFeatures(featureFamilies), merge_strategy="replace") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
>>> ================================ RESTART ================================ | |
>>> | |
[<Feature gene (scaffold10_size537661:22073-23956[-]) at 0x2c87f60L>, <Feature CDS (scaffold10_size537661:22076-23956[-]) at 0x2d7a6d8L>, <Feature exon (scaffold10_size537661:22076-23956[-]) at 0x2d7a9e8L>, <Feature mRNA (scaffold10_size537661:22073-23956[-]) at 0x2c93160L>] | |
<type 'list'> | |
Traceback (most recent call last): | |
File "...\minimal-failure.py", line 17, in <module> | |
db.update(generatorModifyFeatures(featureFamilies), merge_strategy="replace") | |
File "...\WinPython-64bit-2.7.9.1\python-2.7.9.amd64\lib\site-packages\gffutils\interface.py", line 809, in update | |
data = iterators.DataIterator(data, **_iterator_kwargs) | |
File "...\WinPython-64bit-2.7.9.1\python-2.7.9.amd64\lib\site-packages\gffutils\iterators.py", line 278, in DataIterator | |
return _FeatureIterator(**_kwargs) | |
File "...\WinPython-64bit-2.7.9.1\python-2.7.9.amd64\lib\site-packages\gffutils\iterators.py", line 93, in __init__ | |
self._observed_dialects = [i.dialect for i in self.peek] | |
AttributeError: 'list' object has no attribute 'dialect' | |
>>> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
##gff-version 3 | |
##sequence-region scaffold10_size537661 1 537661 | |
scaffold10_size537661 AUGUSTUS gene 22073 23956 . - 0 ID=95_g3576;Name=ARN1; | |
scaffold10_size537661 AUGUSTUS mRNA 22073 23956 . - 0 Parent=95_g3576;product=Siderophore iron transporter ARN1 | |
scaffold10_size537661 AUGUSTUS exon 22076 23956 1 - 0 Parent=95_g3576; | |
scaffold10_size537661 AUGUSTUS CDS 22076 23956 1 - 0 Parent=95_g3576;Name=ARN1; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment