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

All Samples(3)  |  Call(0)  |  Derive(0)  |  Import(3)
str(object='') -> string

Return a nice string representation of the object.
If the argument is a string, the return value is the same object.

src/s/e/seq_crumbs-HEAD/crumbs/seqio.py   seq_crumbs(Download)
from crumbs.utils.file_formats import get_format, peek_chunk_from_file
from crumbs.utils.tags import (GUESS_FORMAT, SEQS_PASSED, SEQS_FILTERED_OUT,
                               SEQITEM, SEQRECORD, ORPHAN_SEQS,
            # as not diverted seqs.
            # if they are orphan, they are a list of seqs
            if seqs_diverted == SEQS_FILTERED_OUT:
                seqs = flatten_pairs(packet[seqs_diverted])
    _write_filter_trim_packets(passed_fhand, filtered_fhand, filter_packets,
                               file_format=file_format, workers=workers,

src/s/e/seq_crumbs-HEAD/crumbs/filters.py   seq_crumbs(Download)
from crumbs.utils.tags import (SEQS_PASSED, SEQS_FILTERED_OUT, SEQITEM,
                               SEQRECORD, CHIMERA, NON_CHIMERIC, UNKNOWN)
from crumbs.utils.seq_utils import uppercase_length, get_uppercase_segments
            packet = list(group_pairs(packet, n_seqs_in_pair=1))
        yield {SEQS_PASSED: packet, SEQS_FILTERED_OUT: []}
        failed_drags_pair = self.failed_drags_pair
        seqs_passed = []
        filtered_out = filterpacket[SEQS_FILTERED_OUT][:]
        for paired_seqs in filterpacket[SEQS_PASSED]:
            checks = (self._do_check(seq) for seq in paired_seqs)
        return {SEQS_PASSED: seqs_passed, SEQS_FILTERED_OUT: filtered_out}

src/s/e/seq_crumbs-HEAD/test/test_filters.py   seq_crumbs(Download)
from crumbs.utils.bin_utils import BIN_DIR
from crumbs.utils.test_utils import TEST_DATA_DIR
from crumbs.utils.tags import (NUCL, SEQS_FILTERED_OUT, SEQS_PASSED, SEQITEM,
from crumbs.utils.file_utils import TemporaryDir
        expected = [[('ACT',)], [('CTG',), ('TTT',)]]
        assert [p[SEQS_PASSED] for p in filter_packets] == expected
        assert [p[SEQS_FILTERED_OUT] for p in filter_packets] == [[], []]
    def test_length_filter(self):
        'It filters the seqs according to its length'
        seq1 = _create_seqrecord('aCTg')
        seq2 = _create_seqrecord('AC')
        seqs = {SEQS_PASSED: [[seq1], [seq2]], SEQS_FILTERED_OUT: []}
        filter_by_length = FilterByLength(minimum=4)
        passed = _seqs_to_str_seqs(filter_by_length(seqs)[SEQS_PASSED])
        assert passed == ['aCTg']
        filtr = _seqs_to_str_seqs(filter_by_length(seqs)[SEQS_FILTERED_OUT])
        passed = _seqs_to_str_seqs(filter_by_length(seqs)[SEQS_PASSED])
        assert passed == []
        filtr = _seqs_to_str_seqs(filter_by_length(seqs)[SEQS_FILTERED_OUT])
        assert filtr == ['aCTg', 'AC']