TAMO.Clustering.MotifCompare
index
/home/David_Gordon/docs/TAMO/Clustering/MotifCompare.py

This module contains low-level code for finding the optimal alignment between two motifs.
The central algorithm is called "minshortestoverhangdiff," which searches all alignments
of two motifs to find the one that minimizes the specificied distance/divergence metric.
The space of alignments is restricted by the minimum amount of overlap that is required
between motifs, which is in turn computed on the fly using the "OVLP" function.
 
Distance/divergence metrics include:
    -== To be completed ==-
 
Copyright (2005) Whitehead Institute for Biomedical Research (except as noted below)
All Rights Reserved
 
Author: David Benjamin Gordon

 
Modules
       
TAMO.util.Arith
TAMO.MotifTools
math
os
random
re
sys

 
Functions
       
ENMrange(self, other, Srange, Orange)
Utility function:  compute Expected Number of Mismatches
NCBpenalty(penalty=0)
NLBPO(A, B, thresh)
NLPO(A, B, thresh)
OVLP lambda A, B, w=2
averagemotifs(motifs, ovlp=2, template=None, DFUNC=<function negcommonbitsrange>, VERBOSE=1, prop='')
averagetxts(txts, ovlp=2, VERBOSE=1)
centroididx(Dmat)
coalesce(motifs, DMIN=0.22)
coarsecluster(motifs)
computeDmat(motifs, VERBOSE=0, DFUNC=None)
diffrange(self, other, Srange, Orange)
Utility function: compute diff of
entropyrange(self, other, Srange, Orange)
Utility function: compute diff of
estimate_frequency(motif, k, samples=100000, thresh=0.69999999999999996)
etestdiff(t1, t2, OVLP_FCN)
genNCBpenalty(penalty=0)
main()
minshortestoverhangdiff(A, B, minoverlap=6, want_offset=None, DFUNC=None)
negcommonbitsrange(self, other, Srange, Orange, PENALTY=0)
Utility function: compute common bits in self and other
 
Common bits are computed using this expression:
SUM [ max(PENALTY,min(bitsA,bitsB)) ]            (Penalty usually == 0)
 
where bitsA = Pb_ij * log(Pa_ij / Q_j)   [i = position, j = base letter]
negcommonbitstest(t1, t2, OVLP_FCN=None)
negprobproductrange(self, other, Srange, Orange)
Utility function: compute sum of products of probabilities
 
SUM [
probOvlp(A, B, thresh=0.69999999999999996, verbose=None)
probOvlpBinomial(A, B, thresh=0.69999999999999996, verbose=None)
showdiffXvert(motif, seq, OVLP_FCN=None, DIFF_FCN=None)
The funtion converts the sequence to a Motif, computes the D
of the best alignment, and prints the alignment that generated
that D.
snegcommonbitsrange(self, other, Srange, Orange)
snegbits -- between 0 and 1?
snegprobproductrange(self, other, Srange, Orange)
sneg -- between 0 and 1?
testdiff(t1, t2, OVLP_FCN=None, DIFF_FCN=None)

 
Data
        ACGT = ['A', 'C', 'G', 'T']
DFUNC = None
rcmemo = {}