Giter Club home page Giter Club logo

pygtf's People

Contributors

chengcz avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Forkers

dee-chen

pygtf's Issues

KeyError: 'ID'

When use pyGTF, i Encountered KeyError: 'ID'
my code

import sys
from pyGTF import Transcript
from pyGTF import GTFReader
with GTFReader('A.gtf',flag_stream=True) as fi:
for i in fi:
print(i.summary)

INFO @ pyGTF.py:1277, 2020-07-18 10:07:08,861, Skip Known Annotation Feature:
(biological_region, stop_codon, gene, Selenocysteine, start_codon, pseudogene, chromosome, ncRNA_gene)

KeyError Traceback (most recent call last)
in ()
1 with GTFReader('A.gtf',flag_stream=True) as fi:
----> 2 for i in fi:
3 print(i.summary)
4

~\AppData\Local\Continuum\anaconda3\lib\site-packages\pygtf-0.1.1-py3.6.egg\pyGTF.py in iter(self)
1191 def iter(self):
1192 Iterator = self.__stream_mode() if self._flag_stream else self.__store_mode()
-> 1193 for trans in Iterator:
1194 _transid, _chro, _interval, _strand, _exon, _cds, _utr, _attr = trans
1195 _attr = {

~\AppData\Local\Continuum\anaconda3\lib\site-packages\pygtf-0.1.1-py3.6.egg\pyGTF.py in __stream_mode(self)
1205 '''
1206 t_id, t_exon, t_cds, t_utr, t_info = None, Interval(), Interval(), Interval(), {}
-> 1207 for line in self.__read_gtf():
1208 chro, _, feature, start, end, _, strand, _, attr, line_id = line
1209

~\AppData\Local\Continuum\anaconda3\lib\site-packages\pygtf-0.1.1-py3.6.egg\pyGTF.py in __read_gtf(self)
1291 attr = [x.strip().partition('=') for x in attr.split(';') if x.strip()]
1292 attr = {x[0]: x[2].strip(''\t\n\r"') for x in attr}
-> 1293 line_id = attr['ID'] if feature in self._transcript_feature else attr['Parent']
1294 else:
1295 attr = [x.strip().partition(' ') for x in attr.split(';') if x.strip()]

KeyError: 'ID'

A.gtf

NC_012007.3 StringTie transcript 10713 27534 . + . transcript_id "TCONS_00003418"; gene_id "XLOC_000004"; gene_name "LOC104879287"; oId "STRG.2.1"; cmp_ref "XR_785793.2"; class_code "="; tss_id "TSS42"; num_samples "4";
NC_012007.3 StringTie exon 10713 10945 . + . transcript_id "TCONS_00003418"; gene_id "XLOC_000004"; exon_number "1";
NC_012007.3 StringTie exon 12426 12529 . + . transcript_id "TCONS_00003418"; gene_id "XLOC_000004"; exon_number "2";
NC_012007.3 StringTie exon 12628 12700 . + . transcript_id "TCONS_00003418"; gene_id "XLOC_000004"; exon_number "3";
NC_012007.3 StringTie exon 12798 12859 . + . transcript_id "TCONS_00003418"; gene_id "XLOC_000004"; exon_number "4";
NC_012007.3 StringTie exon 12997 13119 . + . transcript_id "TCONS_00003418"; gene_id "XLOC_000004"; exon_number "5";
NC_012007.3 StringTie exon 26528 26632 . + . transcript_id "TCONS_00003418"; gene_id "XLOC_000004"; exon_number "6";
NC_012007.3 StringTie exon 26733 27534 . + . transcript_id "TCONS_00003418"; gene_id "XLOC_000004"; exon_number "7";

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.