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

All Samples(6)  |  Call(4)  |  Derive(0)  |  Import(2)

src/c/o/cogent-1.5.3/tests/test_parse/test_fasta.py   cogent(Download)
#!/usr/bin/env python
"""Unit tests for FASTA and related parsers.
"""
from cogent.parse.fasta import FastaParser, MinimalFastaParser, \
    NcbiFastaLabelParser, NcbiFastaParser, RichLabel, LabelParser, GroupFastaParser
    def test_label_parser(self):
        """label parser factory function cope with mixed structure labels"""
        # the label parser factory function should correctly handle label lines
        # with mixed separators
        make = LabelParser("%(species)s:%(accession)s",
        expected = [{"species1": "ACTG", "species2":"ACTG"},
                    {"species1":"ACGT", "species2":"ACGT"}]
        label_to_name = LabelParser("%(species)s", [(0,"Group",str),
                            (1,"seq_id",str),(2,"species",str)], split_with=":")
        parser = GroupFastaParser(data, label_to_name, aligned=True)

src/p/y/pycogent-HEAD/tests/test_parse/test_fasta.py   pycogent(Download)
#!/usr/bin/env python
"""Unit tests for FASTA and related parsers.
"""
from cogent.parse.fasta import FastaParser, MinimalFastaParser, \
    NcbiFastaLabelParser, NcbiFastaParser, RichLabel, LabelParser, GroupFastaParser
    def test_label_parser(self):
        """label parser factory function cope with mixed structure labels"""
        # the label parser factory function should correctly handle label lines
        # with mixed separators
        make = LabelParser("%(species)s:%(accession)s",
        expected = [{"species1": "ACTG", "species2":"ACTG"},
                    {"species1":"ACGT", "species2":"ACGT"}]
        label_to_name = LabelParser("%(species)s", [(0,"Group",str),
                            (1,"seq_id",str),(2,"species",str)], split_with=":")
        parser = GroupFastaParser(data, label_to_name, aligned=True)