Package Bio :: Package SeqIO :: Module _convert
[hide private]
[frames] | no frames]

Module _convert

source code

Optimised sequence conversion code (PRIVATE).

You are not expected to access this module, or any of its code, directly. This is all handled internally by the Bio.SeqIO.convert(...) function which is the public interface for this.

The idea here is that while doing this will work:

from Bio import SeqIO
records = SeqIO.parse(in_handle, in_format)
count = SeqIO.write(records, out_handle, out_format)

it is shorter to write:

from Bio import SeqIO
count = SeqIO.convert(in_handle, in_format, out_handle, out_format)

Also, the convert function can take a number of special case optimisations. This means that using Bio.SeqIO.convert() may be faster, as well as more convenient. All these file format specific optimisations are handled by this (private) module.

Functions [hide private]
 
_genbank_convert_fasta(in_handle, out_handle, alphabet=None)
Fast GenBank to FASTA (PRIVATE).
source code
 
_embl_convert_fasta(in_handle, out_handle, alphabet=None)
Fast EMBL to FASTA (PRIVATE).
source code
 
_fastq_generic(in_handle, out_handle, mapping)
FASTQ helper function where can't have data loss by truncation (PRIVATE).
source code
 
_fastq_generic2(in_handle, out_handle, mapping, truncate_char, truncate_msg)
FASTQ helper function where there could be data loss by truncation (PRIVATE).
source code
 
_fastq_sanger_convert_fastq_sanger(in_handle, out_handle, alphabet=None)
Fast Sanger FASTQ to Sanger FASTQ conversion (PRIVATE).
source code
 
_fastq_solexa_convert_fastq_solexa(in_handle, out_handle, alphabet=None)
Fast Solexa FASTQ to Solexa FASTQ conversion (PRIVATE).
source code
 
_fastq_illumina_convert_fastq_illumina(in_handle, out_handle, alphabet=None)
Fast Illumina 1.3+ FASTQ to Illumina 1.3+ FASTQ conversion (PRIVATE).
source code
 
_fastq_illumina_convert_fastq_sanger(in_handle, out_handle, alphabet=None)
Fast Illumina 1.3+ FASTQ to Sanger FASTQ conversion (PRIVATE).
source code
 
_fastq_sanger_convert_fastq_illumina(in_handle, out_handle, alphabet=None)
Fast Sanger FASTQ to Illumina 1.3+ FASTQ conversion (PRIVATE).
source code
 
_fastq_solexa_convert_fastq_sanger(in_handle, out_handle, alphabet=None)
Fast Solexa FASTQ to Sanger FASTQ conversion (PRIVATE).
source code
 
_fastq_sanger_convert_fastq_solexa(in_handle, out_handle, alphabet=None)
Fast Sanger FASTQ to Solexa FASTQ conversion (PRIVATE).
source code
 
_fastq_solexa_convert_fastq_illumina(in_handle, out_handle, alphabet=None)
Fast Solexa FASTQ to Illumina 1.3+ FASTQ conversion (PRIVATE).
source code
 
_fastq_illumina_convert_fastq_solexa(in_handle, out_handle, alphabet=None)
Fast Illumina 1.3+ FASTQ to Solexa FASTQ conversion (PRIVATE).
source code
 
_fastq_convert_fasta(in_handle, out_handle, alphabet=None)
Fast FASTQ to FASTA conversion (PRIVATE).
source code
 
_fastq_convert_tab(in_handle, out_handle, alphabet=None)
Fast FASTQ to simple tabbed conversion (PRIVATE).
source code
 
_fastq_convert_qual(in_handle, out_handle, mapping)
FASTQ helper function for QUAL output (PRIVATE).
source code
 
_fastq_sanger_convert_qual(in_handle, out_handle, alphabet=None)
Fast Sanger FASTQ to QUAL conversion (PRIVATE).
source code
 
_fastq_solexa_convert_qual(in_handle, out_handle, alphabet=None)
Fast Solexa FASTQ to QUAL conversion (PRIVATE).
source code
 
_fastq_illumina_convert_qual(in_handle, out_handle, alphabet=None)
Fast Illumina 1.3+ FASTQ to QUAL conversion (PRIVATE).
source code
 
