Did I find the right examples for you? yes no

All Samples(43)  |  Call(28)  |  Derive(0)  |  Import(15)

src/p/y/pycogent-HEAD/cogent/parse/cigar.py   pycogent(Download)
 
import re
from cogent.core.location import LostSpan, Span, Map, _LostSpan
from cogent import DNA, LoadSeqs
 
        else:
            spans.append(LostSpan(n))
    map = Map(spans = spans, parent_length = posn)
    return map
 
                length = span.End
                spans.append(span)
        new_map = Map(spans = spans, parent_length = length)
    return new_map
 

src/c/o/cogent-1.5.3/cogent/parse/cigar.py   cogent(Download)
 
import re
from cogent.core.location import LostSpan, Span, Map, _LostSpan
from cogent import DNA, LoadSeqs
 
        else:
            spans.append(LostSpan(n))
    map = Map(spans = spans, parent_length = posn)
    return map
 
                length = span.End
                spans.append(span)
        new_map = Map(spans = spans, parent_length = length)
    return new_map
 

src/p/y/pycogent-HEAD/cogent/db/ensembl/region.py   pycogent(Download)
from cogent import DNA
from cogent.core.annotation import Feature
from cogent.core.location import Map
from cogent.util.table import Table
from cogent.db.ensembl.util import LazyRecord, asserted_one, DisplayString, \
    def getAnnotatedSeq(self, feature_types=None, where_feature=None):
        regions = list(self.getFeatures(feature_types = feature_types, 
                                        where_feature = where_feature))
        # seq_map is on the + strand, regardless the actual strand of sequence
        seq_map = Map(locations = [(self.Location.Start, self.Location.End)], 
        exon_positions.sort()
        end = exon_positions[-1][-1]
        exon_map = Map(locations=exon_positions, parent_length=end)
        intron_map = exon_map.shadow()
 
        if cds_spans:
            # TODO: check strand
            cds_map = Map(spans = cds_spans, parent_length = parent_map.parent_length)
            features.append(('CDS', str(self.StableId), cds_map))
        return features
            utr3_spans.extend(feature_data[-1].spans)
        if utr5_spans:
            utr5_map = Map(spans = utr5_spans,
                           parent_length = parent_map.parent_length)
            features.append(("5'UTR", str(self.StableId), utr5_map))

src/c/o/cogent-1.5.3/cogent/db/ensembl/region.py   cogent(Download)
from cogent import DNA
from cogent.core.annotation import Feature
from cogent.core.location import Map
from cogent.util.table import Table
from cogent.db.ensembl.util import LazyRecord, asserted_one, DisplayString, \
    def getAnnotatedSeq(self, feature_types=None, where_feature=None):
        regions = list(self.getFeatures(feature_types = feature_types, 
                        where_feature = where_feature))
        # seq_map is on the + strand, regardless the actual strand of sequence
        seq_map = Map(locations = [(self.Location.Start, self.Location.End)], 
        exon_positions.sort()
        end = exon_positions[-1][-1]
        exon_map = Map(locations=exon_positions, parent_length=end)
        intron_map = exon_map.shadow()
 
        if cds_spans:
            # TODO: check strand
            cds_map = Map(spans = cds_spans, parent_length = parent_map.parent_length)
            features.append(('CDS', str(self.StableId), cds_map))
        return features
            utr3_spans.extend(feature_data[-1].spans)
        if utr5_spans:
            utr5_map = Map(spans = utr5_spans,
                                parent_length = parent_map.parent_length)
            features.append(("5'UTR", str(self.StableId), utr5_map))

src/p/y/pycogent-HEAD/cogent/draw/linear.py   pycogent(Download)
import copy
import warnings
from cogent.core.location import Map, Span, _norm_slice
from cogent.core.moltype import DNA
 
        if _policy is None:
            policy = policy(**kw).copy(
                map=Map([(0, len(base))], parent_length=len(base)),
                depth=0, 
                rowlen=len(base))
        else:
            policy = _policy
        self.policy = policy
        self.smap=Map([(0, len(base))], parent_length=len(base))

src/c/o/cogent-1.5.3/cogent/draw/linear.py   cogent(Download)
import copy
import warnings
from cogent.core.location import Map, Span, _norm_slice
from cogent.core.moltype import DNA
 
        if _policy is None:
            policy = policy(**kw).copy(
                map=Map([(0, len(base))], parent_length=len(base)),
                depth=0, 
                rowlen=len(base))
        else:
            policy = _policy
        self.policy = policy
        self.smap=Map([(0, len(base))], parent_length=len(base))

src/p/y/pycogent-HEAD/tests/test_core/test_annotation.py   pycogent(Download)
from cogent import DNA, LoadSeqs
from cogent.core.annotation import Feature, Variable, _Feature
from cogent.core.location import Map, Span, as_map
 
__author__ = "Gavin Huttley"
    def test_map(self):
        """reversing a map with multiple spans should preserve span relative
        order"""
        forward = [Span(20,30), Span(40,50)]
        fmap = Map(spans=forward, parent_length=100)
        fmap_reversed = fmap.nucleicReversed()
        reverse = [Span(70,80, Reverse=True), Span(50,60, Reverse=True)]
        rmap = Map(spans=reverse, parent_length=100)

src/c/o/cogent-1.5.3/tests/test_core/test_annotation.py   cogent(Download)
from cogent import DNA, LoadSeqs
from cogent.core.annotation import Feature, Variable
from cogent.core.location import Map, Span
 
__author__ = "Gavin Huttley"
    def test_map(self):
        """reversing a map with multiple spans should preserve span relative
        order"""
        forward = [Span(20,30), Span(40,50)]
        fmap = Map(spans=forward, parent_length=100)
        fmap_reversed = fmap.nucleicReversed()
        reverse = [Span(70,80, Reverse=True), Span(50,60, Reverse=True)]
        rmap = Map(spans=reverse, parent_length=100)

src/p/y/pycogent-HEAD/tests/test_core/test_location.py   pycogent(Download)
"""
from cogent.util.unit_test import TestCase, main
from cogent.core.location import Span, Range, Point, RangeFromString, Map
 
__author__ = "Rob Knight"
    def test_get_coords(self):
        """getCoordinates should return raw coordinates matching input"""
        spans = [(0,9), (20, 32)]
        map = Map(spans, parent_length=100)
        coords = map.getCoordinates()
        self.assertEqual(coords, spans)
 
        # should work for reversed Maps too
        spans = [(32, 20), (9, 0)]
        map = Map(spans, parent_length=100)

src/p/y/pycogent-HEAD/cogent/db/ensembl/sequence.py   pycogent(Download)
import sqlalchemy as sql
 
from cogent import DNA
from cogent.core.location import Map
 

  1 | 2  Next