Logo Search packages:      
Sourcecode: python-biopython version File versions

def Bio::SubsMat::_build_log_odds_mat (   subs_mat,
  logbase = 2,
  factor = 10.0,
  round_digit = 0,
  keep_nd = 0 
) [private]

_build_log_odds_mat(subs_mat,logbase=10,factor=10.0,round_digit=1):
Build a log-odds matrix
logbase=2: base of logarithm used to build (default 2)
factor=10.: a factor by which each matrix entry is multiplied
round_digit: roundoff place after decimal point
keep_nd: if true, keeps the -999 value for non-determined values (for which there
are no substitutions in the frequency substitutions matrix). If false, plants the
minimum log-odds value of the matrix in entries containing -999

Definition at line 410 of file __init__.py.

00410                                                                                :
   """_build_log_odds_mat(subs_mat,logbase=10,factor=10.0,round_digit=1):
   Build a log-odds matrix
   logbase=2: base of logarithm used to build (default 2)
   factor=10.: a factor by which each matrix entry is multiplied
   round_digit: roundoff place after decimal point
   keep_nd: if true, keeps the -999 value for non-determined values (for which there
   are no substitutions in the frequency substitutions matrix). If false, plants the
   minimum log-odds value of the matrix in entries containing -999
   """
   lo_mat = SeqMat(subs_mat)
   for i in subs_mat.keys():
      if subs_mat[i] < EPSILON:
         lo_mat[i] = -999
      else:
         lo_mat[i] = round(factor*log(subs_mat[i])/log(logbase),round_digit)
   lo_mat.mat_type = LO
   mat_min = min(lo_mat.values())
   if not keep_nd:
      for i in lo_mat.keys():
         if lo_mat[i] <= -999:
            lo_mat[i] = mat_min
   return lo_mat

#
# External function. User provides an accepted replacement matrix, and,
# optionally the following: expected frequency table, log base, mult. factor,
# and rounding factor. Generates a log-odds matrix, calling internal SubsMat
# functions.
#
def make_log_odds_matrix(acc_rep_mat,exp_freq_table=None,logbase=2,


Generated by  Doxygen 1.6.0   Back to index