Trees | Indices | Help |
---|
|
Interfaces.SequenceWriter --+ | Interfaces.SequentialSequenceWriter --+ | FastqSolexaWriter
Write old style Solexa/Illumina FASTQ format files (with Solexa qualities).
This outputs FASTQ files like those from the early Solexa/Illumina pipeline, using Solexa scores and an ASCII offset of 64. These are NOT compatible with the standard Sanger style PHRED FASTQ files.
If your records contain a "solexa_quality" entry under letter_annotations, this is used, otherwise any "phred_quality" entry will be used after conversion using the solexa_quality_from_phred function. If neither style of quality scores are present, an exception is raised.
Although you can use this class directly, you are strongly encouraged to use the Bio.SeqIO.write() function instead. For example, this code reads in a FASTQ file and re-saves it as another FASTQ file:
>>> from Bio import SeqIO >>> record_iterator = SeqIO.parse(open("Quality/solexa_example.fastq"), "fastq-solexa") >>> out_handle = open("Quality/temp.fastq", "w") >>> SeqIO.write(record_iterator, out_handle, "fastq-solexa") 5 >>> out_handle.close()
You might want to do this if the original file included extra line breaks, which (while valid) may not be supported by all tools. The output file from Biopython will have each sequence on a single line, and each quality string on a single line (which is considered desirable for maximum compatibility).
This code is also called if you use the .format("fastq-solexa") method of a SeqRecord. For example,
>>> record = SeqIO.read(open("Quality/sanger_faked.fastq"), "fastq-sanger") >>> print record.format("fastq-solexa") @Test PHRED qualities from 40 to 0 inclusive ACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTN + hgfedcba`_^]\[ZYXWVUTSRQPONMLKJHGFECB@>;; <BLANKLINE>
Note that Solexa FASTQ files have an upper limit of Solexa quality 62, which is encoded as ASCII 126, the tilde. If your quality scores must be truncated to fit, a warning is issued.
P.S. Don't forget to delete the temp file if you don't need it anymore:
>>> import os >>> os.remove("Quality/temp.fastq")
|
|||
|
|||
Inherited from Inherited from Inherited from |
|
Write a single FASTQ record to the file. |
Trees | Indices | Help |
---|
Generated by Epydoc 3.0.1 on Wed Jul 14 01:37:23 2010 | http://epydoc.sourceforge.net |