Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Minor change to Biopython SeqIO example #1

Closed
peterjc opened this issue Aug 28, 2015 · 1 comment
Closed

Minor change to Biopython SeqIO example #1

peterjc opened this issue Aug 28, 2015 · 1 comment

Comments

@peterjc
Copy link

peterjc commented Aug 28, 2015

In Scientific_python/Skimage_biopython.ipynb rather than:

from Bio import SeqIO
for item in SeqIO.FastaIO.FastaIterator(open('data/sweet_taste_receptor.txt', 'r')):
    print(item)

our documentation would use:

from Bio import SeqIO
for item in SeqIO.parse('data/sweet_taste_receptor.txt', 'fasta'):
    print(item)

(I'd actually use double quotes - your examples are inconsistent on this point)

Key points: Emphasises file-format neutral API (makes switching file format later much easier, closer to the usage you followed for AlignIO) and also will take care of closing the file handle internally.

@MichielStock
Copy link
Owner

Hi Peter,

Thanks for your suggestion. Just using the parse function in SeqIO is more general and thus more didactic.

I also made the quotation consistent throughout the examples.

Cheers,

Michiel

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants