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

All Samples(21)  |  Call(20)  |  Derive(0)  |  Import(1)

src/s/e/seq_crumbs-HEAD/test/test_trim.py   seq_crumbs(Download)
from Bio.SeqRecord import SeqRecord
 
from crumbs.trim import (TrimLowercasedLetters, TrimEdges, TrimOrMask,
                         TrimByQuality, TrimWithBlastShort,
    seq_to_trim_packets)
    def test_quality_trimming(self):
        'It trims the edges'
        trim = TrimOrMask()
 
        trim_quality = TrimByQuality(window=5, threshold=30)
        seq = SeqWrapper(SEQRECORD, seq, None)
        trim_packet = {SEQS_PASSED: [[seq]], ORPHAN_SEQS: []}
        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_quality = TrimByQuality(window=5, threshold=60)
        trim_packet = {SEQS_PASSED: [[seq]], ORPHAN_SEQS: []}
        trim_packet2 = trim(trim_quality(trim_packet))