[Biopython-dev] biopython

Iddo Friedberg idoerg at burnham.org
Tue Jun 17 13:03:42 EDT 2003


Hi Moran,

Yup, you hit upon a shortcoming of biopython -- the docs are way behind
the code. Actually, Brad Chapman has worked very hard to correct the
previous situtation, when docs were way, way, waaaaaaaaaaaaaaay behind
the code.

My suggestion: look in the manual first. In case that does not help,
"look under the hood" for the stuff you need, and post to this list.

See below for an answer to your specific question.


Shonfeld, Moran wrote:
> hello,
> 
> I was wondering if you know of a document which has a complete listing of
> all of biopython's available methods.  I am just starting out with python
> and biopython and a document such as this would be very helpful for me.
> 
> also, i need to download from GenBank in FASTA format but am not sure how to
> do that.  I was able to download in the regular genBank format but i can't
> figure out how to use this information further without writing my own parser
> for it.  if you could help me, i'd be very grateful.
> 

You'll need to use both the GenBank module (for reading a GenBank file
from NCBI), and SeqIO, to write in FASTA format.


based on the examples in:

http://biopython.org/docs/tutorial/Tutorial004.html#toc13


from Bio import genBank
from Bio.SeqIO import FASTA
record_parser = GenBank.FeatureParser()
ncbi_dict = GenBank.NCBIDictionary(parser = record_parser)
# the following line obtains a genbank record from NCBI using its ID. #
# Look to chapter 3.4 for other options.
gb_record = ncbi_dict['6273291']
# 'foo.fasta' has your fasta-formatted sequence.
FASTA.FastaWriter(open('foo.fasta','w')).write(gb_record)

Best,

Iddo



-- 
Iddo Friedberg, Ph.D.
The Burnham Institute
10901 N. Torrey Pines Rd.
La Jolla, CA 92037
USA
Tel: +1 (858) 646 3100 x3516
Fax: +1 (858) 646 3171
http://bioinformatics.ljcrf.edu/~iddo


-- 
Iddo Friedberg, Ph.D.
The Burnham Institute
10901 N. Torrey Pines Rd.
La Jolla, CA 92037
USA
Tel: +1 (858) 646 3100 x3516
Fax: +1 (858) 646 3171
http://bioinformatics.ljcrf.edu/~iddo




More information about the Biopython-dev mailing list