Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(2)  |  Call(1)  |  Derive(0)  |  Import(1)
It converts a fasta and a qual file into a fastq format file

        def fastaqual_to_fasta(seq_fhand, qual_fhand, out_fhand):
    'It converts a fasta and a qual file into a fastq format file'
    seqrecords = PairedFastaQualIterator(seq_fhand, qual_fhand)
        write_seqrecs(seqrecords, out_fhand.name, 'fastq')
    except ValueError, error:
        if error_quality_disagree(error):
            raise MalformedFile(str(error))

src/s/e/seq_crumbs-HEAD/test/test_seqio.py   seq_crumbs(Download)
from crumbs.utils.test_utils import TEST_DATA_DIR
from crumbs.utils.bin_utils import BIN_DIR
from crumbs.seqio import (guess_seq_type, fastaqual_to_fasta, seqio,
                          _write_seqrecords, _read_seqrecords,
                          _itemize_fastx, read_seqs, write_seqs)
    def test_fastaqual_to_fasta():
        seq_fhand = StringIO('>seq1\nattct\n>seq2\natc\n')
        qual_fhand = StringIO('>seq1\n2 2 2 2 2\n>seq2\n2 2 2\n')
        out_fhand = NamedTemporaryFile()
        fastaqual_to_fasta(seq_fhand, qual_fhand, out_fhand)