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

All Samples(60)  |  Call(32)  |  Derive(20)  |  Import(8)

src/c/o/cogent-1.5.3/tests/test_parse/test_record.py   cogent(Download)
#!/usr/bin/env python
"""Unit tests for parser support libraries dealing with records.
"""
from cogent.parse.record import FieldError, RecordError, Grouper, \
    DelimitedSplitter, GenericRecord, MappedRecord, \
    def setUp(self):
        """Define a few standard MappedRecords"""
        self.empty = MappedRecord()
        self.single = MappedRecord({'a':3})
        self.several = MappedRecord(a=4,b=5,c='a',d=[1,2,3])
 
    def test_init_empty(self):
        """MappedRecord empty init should work OK"""
        g = MappedRecord()

src/p/y/pycogent-HEAD/tests/test_parse/test_record.py   pycogent(Download)
#!/usr/bin/env python
"""Unit tests for parser support libraries dealing with records.
"""
from cogent.parse.record import FieldError, RecordError, Grouper, \
    DelimitedSplitter, GenericRecord, MappedRecord, \
    def setUp(self):
        """Define a few standard MappedRecords"""
        self.empty = MappedRecord()
        self.single = MappedRecord({'a':3})
        self.several = MappedRecord(a=4,b=5,c='a',d=[1,2,3])
 
    def test_init_empty(self):
        """MappedRecord empty init should work OK"""
        g = MappedRecord()

src/c/o/cogent-1.5.3/cogent/parse/locuslink.py   cogent(Download)
are probably a map and its corresponding link).
"""
from cogent.parse.record import MappedRecord, FieldWrapper, DelimitedSplitter,\
    list_adder, list_extender, int_setter, LineOrientedConstructor
from cogent.parse.record_finder import LabeledRecordFinder
def _read_accession(line):
    """Reads accession lines: format is Accession | Gi | Strain."""
    return MappedRecord(accession_wrapper(line))
 
rell_wrapper = FieldWrapper(['Description', 'Id', 'IdType', 'Printable'], pipes)
def _read_rell(line):
    """Reads RELL lines: format is Description|Id|IdType|Printable"""
    return MappedRecord(rell_wrapper(line))
def _read_accnum(line):
    """Reads ACCNUM lines: format is Accession|Gi|Strain|Start|End."""
    return MappedRecord(accnum_wrapper(line))
 
map_wrapper = FieldWrapper(['Location','Source','Type'], pipes)
def _read_map(line):
    """Reads MAP lines: format is Location|Source|Type."""
    return MappedRecord(map_wrapper(line))

src/p/y/pycogent-HEAD/cogent/parse/locuslink.py   pycogent(Download)
are probably a map and its corresponding link).
"""
from cogent.parse.record import MappedRecord, FieldWrapper, DelimitedSplitter,\
    list_adder, list_extender, int_setter, LineOrientedConstructor
from cogent.parse.record_finder import LabeledRecordFinder
def _read_accession(line):
    """Reads accession lines: format is Accession | Gi | Strain."""
    return MappedRecord(accession_wrapper(line))
 
rell_wrapper = FieldWrapper(['Description', 'Id', 'IdType', 'Printable'], pipes)
def _read_rell(line):
    """Reads RELL lines: format is Description|Id|IdType|Printable"""
    return MappedRecord(rell_wrapper(line))
def _read_accnum(line):
    """Reads ACCNUM lines: format is Accession|Gi|Strain|Start|End."""
    return MappedRecord(accnum_wrapper(line))
 
map_wrapper = FieldWrapper(['Location','Source','Type'], pipes)
def _read_map(line):
    """Reads MAP lines: format is Location|Source|Type."""
    return MappedRecord(map_wrapper(line))

src/c/o/cogent-1.5.3/cogent/parse/unigene.py   cogent(Download)
#!/usr/bin/env python
"""Parsers for the various files in the UniGene database.
"""
from cogent.parse.record import MappedRecord, ByPairs, semi_splitter, \
    equal_pairs, LineOrientedConstructor, list_adder, int_setter
    """
    filtered = line.replace('=', ' ')
    return MappedRecord(list(ByPairs(filtered.split())))
 
def _read_expression(line):
    """Turns a semicolon-delimited  expression line into list of expressions"""
    return semi_splitter(line)
 
class UniGeneSeqRecord(MappedRecord):
class UniGeneProtSimRecord(MappedRecord):
    Aliases = {'ORG':'Species', 'PROTGI':'ProteinGi', 'ProtId':'ProteinId',\
        'PCT':'PercentSimilarity', 'ALN':'AlignmentScore'}
 
def _read_seq(line):
class UniGene(MappedRecord):
    """Holds data for a UniGene record."""
    Required = {    'STS':[], 'PROTSIM':[], 'SEQUENCE':[], 'EXPRESS': []}
    Aliases = {'STS':'Sts', 'PROTSIM':'ProteinSimilarities',\
    'SEQUENCE':'SequenceIds','SCOUNT':'SequenceCount','CTYOBAND':'CytoBand',\

src/p/y/pycogent-HEAD/cogent/parse/unigene.py   pycogent(Download)
#!/usr/bin/env python
"""Parsers for the various files in the UniGene database.
"""
from cogent.parse.record import MappedRecord, ByPairs, semi_splitter, \
    equal_pairs, LineOrientedConstructor, list_adder, int_setter
    """
    filtered = line.replace('=', ' ')
    return MappedRecord(list(ByPairs(filtered.split())))
 
def _read_expression(line):
    """Turns a semicolon-delimited  expression line into list of expressions"""
    return semi_splitter(line)
 
class UniGeneSeqRecord(MappedRecord):
class UniGeneProtSimRecord(MappedRecord):
    Aliases = {'ORG':'Species', 'PROTGI':'ProteinGi', 'ProtId':'ProteinId',\
        'PCT':'PercentSimilarity', 'ALN':'AlignmentScore'}
 
def _read_seq(line):
class UniGene(MappedRecord):
    """Holds data for a UniGene record."""
    Required = {    'STS':[], 'PROTSIM':[], 'SEQUENCE':[], 'EXPRESS': []}
    Aliases = {'STS':'Sts', 'PROTSIM':'ProteinSimilarities',\
    'SEQUENCE':'SequenceIds','SCOUNT':'SequenceCount','CTYOBAND':'CytoBand',\

src/c/o/cogent-1.5.3/cogent/core/info.py   cogent(Download)
Info is a dictionary and is the annotation object of a Sequence object. 
"""
from cogent.parse.record import MappedRecord
from cogent.util.misc import Delegator, FunctionWrapper, ConstrainedDict
 
class DbRefs(MappedRecord, ConstrainedDict):
    """Holds Database -> [Accessions] mapping.
 
    The accessions for a particular database are always stored as a list.
 
class Info(MappedRecord, Delegator):
    """Dictionary that stores attributes for Sequence objects.
 
    Delegates to DbRefs for database IDs.
    """

src/p/y/pycogent-HEAD/cogent/core/info.py   pycogent(Download)
Info is a dictionary and is the annotation object of a Sequence object. 
"""
from cogent.parse.record import MappedRecord
from cogent.util.misc import Delegator, FunctionWrapper, ConstrainedDict
 
class DbRefs(MappedRecord, ConstrainedDict):
    """Holds Database -> [Accessions] mapping.
 
    The accessions for a particular database are always stored as a list.
 
class Info(MappedRecord, Delegator):
    """Dictionary that stores attributes for Sequence objects.
 
    Delegates to DbRefs for database IDs.
    """