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

All Samples(68)  |  Call(46)  |  Derive(0)  |  Import(22)

src/c/o/cogent-1.5.3/cogent/parse/ebi.py   cogent(Download)
from string import maketrans, strip, rstrip
from pprint import pprint, pformat
from cogent.parse.record_finder import DelimitedRecordFinder,\
    LabeledRecordFinder, is_empty, TailedRecordFinder
from cogent.parse.record import RecordError, FieldError
    return curry(rstrip, chars=chars) 
 
EbiFinder = DelimitedRecordFinder('//', 
        constructor=rstrip)
 
    GN   Name=Jon99Ciii; Synonyms=SER2, SER5, Ser99Db; ORFNames=CG15519;"""
    lines = labeloff(lines)
    return map(gn_itemparser, gn_itemfinder(lines))
 
gn_itemparser = join_split_dict_parser 
 
gn_itemfinder = DelimitedRecordFinder('and', constructor=None, strict=False,
    character. Information is not extended beyond character position 75 except
    for one exception: CC lines that contain the 'DATABASE' topic"""
    for record in EbiFinder(lines):
        if strict and not record[0].startswith('ID'): 
            raise RecordError('Record must begin with ID line')

src/p/y/pycogent-HEAD/cogent/parse/ebi.py   pycogent(Download)
from string import maketrans, strip, rstrip
from pprint import pprint, pformat
from cogent.parse.record_finder import DelimitedRecordFinder,\
    LabeledRecordFinder, is_empty, TailedRecordFinder
from cogent.parse.record import RecordError, FieldError
    return curry(rstrip, chars=chars) 
 
EbiFinder = DelimitedRecordFinder('//', 
        constructor=rstrip)
 
    GN   Name=Jon99Ciii; Synonyms=SER2, SER5, Ser99Db; ORFNames=CG15519;"""
    lines = labeloff(lines)
    return map(gn_itemparser, gn_itemfinder(lines))
 
gn_itemparser = join_split_dict_parser 
 
gn_itemfinder = DelimitedRecordFinder('and', constructor=None, strict=False,
    character. Information is not extended beyond character position 75 except
    for one exception: CC lines that contain the 'DATABASE' topic"""
    for record in EbiFinder(lines):
        if strict and not record[0].startswith('ID'): 
            raise RecordError('Record must begin with ID line')

src/c/o/cogent-1.5.3/cogent/parse/greengenes.py   cogent(Download)
"""
 
from cogent.parse.record_finder import DelimitedRecordFinder
from cogent.parse.record import DelimitedSplitter, GenericRecord
 
    ignore = make_ignore_f(RecStart)
 
    parser = DelimitedRecordFinder(RecordDelim, constructor=line_parser, 
                                   keep_delimiter=False, ignore=ignore)
 
    for record in parser(lines):

src/p/y/pycogent-HEAD/cogent/parse/greengenes.py   pycogent(Download)
"""
 
from cogent.parse.record_finder import DelimitedRecordFinder
from cogent.parse.record import DelimitedSplitter, GenericRecord
 
    ignore = make_ignore_f(RecStart)
 
    parser = DelimitedRecordFinder(RecordDelim, constructor=line_parser, 
                                   keep_delimiter=False, ignore=ignore)
 
    for record in parser(lines):

src/c/o/cogent-1.5.3/cogent/db/ncbi.py   cogent(Download)
from time import sleep
from StringIO import StringIO
from cogent.parse.record_finder import DelimitedRecordFinder, never_ignore
from string import strip
 
            yield map(strip, between_tags.split(';'))
 
taxon_record_finder = DelimitedRecordFinder('</Taxon>', constructor=None, 
    strict=False)
 
def get_taxa_names_lineages(lines):
    """Extracts taxon, name and lineage from each entry in an XML record."""
    empty_result = (None, None, None)
    for rec in taxon_record_finder(lines):
        curr = get_taxid_name_lineage(rec)

src/p/y/pycogent-HEAD/cogent/db/ncbi.py   pycogent(Download)
from time import sleep
from StringIO import StringIO
from cogent.parse.record_finder import DelimitedRecordFinder, never_ignore
from string import strip
 
            yield map(strip, between_tags.split(';'))
 
taxon_record_finder = DelimitedRecordFinder('</Taxon>', constructor=None, 
    strict=False)
 
def get_taxa_names_lineages(lines):
    """Extracts taxon, name and lineage from each entry in an XML record."""
    empty_result = (None, None, None)
    for rec in taxon_record_finder(lines):
        curr = get_taxid_name_lineage(rec)

src/c/o/cogent-1.5.3/cogent/parse/blast.py   cogent(Download)
#!/usr/bin/env python
"""Parsers for blast, psi-blast and blat.
"""
from cogent.parse.record_finder import LabeledRecordFinder, \
    DelimitedRecordFinder, never_ignore
    #raise error if both field and f passed, uses same dict as filterByField
 
fastacmd_taxonomy_splitter = DelimitedRecordFinder(delimiter='', \
    ignore=never_ignore)
fasta_field_map = { 'NCBI sequence id':'seq_id',
    Result is dict with keys by seq_id, tax_id, common_name, scientific_name.
    """
    for group in fastacmd_taxonomy_splitter(lines):
        result = {}
        for line in group:

src/p/y/pycogent-HEAD/cogent/parse/blast.py   pycogent(Download)
#!/usr/bin/env python
"""Parsers for blast, psi-blast and blat.
"""
from cogent.parse.record_finder import LabeledRecordFinder, \
    DelimitedRecordFinder, never_ignore
    #raise error if both field and f passed, uses same dict as filterByField
 
fastacmd_taxonomy_splitter = DelimitedRecordFinder(delimiter='', \
    ignore=never_ignore)
fasta_field_map = { 'NCBI sequence id':'seq_id',
    Result is dict with keys by seq_id, tax_id, common_name, scientific_name.
    """
    for group in fastacmd_taxonomy_splitter(lines):
        result = {}
        for line in group:

src/c/o/cogent-1.5.3/cogent/parse/aaindex.py   cogent(Download)
"""
import re
from cogent.parse.record_finder import DelimitedRecordFinder
from string import rstrip
from cogent.maths.matrix.distance import DistanceMatrix
        # parse each record into AAIndexRecord objects which will be stored
        # in a dict keyed by the records unique ID string
        AAIndexRecordFinder = DelimitedRecordFinder('//', constructor=rstrip)
        # parser is a generator of AAIndexRecords from file
        parser = AAIndexRecordFinder(infile)       

src/c/o/cogent-1.5.3/cogent/parse/genbank.py   cogent(Download)
#!/usr/bin/env python
from cogent.parse.record import FieldWrapper
from cogent.parse.record_finder import DelimitedRecordFinder, \
    LabeledRecordFinder
from cogent.core.genetic_code import GeneticCodes
 
#need to turn off line stripping, because whitespace is significant
GbFinder = DelimitedRecordFinder('//', constructor=rstrip)
 
class PartialRecordError(Exception):
def MinimalGenbankParser(lines, handlers=handlers,\
    default_handler=generic_adaptor):
    for rec in GbFinder(lines):
        curr = {}
        bad_record = False

  1 | 2 | 3  Next