Package Bio :: Package SeqIO :: Module QualityIO :: Class FastqSolexaWriter
[hide private]
[frames] | no frames]

Class FastqSolexaWriter

source code

      Interfaces.SequenceWriter --+    
                                  |    
Interfaces.SequentialSequenceWriter --+
                                      |
                                     FastqSolexaWriter

Class to write FASTQ format files (using Solexa quality scores).

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.fastq"), "fastq-solexa")
>>> out_handle = open("Quality/temp.fastq", "w")
>>> SeqIO.write(record_iterator, out_handle, "fastq-solexa")
1
>>> 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.

P.S. Don't forget to delete the temp file if you don't need it anymore:

>>> import os
>>> os.remove("Quality/temp.fastq")
Instance Methods [hide private]
 
write_record(self, record)
Write a single FASTQ record to the file.
source code

Inherited from Interfaces.SequentialSequenceWriter: __init__, write_file, write_footer, write_header, write_records

Inherited from Interfaces.SequenceWriter: clean

Inherited from Interfaces.SequenceWriter (private): _get_seq_string

Method Details [hide private]

write_record(self, record)

source code 

Write a single FASTQ record to the file.

Overrides: Interfaces.SequentialSequenceWriter.write_record