Exemplo n.º 1
0
 def test_state_loading(self):
     a = State()
     a.load(self.inputY)
     X = a.toJSON()
     Y = self.Y
     self.assertDictEqual(X, Y, "Loading and dumping to JSON does not " + \
                          " work: " + str(X) + " != " + str(Y))
Exemplo n.º 2
0
 def toJSON(self):
     ret = State.toJSON(self)
     ret['backgroundprob'] = self.backgroundProbability
     ret['time'] = self.time
     ret['transitionmatrix'] = self.transitionMatrix
     if self.consensusDistribution != None:
         ret['consensusdistribution'] = \
             dist_to_json(self.consensusDistribution)
     if self.repeatLengthDistribution != None:
         ret['repeatlengthdistribution'] = \
             dist_to_json(self.repeatLengthDistribution)
     ret['trackemissions'] = self.trackEmissions
     if self.version != None:
         ret['version'] = self.version
     if self.repProb != None:
         ret['repprob'] = float(self.repProb) 
     #TODO: save consensus distribution
     return ret
Exemplo n.º 3
0
 def toJSON(self):
     ret = State.toJSON(self)
     ret["durations"] = self.durations
     return ret        
Exemplo n.º 4
0
 def toJSON(self):
     ret = State.toJSON(self)
     ret['order'] = self.order
     return ret
Exemplo n.º 5
0
 def toJSON(self):
     ret = State.toJSON(self)
     ret["durations"] = self.durations
     return ret
Exemplo n.º 6
0
 def toJSON(self):
     ret = State.toJSON(self)
     ret['order'] = self.order
     return ret