Package Bio :: Package GFF :: Class FeatureAggregate
[hide private]
[frames] | no frames]

Class FeatureAggregate

source code

object --+    
         |    
      list --+
             |
object --+   |
         |   |
   Feature --+
             |
            FeatureAggregate

>>> feature1_1 = Feature(location=easy.LocationFromString("NC_001802x.fna:336..1631"), frame=0) # gag-pol
>>> feature1_2 = Feature(location=easy.LocationFromString("NC_001802x.fna:1631..4642"), frame=0) # slippage
>>> aggregate = FeatureAggregate([feature1_1, feature1_2])
>>> print aggregate.location()
join(NC_001802x.fna:336..1631,NC_001802x.fna:1631..4642)
>>> xlate_str = aggregate.translate().tostring()
>>> xlate_str[:5], xlate_str[-5:]
('MGARA', 'RQDED')
>>> location1 = easy.LocationFromString("NC_001802x.fna:complement(1..6)")
>>> location2 = easy.LocationFromString("NC_001802x.fna:complement(7..12)")
>>> feature2_1 = Feature(location=location1, frame=0)
>>> feature2_2 = Feature(location=location2, frame=0)
>>> aggregate2 = FeatureAggregate([feature2_1, feature2_2])
>>> print aggregate2.location()
complement(join(NC_001802x.fna:1..6,NC_001802x.fna:7..12))
>>> print aggregate2.translate()
Seq('TRET', HasStopCodon(IUPACProtein(), '*'))
>>> location1.reverse()
>>> location2.reverse()
>>> aggregate3 = FeatureAggregate([Feature(location=x, frame=0) for x in [location1, location2]])
>>> print aggregate3.location()
join(NC_001802x.fna:1..6,NC_001802x.fna:7..12)
>>> print aggregate3.translate()
Seq('GLSG', HasStopCodon(IUPACProtein(), '*'))
>>> aggregate3[0].frame = 3
>>> print aggregate3.translate()
Seq('LSG', HasStopCodon(IUPACProtein(), '*'))
>>> aggregate4 = FeatureAggregate()
>>> aggregate4.append(Feature(location=easy.LocationFromString("NC_001802x.fna:1..5"), frame=0))
>>> aggregate4.append(Feature(location=easy.LocationFromString("NC_001802x.fna:6..12"), frame=2))
>>> aggregate4.seq()
Seq('GGTCTCTCTGGT', Alphabet())
>>> aggregate4.translate()
Seq('GLSG', HasStopCodon(IUPACProtein(), '*'))
Instance Methods [hide private]
new empty list
__init__(self, feature_query=None)
x.__init__(...) initializes x; see help(type(x)) for signature
source code
 
location(self) source code
 
map(self, func) source code
 
seq(self) source code
 
translate(self) source code

Inherited from list: __add__, __contains__, __delitem__, __delslice__, __eq__, __ge__, __getattribute__, __getitem__, __getslice__, __gt__, __iadd__, __imul__, __iter__, __le__, __len__, __lt__, __mul__, __ne__, __new__, __repr__, __reversed__, __rmul__, __setitem__, __setslice__, __sizeof__, append, count, extend, index, insert, pop, remove, reverse, sort

Inherited from Feature: __str__, id, record, target_location, xrange

Inherited from object: __delattr__, __format__, __reduce__, __reduce_ex__, __setattr__, __subclasshook__

Class Variables [hide private]

Inherited from list: __hash__

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, feature_query=None)
(Constructor)

source code 

x.__init__(...) initializes x; see help(type(x)) for signature

Returns: new empty list
Overrides: object.__init__
(inherited documentation)

location(self)

source code 
Overrides: Feature.location

seq(self)

source code 
Overrides: Feature.seq

translate(self)

source code 
Overrides: Feature.translate