Package obitools :: Package word
[hide private]
[frames] | no frames]

Package word

source code

Submodules [hide private]

Functions [hide private]
 
wordCount(liste) source code
 
wordIterator(sequence, lword, step=1, endIncluded=False, circular=False) source code
iterator
allWordIterator(size, _prefix='')
Iterate thought the list of all DNA word of size `size`.
source code
iterator
wordSelector(words, accept=None, reject=None)
Filter over a DNA word iterator.
source code
int
wordDist(w1, w2)
estimate Hamming distance between two words of the same size.
source code
Variables [hide private]
  _dna = 'acgt'
  __package__ = 'obitools.word'

Imports: imap


Function Details [hide private]

allWordIterator(size, _prefix='')

source code 

Iterate thought the list of all DNA word of size `size`.

Parameters:
  • size (int) - size of the DNA word
  • _prefix (string) - internal parameter used for recursion purpose
Returns: iterator
an iterator on DNA word (str)

wordSelector(words, accept=None, reject=None)

source code 

Filter over a DNA word iterator.

Parameters:
  • words (an iterator) - an iterable object other a list of DNA words
  • accept (list) - a list of predicat. Eeach predicat is a function accepting one str parametter and returning a boolean value.
  • reject (list) - a list of predicat. Eeach predicat is a function accepting one str parametter and returning a boolean value.
Returns: iterator
an iterator on DNA word (str)

wordDist(w1, w2)

source code 

estimate Hamming distance between two words of the same size.

Parameters:
  • w1 (str) - the first word
  • w2 (str) - the second word
Returns: int
the count of difference between the two words