TAMO.MD.EM
index
/home/David_Gordon/docs/TAMO/MD/EM.py

EM.py
 
This file contains class definitions for 5 classes useful for using EM for
Motif Discovery
 
 
class EM:                 Implementation of an EM
 
class MarkovBackground:   Implementation of a n-th order Markov Background model
                          (Pre-compute models using Background.py)
 
class Probe:              A probe (string with additional baggage)
 
class MotifCandidate:     Essentially a "super" Motif, that can compute its MAP score
                          probably should have been subclassed.
 
Copyright (2005) Whitehead Institute for Biomedical Research (except as noted below)
All Rights Reserved
 
Author: David Benjamin Gordon

 
Modules
       
TAMO.seq.Fasta
TAMO.MD.MDsupport
TAMO.MotifTools
TAMO
math
os
re
sys
time

 
Classes
       
EM
MarkovBackground
Zeroth
MotifCandidate
Probe

 
class EM
     Methods defined here:
EM_C(self, Model, probes, store_Zs='')
EM_Cstart(self)
__init__(self, seed_seqs, all_seqs, width=6, verbose='')
all_Wmers(self, N, seq)
best_by_Z(self, Wmers_by_seq)
calcmask(self, width)
compute_joint(self, model, Wmers_by_seq)
report(self)
seed_models(self)

 
class MarkovBackground
     Methods defined here:
___getitem__(self, key)
__init__(self, species='YEAST', seqs='')
compute_conditional(self)
freq_from_fasta(self, fastafile)
freq_from_file(self)
freq_from_seqs(self, seqs)
freq_from_seqs_old(self, seqs)
logbackground(self, seq)
permute(self, letters, depth, seqs=[''], curdepth=0)
study_seqs(self, seqs)
zeroth(self)

 
class MotifCandidate
    A candidate for Motif consists of the following:
   A set of segments "wmers"
   A pssm computed from these segments
   A score (probably the MAP score described in the literature)
   General propeties:
     # segments
     Width
 
   A candidate must also be able to:
     Evaluate its own score
     Modify itself:
       Add wmer
       Remove wmer
 
  Methods defined here:
MAPpurge(self, verbose='')
MAPscan(self, nmers)
__init__(self, wmers='')
__repr__(self)
check_and_update(self, wmer, count, verbose='')
computeMAP(self, in_wmers='')
computeMAP_memo(self, wmer, count)
find_wmers(self, seqs)
has_wmer(self, wmer)
logPbackground(self, wmer)
purge(self, verbose='')

 
class Probe
    Probe object: Extension of string class containing
extra information, including logP and other information
 
  Methods defined here:
__cmp__(self, other)
__commented_del__(self)
__getitem__(self, n)
__getslice__(self, i, j)
__hash__(self)
__init__(self, seq='')
__len__(self)
__repr__(self)
compute_logP(self)
translate(self, table)

 
class Zeroth(MarkovBackground)
     Methods defined here:
__init__(self, bgD={'A': 0.25, 'C': 0.25, 'G': 0.25, 'T': 0.25})

Methods inherited from MarkovBackground:
___getitem__(self, key)
compute_conditional(self)
freq_from_fasta(self, fastafile)
freq_from_file(self)
freq_from_seqs(self, seqs)
freq_from_seqs_old(self, seqs)
logbackground(self, seq)
permute(self, letters, depth, seqs=[''], curdepth=0)
study_seqs(self, seqs)
zeroth(self)

 
Functions
       
loadMarkovBackground(species='YEAST', seqs=[])
log2_sum(...)
permute(depth, letters=['A', 'C', 'G', 'T'], seqs=[''], curdepth=0)

 
Data
        theMarkovBackground = None