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

All Samples(9)  |  Call(6)  |  Derive(0)  |  Import(3)
It puts each seq into a NamedTuple named Seq

        def assing_kind_to_seqs(kind, seqs, file_format):
    'It puts each seq into a NamedTuple named Seq'
    return (SeqWrapper(kind, seq, file_format) for seq in seqs)
        


src/s/e/seq_crumbs-HEAD/crumbs/seqio.py   seq_crumbs(Download)
    SANGER_FASTQ_FORMATS, ILLUMINA_FASTQ_FORMATS)
from crumbs.settings import get_setting
from crumbs.seq import SeqItem, get_str_seq, assing_kind_to_seqs
 
# pylint: disable=C0111
        file_format = get_format(fhand)
        seq_iter = _itemize_fastx(fhand)
        seq_iter = assing_kind_to_seqs(SEQITEM, seq_iter, file_format)
        seq_iters.append(seq_iter)
    return chain.from_iterable(seq_iters)
            try:
                seqs = _read_seqrecords(fhands)
                return assing_kind_to_seqs(SEQRECORD, seqs, None)
            except NotImplementedError:
                continue

src/s/e/seq_crumbs-HEAD/test/test_seq_utils.py   seq_crumbs(Download)
                                    get_uppercase_segments)
from crumbs.utils.tags import SWAPCASE, UPPERCASE, LOWERCASE, SEQRECORD
from crumbs.seq import assing_kind_to_seqs, get_str_seq
 
 
    def test_case_change(self):
        'It changes the case of the sequences'
        seqs = [SeqRecord(Seq('aCCg'), letter_annotations={'dummy': 'dddd'})]
        seqs = assing_kind_to_seqs(SEQRECORD, seqs, None)
        change_case = ChangeCase(action=UPPERCASE)
        strs = [get_str_seq(s) for s in change_case(seqs)]
        assert strs == ['ACCG']
 
        seqs = [SeqRecord(Seq('aCCg'))]
        seqs = assing_kind_to_seqs(SEQRECORD, seqs, None)
 
        seqs = [SeqRecord(Seq('aCCg'))]
        seqs = assing_kind_to_seqs(SEQRECORD, seqs, None)
        change_case = ChangeCase(action=SWAPCASE)
        strs = [get_str_seq(s) for s in change_case(seqs)]

src/s/e/seq_crumbs-HEAD/test/test_blast.py   seq_crumbs(Download)
from crumbs.utils.test_utils import TEST_DATA_DIR
from crumbs.utils.tags import NUCL, SEQITEM, SEQRECORD
from crumbs.seq import SeqWrapper, SeqItem, assing_kind_to_seqs
 
TITANIUM_LINKER = get_setting('TITANIUM_LINKER')
        linkers = [SeqItem('titan', ['>titan\n', TITANIUM_LINKER + '\n']),
                   SeqItem('flx', ['>flx\n', FLX_LINKER + '\n'])]
        linkers = assing_kind_to_seqs(SEQITEM, linkers, 'fasta')
 
        expected_region = (len(seq_5), len(seq_5 + TITANIUM_LINKER) - 1)