Created
May 22, 2018 23:25
-
-
Save glwinsor/93d8d437eedefe7673b75f460bdc0ac1 to your computer and use it in GitHub Desktop.
[read fasta] Reads in a fasta file using biopython and prints the sequence id and sequence string #biopython
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from Bio import SeqIO | |
# read in the fasta file and create seq object. File name is stored in fasta variable and the following "fasta" in quotes means the type of format being input | |
for seq_record in SeqIO.parse(fasta,"fasta"): | |
# Prints the sequence ID | |
print(seq_record.id) | |
# Prints string representation of the sequence | |
print(str(seq_record.seq)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment