cmonkey.seqtools
index
/home/weiju/Projects/ISB/cmonkey-python/cmonkey/seqtools.py

seqtools.py - utilities to operate on genomic sequences
 
This file is part of cMonkey Python. Please see README and LICENSE for
more information and licensing details.

 
Modules
       
collections
itertools
logging
random
re
string

 
Classes
       
__builtin__.tuple(__builtin__.object)
Feature

 
class Feature(__builtin__.tuple)
    Feature(id, ftype, name, location)
 
 
Method resolution order:
Feature
__builtin__.tuple
__builtin__.object

Methods defined here:
__getnewargs__(self)
Return self as a plain tuple.  Used by copy and pickle.
__getstate__(self)
Exclude the OrderedDict from pickling
__repr__(self)
Return a nicely formatted representation string
_asdict(self)
Return a new OrderedDict which maps field names to their values
_replace(_self, **kwds)
Return a new Feature object replacing specified fields with new values

Class methods defined here:
_make(cls, iterable, new=<built-in method __new__ of type object>, len=<built-in function len>) from __builtin__.type
Make a new Feature object from a sequence or iterable

Static methods defined here:
__new__(_cls, id, ftype, name, location)
Create new instance of Feature(id, ftype, name, location)

Data descriptors defined here:
__dict__
Return a new OrderedDict which maps field names to their values
ftype
Alias for field number 1
id
Alias for field number 0
location
Alias for field number 3
name
Alias for field number 2

Data and other attributes defined here:
_fields = ('id', 'ftype', 'name', 'location')

Methods inherited from __builtin__.tuple:
__add__(...)
x.__add__(y) <==> x+y
__contains__(...)
x.__contains__(y) <==> y in x
__eq__(...)
x.__eq__(y) <==> x==y
__ge__(...)
x.__ge__(y) <==> x>=y
__getattribute__(...)
x.__getattribute__('name') <==> x.name
__getitem__(...)
x.__getitem__(y) <==> x[y]
__getslice__(...)
x.__getslice__(i, j) <==> x[i:j]
 
Use of negative indices is not supported.
__gt__(...)
x.__gt__(y) <==> x>y
__hash__(...)
x.__hash__() <==> hash(x)
__iter__(...)
x.__iter__() <==> iter(x)
__le__(...)
x.__le__(y) <==> x<=y
__len__(...)
x.__len__() <==> len(x)
__lt__(...)
x.__lt__(y) <==> x<y
__mul__(...)
x.__mul__(n) <==> x*n
__ne__(...)
x.__ne__(y) <==> x!=y
__rmul__(...)
x.__rmul__(n) <==> n*x
__sizeof__(...)
T.__sizeof__() -- size of T in memory, in bytes
count(...)
T.count(value) -> integer -- return number of occurrences of value
index(...)
T.index(value, [start, [stop]]) -> integer -- return first index of value.
Raises ValueError if the value is not present.

 
Functions
       
extract_upstream(source, location, distance)
Extract a subsequence of the specified  size from the source sequence
Depending on the strand orientation, the sequence is cut around either
the start or the end position
markov_background(seqs, order)
computes the markov background model of the specified
order for the given input sequences. This is implemented
by gathering the frequencies of subsequences of length
1,..,(order + 1)
read_features_from_file(filename)
Returns a list containing the features
read_sequences_from_fasta_file(filepath)
Read the sequences from the specified FASTA file
read_sequences_from_fasta_string(fasta_string)
reads the sequences contained in a FASTA string
subsequence(sequence, start, stop, reverse=False)
extracts a subsequence from a longer genomic sequence by coordinates.
If reverse is True, the result string's reverse complement is
calculated. Not that the start/stop positions are shifted to comply with
the original cMonkey's behavior
write_sequences_to_fasta_file(outputfile, seqs)
Write a list of sequence tuples to the specified outputfile

 
Data
        __all__ = ['subsequence', 'extract_upstream', 'markov_background', 'read_sequences_from_fasta_string', 'read_sequences_from_fasta_file', 'write_sequences_to_fasta_file', 'Feature', 'read_features_from_file']