[BioPython] How to access the actual sequence from Bio.SeqIO.FASTA

Wijaya Edward ewijaya at i2r.a-star.edu.sg
Tue Oct 3 06:34:09 UTC 2006


Dear experts,
 
I have the following script which try to 
use Bio.SeqIO's FASTA method to read
sequence and simply print the actual sequence.
 
__BEGIN__
from Bio.SeqIO import FASTA
import sys
 
handle  = open(sys.argv[1])
it = FASTA.FastaReader(handle)
seq = it.next()
while seq:
    print seq.seq
    seq = it.next()
handle.close()
__END__
 
 
But how come the output looks like this?
 
Seq('AACTAACAGTTTCCCTTGTCTAAAGCCTGCTCCCGATAAAAATAAGGCTGTGGGTTCTGG ...', Alphabet())
Seq('CACCATCAGGGCGAGATTTAGCCGCTAGGTTTGTCTCATGGAAGAAAAGCAGTAGAAAAA ...', Alphabet())
Seq('ACTTCCCACGTACGTCTGCAGGAACTTGCCTGTACCACAGGAAGACGATCGTCATGAGAA ...', Alphabet())

Is there a way to get the actual plain ATCG sequence (i.e wihtout brackets,quotes,and Alphabet()).
Sorry I'm new with Python. Please bear with me. 

Thanks and hope to hear from you again.

Regards,
Edward WIJAYA




------------ Institute For Infocomm Research - Disclaimer -------------
This email is confidential and may be privileged.  If you are not the intended recipient, please delete it and notify us immediately. Please do not copy or use it for any purpose, or disclose its contents to any other person. Thank you.
--------------------------------------------------------



More information about the Biopython mailing list