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

All Samples(19)  |  Call(15)  |  Derive(0)  |  Import(4)

        def get_int_qualities(seq):
    seq_class = seq.kind
    if seq_class == SEQITEM:
        return _get_seqitem_qualities(seq)
    elif seq_class == SEQRECORD:
        try:
            quals = seq.object.letter_annotations['phred_quality']
        except KeyError:
            msg = 'The given SeqRecord has no phred_quality'
            raise AttributeError(msg)
        return quals
        


src/s/e/seq_crumbs-HEAD/crumbs/trim.py   seq_crumbs(Download)
                               ORPHAN_SEQS)
from crumbs.utils.seq_utils import get_uppercase_segments
from crumbs.seq import (copy_seq, get_str_seq, get_annotations, get_length,
                        slice_seq, get_int_qualities, get_name)
from crumbs.utils.segments_utils import (get_longest_segment, get_all_segments,
        trim_right = self.trim_right
        try:
            quals = list(get_int_qualities(seq))
        except KeyError:
            msg = 'Some of the input sequences do not have qualities: {}'

src/s/e/seq_crumbs-HEAD/crumbs/statistics.py   seq_crumbs(Download)
from crumbs.iterutils import rolling_window
from crumbs.utils import approx_equal
from crumbs.seq import get_str_seq, get_length, get_int_qualities
 
LABELS = {'title': 'histogram', 'xlabel': 'values',
        lengths[get_length(seq)] += 1
        try:
            quals = get_int_qualities(seq)
        except AttributeError:
            quals = []

src/s/e/seq_crumbs-HEAD/test/test_seq.py   seq_crumbs(Download)
import unittest
 
from crumbs.seq import (get_length, get_str_seq, get_int_qualities,
        get_str_qualities, slice_seq, copy_seq, SeqItem, SeqWrapper)
from crumbs.utils.tags import SEQITEM, ILLUMINA_QUALITY
        seq = SeqWrapper(SEQITEM, seq, 'fasta')
        try:
            assert get_int_qualities(seq)
            self.fail('AttributeError expected')
        except AttributeError:
                      lines=['@seq\n', 'aaaa\n', '+\n', '!???\n'])
        seq = SeqWrapper(SEQITEM, seq, 'fastq')
        assert list(get_int_qualities(seq)) == [0, 30, 30, 30]
 
        seq = SeqItem(name='seq', lines=['@seq\n', 'aaaaaaaa\n', '+\n',
                                         '@AAABBBB\n'])
        seq = SeqWrapper(SEQITEM, seq, 'fastq-illumina')
        assert list(get_int_qualities(seq)) == [0, 1, 1, 1, 2, 2, 2, 2]
        seq = SeqWrapper(SEQITEM, seq, 'fastq')
        seq = slice_seq(seq, 1, 3)
        assert list(get_int_qualities(seq)) == [30, 0]
        assert get_str_seq(seq) == 'at'
        assert seq.object.lines == ['@seq\n', 'at\n', '+\n', '?!\n']

src/s/e/seq_crumbs-HEAD/test/test_trim.py   seq_crumbs(Download)
from crumbs.utils.tags import (SEQRECORD, SEQITEM, TRIMMING_RECOMMENDATIONS,
                               VECTOR, ORPHAN_SEQS, SEQS_PASSED)
from crumbs.seq import get_str_seq, get_annotations, get_int_qualities, get_name
from crumbs.seqio import read_seq_packets
from crumbs.seq import SeqWrapper, SeqItem
        trim_packet2 = trim(trim_quality(trim_packet))
        seq2 = trim_packet2[SEQS_PASSED][0][0]
        assert get_int_qualities(seq2) == [20, 30, 30, 30, 40, 40, 30, 30, 20]
 
        # all bad
        trim_packet2 = trim(trim_quality(trim_packet))
        seq2 = trim_packet2[SEQS_PASSED][0][0]
        assert get_int_qualities(seq2) == quals
 
        seq = SeqRecord(Seq('ACTGCTGCATAA'))
        trim_packet2 = trim(trim_quality(trim_packet))
        seq2 = trim_packet2[SEQS_PASSED][0][0]
        assert get_int_qualities(seq2) == [20, 60, 60, 60, 60, 60, 20]
 
        quals = [40, 18, 10, 40, 40, 5, 8, 30, 14, 3, 40, 40, 40, 11, 6, 5, 3,
        trim_packet2 = trim(trim_quality(trim_packet))
        seq2 = trim_packet2[SEQS_PASSED][0][0]
        assert get_int_qualities(seq2) == [40, 18, 10, 40, 40]
 
        quals = [40, 40, 13, 11, 40, 9, 40, 4, 27, 38, 40, 4, 11, 40, 40, 10,