How Do I Create A Seqrecord In Biopython?
2
1
Entering edit mode
14.5 years ago

assume these are fastq-illumina quality scores and the sequence is unambiguous dna

I want to create a SeqRecord object from this. Thanks.

biopython fastq • 8.7k views
ADD COMMENT
4
Entering edit mode
14.5 years ago
Peter 6.0k

This answer is a bit of a cheat, but currently Biopython doesn't expose the FASTQ quality string decoding functionality in the public API:

from Bio import SeqIO
from StringIO import StringIO
fastq_string = "@%s\n%s\n+\n%s\n" % (id1, seq1, qual1)
record = SeqIO.read(StringIO(fastq_string), "fastq-illumina")

Why are you trying to do this?

ADD COMMENT
0
Entering edit mode

i am merging overlapping paired end sequences

ADD REPLY
1
Entering edit mode
14.5 years ago
Yu ▴ 110
>>> id1  ="HWI-EAS380:8:1:16:830/1"
>>> seq1 ="AGGGCGTTCAGCAGCCAGCTTGCGGCAAAACTGCGTAACCGTCTTCTCGTT"
>>> from Bio.SeqRecord import SeqRecord
>>> from Bio.Seq import Seq
>>> sr = SeqRecord(Seq(seq1), id1, '', '')
>>> sr
SeqRecord(seq=Seq('AGGGCGTTCAGCAGCCAGCTTGCGGCAAAACTGCGTAACCGTCTTCTCGTT', Alphabet()), id='HWI-EAS380:8:1:16:830/1', name='', description='', dbxrefs=[])
ADD COMMENT
0
Entering edit mode

i need the quality in the record the whole per-letter-annotation thing is what is giving me trouble

ADD REPLY

Login before adding your answer.

Traffic: 1016 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6