Package corebio :: Module seq :: Class Seq
[frames | no frames]

Type Seq

object --+        
         |        
basestring --+    
             |    
           str --+
                 |
                Seq


An alphabetic string. A subclass of "str" consisting solely of
letters from the same alphabet.

Attributes:
    alphabet    -- A string or Alphabet of allowed characters.
    name        -- A short string used to identify the sequence.
    description -- A string describing the sequence   
    
Authors :
    GEC 2005

Method Summary
  __add__(self, other)
  __eq__(self, other)
  __getitem__(self, key)
  __getslice__(self, i, j)
  __ne__(self, other)
  __new__(cls, obj, alphabet, name, description)
(Static method)
  __radd__(self, other)
  back_translate(self)
Translate a protein sequence back into coding DNA, using using the standard genetic code.
  complement(self)
Returns complementary nucleic acid sequence.
  join(self, str_list)
  kmers(self, alphabet, k)
Counts the occurrences of overlapping alphabetic subsequences.
  lower(self)
Return a lower case copy of the sequence.
  mask(self, letters, mask)
Replace all occurences of letters with the mask character.
  ords(self)
Convert sequence to an array of integers ...
  remove(self, delchars)
Return a new alphabetic sequence with all characters in 'delchars' removed.
  reverse(self)
Return the reversed sequence.
  reverse_complement(self)
