[BioPython] GenBank and index_file

Sylvain Schüpp syl_schupp at yahoo.fr
Fri Jul 9 05:29:48 EDT 2004


Hi,

I try to use the GenBank package to manage GenBank files from NCBI. For that, I'm following the cookbook I found on BioPython. There, the authors proposed me to create an iterator to naviguate through my file.

I tried with a genbank from a plasmide : that works perfectly.

I tried with a complete genome : that bugs perfectly, cause Pythin seems not to be able to manage big file. The funniest point is that the error I obtain happen after the end of my file.

 

If somebody have an idea, I'm still there.

Thanks

gb_file = "h:\\viewer_fcgi.gb"
gb_handle = open(gb_file,'r')
feature_parser = GenBank.FeatureParser()
gb_iterator = GenBank.Iterator(gb_handle, feature_parser)
while 1 :
    cur_record = gb_iterator.next()
    if cur_record is None:
        break
    print cur_record.features[1]

Traceback (most recent call last):
  File "H:\SylSch\genbank\configGenbank.py", line 9, in -toplevel-
    cur_record = gb_iterator.next()
  File "C:\sschupp\Python23\Lib\site-packages\Bio\GenBank\__init__.py", line 129, in next
    return self._parser.parse(File.StringHandle(data))
  File "C:\sschupp\Python23\Lib\site-packages\Bio\GenBank\__init__.py", line 219, in parse
    self._scanner.feed(handle, self._consumer)
  File "C:\sschupp\Python23\Lib\site-packages\Bio\GenBank\__init__.py", line 1259, in feed
    self._parser.parseFile(handle)
  File "C:\sschupp\Python23\lib\site-packages\Martel\Parser.py", line 328, in parseFile
    self.parseString(fileobj.read())
  File "C:\sschupp\Python23\lib\site-packages\Martel\Parser.py", line 356, in parseString
    self._err_handler.fatalError(result)
  File "C:\sschupp\Python23\lib\xml\sax\handler.py", line 38, in fatalError
    raise exception
ParserPositionException: error parsing at or beyond character 988544


Pour suivre mes aventures suédoises :
www.marschupp.fr.st
		
---------------------------------
Créez gratuitement votre Yahoo! Mail avec 100 Mo de stockage !
Créez votre Yahoo! Mail

Dialoguez en direct avec vos amis grâce à Yahoo! Messenger !


More information about the BioPython mailing list