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

Class Feature

source code

object --+
         |
        Feature

strand may be: +/0 = Watson -/1 = Crick

I propose that we start calling these the Rosalind and Franklin strands

>>> RetrieveSeqname._dir = 'GFF'
>>> feature = Feature("NC_001802x.fna", 73, 78) # not having the x will interfere with the RetrieveSequence test
>>> feature.seq()
Seq('AATAAA', Alphabet())
>>> print feature.location()
NC_001802x.fna:73..78
>>> from Bio import SeqIO
>>> record = feature.record()
>>> records = [record]
>>> SeqIO.write(records, sys.stdout, 'fasta')
> NC_001802x.fna:73..78
AATAAA
>>> feature2 = Feature(location=easy.LocationFromString("NC_001802x.fna:73..78"))
>>> writer.write(feature2.record())
> NC_001802x.fna:73..78
AATAAA
>>> location3 = easy.LocationFromString("NC_001802x.fna:complement(73..78)")
>>> feature3 = Feature(location=location3)
>>> writer.write(feature3.record())
> NC_001802x.fna:complement(73..78)
TTTATT
>>> location4 = easy.LocationFromString("NC_001802x.fna:336..1631")
>>> feature4 = Feature(location=location4, frame=0)
>>> feature4.frame
0
>>> feature4.translate()[:7]
Seq('MGARASV', HasStopCodon(IUPACProtein(), '*'))
>>> feature4.frame = 6 # can't happen, but a useful demonstration
>>> feature4.translate()[:5]
Seq('ARASV', HasStopCodon(IUPACProtein(), '*'))
>>> feature4.frame = 1
>>> feature4.translate()[:5]
Seq('WVRER', HasStopCodon(IUPACProtein(), '*'))
>>> location5 = easy.LocationFromString("NC_001802lc.fna:336..1631") # lowercase data
>>> feature5 = Feature(location=location5, frame=0)
>>> feature5.translate()[:7]
Seq('MGARASV', HasStopCodon(IUPACProtein(), '*'))
>>> location6 = easy.LocationFromString("NC_001802lc.fna:335..351")
>>> feature6 = Feature(location=location6, frame=1)
>>> feature6.translate()
Seq('MGARA', HasStopCodon(IUPACProtein(), '*'))
Instance Methods [hide private]
 
__init__(self, seqname=None, start=None, end=None, strand="+", frame=None, location=None, alphabet=DEFAULT_ALPHABET)
x.__init__(...) initializes x; see help(type(x)) for signature
source code
 
__hash__(self)
hash(x)
source code
 
seq(self) source code
 
translate(self) source code
 
location(self) source code
 
target_location(self) source code
 
id(self) source code
 
record(self) source code
 
xrange(self) source code
 
__str__(self)
str(x)
source code

Inherited from object: __delattr__, __format__, __getattribute__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __subclasshook__

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, seqname=None, start=None, end=None, strand="+", frame=None, location=None, alphabet=DEFAULT_ALPHABET)
(Constructor)

source code 

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

Overrides: object.__init__
(inherited documentation)

__hash__(self)
(Hashing function)

source code 

hash(x)

Overrides: object.__hash__
(inherited documentation)

__str__(self)
(Informal representation operator)

source code 

str(x)

Overrides: object.__str__
(inherited documentation)