public
Description: Fasta file parser
Homepage: http://github.com/davisp/nebfa
Clone URL: git://github.com/davisp/nebfa.git
nebfa /
name age message
file .gitignore Sat Aug 01 13:21:36 -0700 2009 Couple more missing files. When will someone c... [Paul J. Davis]
file LICENSE Sat Aug 01 13:21:36 -0700 2009 Couple more missing files. When will someone c... [Paul J. Davis]
file MANIFEST.in Sat Aug 01 13:21:36 -0700 2009 Couple more missing files. When will someone c... [Paul J. Davis]
file README.md Fri Jul 24 14:39:09 -0700 2009 Finishing out the nebfa package. [Paul J. Davis]
file ez_setup.py Sat Aug 01 13:21:36 -0700 2009 Couple more missing files. When will someone c... [Paul J. Davis]
file nebfa.py Tue Sep 08 07:51:40 -0700 2009 Silly bug for description parsing. [davisp]
file setup.py Sat Aug 01 13:19:31 -0700 2009 Adding a MANIFEST.in to fix the build. [Paul J. Davis]
directory test/ Fri Jul 24 14:39:09 -0700 2009 Finishing out the nebfa package. [Paul J. Davis]
README.md

nebfa - Fasta File Parser

Usage:

>>> import nebfa
>>> rec = nebfa.parse(open("./test/data/basic.fa")).next()
>>> rec.id
('gi', '0120123123')
>>> rec.desc
'Some stuff'
>>> rec.sequence
'ACGT'
>>> rec.hash
'2108994E17F6CCA9FF2352ADA92B6511DB076034'

# Alternatively, parse_file avoids the need for a call to open.
>>> for rec in nebfa.parse_file("./test/data/multi.fa"):
...     print rec.id
('gi', '0120123123')
('ref', 'YP_234234.2')

Records also have a meta attribute that has two keys for identifiers and descriptions. You will need to consult that member when you have Ctl-A separated deflines. If you have a better syntax suggestion please send a note along.