Returns reversed complementary nucleic acid sequence (i.e.
  tally(self, alphabet)
Counts the occurrences of alphabetic characters.
  tostring(self)
Converts Seq to a raw string.
  translate(self)
Translate a nucleotide sequence to a polypeptide using full IUPAC ambiguities in DNA/RNA and amino acid codes, using the standard genetic code.
  ungap(self)
  upper(self)
Return a lower case copy of the sequence.
    Inherited from str
  __contains__(x, y)
x.__contains__(y) <==> y in x...
  __ge__(x, y)
x.__ge__(y) <==> x>=y...
  __getattribute__(...)
x.__getattribute__('name') <==> x.name...
  __getnewargs__(...)
  __gt__(x, y)
x.__gt__(y) <==> x>y...
  __hash__(x)
x.__hash__() <==> hash(x)...
  __le__(x, y)
x.__le__(y) <==> x<=y...
  __len__(x)
x.__len__() <==> len(x)...
  __lt__(x, y)
x.__lt__(y) <==> x<y...
  __mod__(x, y)
x.__mod__(y) <==> x%y...
  __mul__(x, n)
x.__mul__(n) <==> x*n...
  __repr__(x)
x.__repr__() <==> repr(x)...
  __rmod__(x, y)
x.__rmod__(y) <==> y%x...
  __rmul__(x, n)
x.__rmul__(n) <==> n*x...
  __str__(x)
x.__str__() <==> str(x)...
  capitalize(S)
Return a copy of the string S with only its first character capitalized.
  center(S, width, fillchar)
Return S centered in a string of length width.
  count(S, sub, start, end)
Return the number of occurrences of substring sub in string S[start:end].
  decode(S, encoding, errors)
Decodes S using the codec registered for encoding.
  encode(S, encoding, errors)
Encodes S using the codec registered for encoding.
  endswith(S, suffix, start, end)
Return True if S ends with the specified suffix, False otherwise.
  expandtabs(S, tabsize)
Return a copy of S where all tab characters are expanded using spaces.
  find(S, sub, start, end)
Return the lowest index in S where substring sub is found, such that sub is contained within s[start,end].
  index(S, sub, start, end)
Like S.find() but raise ValueError when the substring is not found.
  isalnum(S)
Return True if all characters in S are alphanumeric and there is at least one character in S, False otherwise.
  isalpha(S)
Return True if all characters in S are alphabetic and there is at least one character in S, False otherwise.
  isdigit(S)
Return True if all characters in S are digits and there is at least one character in S, False otherwise.
  islower(S)
Return True if all cased characters in S are lowercase and there is at least one cased character in S, False otherwise.
  isspace(S)
Return True if all characters in S are whitespace and there is at least one character in S, False otherwise.
  istitle(S)
Return True if S is a titlecased string and there is at least one character in S, i.e.
  isupper(S)
Return True if all cased characters in S are uppercase and there is at least one cased character in S, False otherwise.
  ljust(S, width, fillchar)
Return S left justified in a string of length width.
  lstrip(S, chars)
Return a copy of the string S with leading whitespace removed.
  replace(...)
S.replace (old, new[, count]) -> string Return a copy of string S with all occurrences of substring old replaced by new.
  rfind(S, sub, start, end)
Return the highest index in S where substring sub is found, such that sub is contained within s[start,end].
  rindex(S, sub, start, end)
Like S.rfind() but raise ValueError when the substring is not found.
  rjust(S, width, fillchar)
Return S right justified in a string of length width.
  rsplit(S, sep, maxsplit)
Return a list of the words in the string S, using sep as the delimiter string, starting at the end of the string and working to the front.
  rstrip(S, chars)
Return a copy of the string S with trailing whitespace removed.
  split(S, sep, maxsplit)
Return a list of the words in the string S, using sep as the delimiter string.
  splitlines(S, keepends)
Return a list of the lines in S, breaking at line boundaries.
  startswith(S, prefix, start, end)
Return True if S starts with the specified prefix, False otherwise.
  strip(S, chars)
Return a copy of the string S with leading and trailing whitespace removed.
  swapcase(S)
Return a copy of the string S with uppercase characters converted to lowercase and vice versa.
  title(S)
Return a titlecased version of S, i.e.
  zfill(S, width)
Pad a numeric string S with zeros on the left, to fill a field of the specified width.
    Inherited from object
  __init__(...)
x.__init__(...) initializes x; see x.__class__.__doc__ for signature...
  __delattr__(...)
x.__delattr__('name') <==> del x.name...
  __reduce__(...)
helper for pickle...
  __reduce_ex__(...)
helper for pickle...
  __setattr__(...)
x.__setattr__('name', value) <==> x.name = value...

Property Summary
  alphabet

Instance Method Details

back_translate(self)

Translate a protein sequence back into coding DNA, using using the
standard genetic code. See corebio.transform.GeneticCode for
details and more options.

complement(self)

Returns complementary nucleic acid sequence.

kmers(self, alphabet=None, k=1)

Counts the occurrences of overlapping alphabetic subsequences.   

Arguments:
- alphabet -- an optional alternative alphabet
- k        -- subsequence length. Default: 1 (monomers)

Returns :
    A list of kmers counts in alphabetic order.
Status :
    Alpha -- Not sure on interface. Will only work for small k

lower(self)

Return a lower case copy of the sequence.
Overrides:
__builtin__.str.lower

mask(self, letters='abcdefghijklmnopqrstuvwxyz', mask='X')

Replace all occurences of letters with the mask character.
The default is to replace all lower case letters with 'X'.

ords(self)

Convert sequence to an array of integers 
in the range [0, len(alphabet) )

remove(self, delchars)

Return a new alphabetic sequence with all characters in 'delchars'
removed.

reverse(self)

Return the reversed sequence. 

Not that this method returns a new object, in contrast to
the in-place reverse() method of list objects.

reverse_complement(self)

Returns reversed complementary nucleic acid sequence (i.e. the other
strand of a DNA sequence.)

tally(self, alphabet=None)

Counts the occurrences of alphabetic characters.
        
Arguments:
- alphabet -- an optional alternative alphabet

Returns :
    A list of character counts in alphabetic order.

tostring(self)

Converts Seq to a raw string.

translate(self)

Translate a nucleotide sequence to a polypeptide using full
IUPAC ambiguities in DNA/RNA and amino acid codes, using the
standard genetic code. See corebio.transform.GeneticCode for
details and more options.
Overrides:
__builtin__.str.translate

upper(self)

Return a lower case copy of the sequence.
Overrides:
__builtin__.str.upper

Generated by Epydoc 2.1 on http://epydoc.sf.net