def makeMotifProbsDefn(self): """Makes the first part of a parameter controller definition for this model, the calculation of motif probabilities""" return substitution_calculation.PartitionDefn( name="mprobs", default=None, dimensions=('locus', 'edge'), dimension=('motif', tuple(self.getInputAlphabet())))
def makeMotifWordProbDefns(self): monomer_probs = substitution_calculation.PartitionDefn( name="psmprobs", default=None, dimensions=('locus', 'position', 'edge'), dimension=('motif', tuple(self.getInputAlphabet()))) monomer_probs3 = monomer_probs.acrossDimension( 'position', [str(i) for i in range(self.word_length)]) monomer_probs3 = substitution_calculation.CalcDefn( lambda *x: numpy.array(x), name='mprobs')(*monomer_probs3) word_probs = substitution_calculation.CalcDefn( self.calcWordProbs, name="wprobs")(monomer_probs3) mprobs_matrix = substitution_calculation.CalcDefn( self.calcWordWeightMatrix, name="mprobs_matrix")(monomer_probs3) return (monomer_probs, word_probs, mprobs_matrix)