_handle_convert(in_handle, in_format, out_handle, out_format, alphabet=None)
SeqIO conversion function (PRIVATE).
source code
Variables [hide private]
  _converter = {('embl', 'fasta'): <function _embl_convert_fasta...
  __package__ = 'Bio.SeqIO'
Function Details [hide private]

_fastq_sanger_convert_fastq_sanger(in_handle, out_handle, alphabet=None)

source code 

Fast Sanger FASTQ to Sanger FASTQ conversion (PRIVATE).

Useful for removing line wrapping and the redundant second identifier on the plus lines. Will check also check the quality string is valid.

Avoids creating SeqRecord and Seq objects in order to speed up this conversion.

_fastq_solexa_convert_fastq_solexa(in_handle, out_handle, alphabet=None)

source code 

Fast Solexa FASTQ to Solexa FASTQ conversion (PRIVATE).

Useful for removing line wrapping and the redundant second identifier on the plus lines. Will check also check the quality string is valid. Avoids creating SeqRecord and Seq objects in order to speed up this conversion.

_fastq_illumina_convert_fastq_illumina(in_handle, out_handle, alphabet=None)

source code 

Fast Illumina 1.3+ FASTQ to Illumina 1.3+ FASTQ conversion (PRIVATE).

Useful for removing line wrapping and the redundant second identifier on the plus lines. Will check also check the quality string is valid. Avoids creating SeqRecord and Seq objects in order to speed up this conversion.

_fastq_illumina_convert_fastq_sanger(in_handle, out_handle, alphabet=None)

source code 

Fast Illumina 1.3+ FASTQ to Sanger FASTQ conversion (PRIVATE).

Avoids creating SeqRecord and Seq objects in order to speed up this conversion.

_fastq_sanger_convert_fastq_illumina(in_handle, out_handle, alphabet=None)

source code 

Fast Sanger FASTQ to Illumina 1.3+ FASTQ conversion (PRIVATE).

Avoids creating SeqRecord and Seq objects in order to speed up this conversion. Will issue a warning if the scores had to be truncated at 62 (maximum possible in the Illumina 1.3+ FASTQ format)

_fastq_solexa_convert_fastq_sanger(in_handle, out_handle, alphabet=None)

source code 

Fast Solexa FASTQ to Sanger FASTQ conversion (PRIVATE).

Avoids creating SeqRecord and Seq objects in order to speed up this conversion.

_fastq_sanger_convert_fastq_solexa(in_handle, out_handle, alphabet=None)

source code 

Fast Sanger FASTQ to Solexa FASTQ conversion (PRIVATE).

Avoids creating SeqRecord and Seq objects in order to speed up this conversion. Will issue a warning if the scores had to be truncated at 62 (maximum possible in the Solexa FASTQ format)

_fastq_solexa_convert_fastq_illumina(in_handle, out_handle, alphabet=None)

source code 

Fast Solexa FASTQ to Illumina 1.3+ FASTQ conversion (PRIVATE).

Avoids creating SeqRecord and Seq objects in order to speed up this conversion.

_fastq_illumina_convert_fastq_solexa(in_handle, out_handle, alphabet=None)

source code 

Fast Illumina 1.3+ FASTQ to Solexa FASTQ conversion (PRIVATE).

Avoids creating SeqRecord and Seq objects in order to speed up this conversion.

_fastq_convert_fasta(in_handle, out_handle, alphabet=None)

source code 

Fast FASTQ to FASTA conversion (PRIVATE).

Avoids dealing with the FASTQ quality encoding, and creating SeqRecord and Seq objects in order to speed up this conversion.

NOTE - This does NOT check the characters used in the FASTQ quality string are valid!

_fastq_convert_tab(in_handle, out_handle, alphabet=None)

source code 

Fast FASTQ to simple tabbed conversion (PRIVATE).

Avoids dealing with the FASTQ quality encoding, and creating SeqRecord and Seq objects in order to speed up this conversion.

NOTE - This does NOT check the characters used in the FASTQ quality string are valid!

_fastq_convert_qual(in_handle, out_handle, mapping)

source code 

FASTQ helper function for QUAL output (PRIVATE).

Mapping should be a dictionary mapping expected ASCII characters from the FASTQ quality string to PHRED quality scores (as strings).


Variables Details [hide private]

_converter

Value:
{("genbank", "fasta"): _genbank_convert_fasta, ("gb", "fasta"): _genba\
nk_convert_fasta, ("embl", "fasta"): _embl_convert_fasta, ("fastq", "f\
asta"): _fastq_convert_fasta, ("fastq-sanger", "fasta"): _fastq_conver\
t_fasta, ("fastq-solexa", "fasta"): _fastq_convert_fasta, ("fastq-illu\
mina", "fasta"): _fastq_convert_fasta, ("fastq", "tab"): _fastq_conver\
t_tab, ("fastq-sanger", "tab"): _fastq_convert_tab, ("fastq-solexa", "\
tab"): _fastq_convert_tab, ("fastq-illumina", "tab"): _fastq_convert_t\
ab, ("fastq", "fastq"): _fastq_sanger_convert_fastq_sanger, ("fastq-sa\
...