Beispiel #1
0
 def add_state(self, state):
     BaseClock.add_state(self, state)
     # Rate categories
     xml.stateNode(state,
                   text="1",
                   id="rateCategories.c:%s" % self.name,
                   spec="parameter.IntegerParameter",
                   dimension=42)
Beispiel #2
0
 def add_frequency_state(self, state):
     for f in self.features:
         fname = "%s:%s" % (self.name, f)
         xml.stateNode(
             state,
             text=1.0 / self.valuecounts[f],
             id="feature_freqs_param.s:%s" % fname,
             spec="parameter.RealParameter",
             dimension=self.valuecounts[f],
             lower="0.0",
             upper="1.0",
         )
Beispiel #3
0
 def add_state(self, state):
     xml.parameter(state,
                   text="100.0",
                   id="sphericalPrecision",
                   lower="0.0",
                   name="stateNode")
     xml.stateNode(state,
                   id="location.geo",
                   spec="sphericalGeo.LocationParameter",
                   minordimension="2",
                   estimate="true",
                   value="0.0 0.0",
                   lower="0.0")
Beispiel #4
0
 def add_frequency_state(self, state):
     attribs = {
         "id": "freqs_param.s:%s" % self.name,
         "spec": "parameter.RealParameter",
         "dimension": "2",
         "lower": "0.0",
         "upper": "1.0",
     }
     if self.share_params:
         xml.stateNode(state, text="0.5 0.5", attrib=attribs)
     else:
         for f in self.features:
             fname = "%s:%s" % (self.name, f)
             attribs["id"] = "freqs_param.s:%s" % fname
             xml.stateNode(state, text="0.5 0.5", attrib=attribs)
Beispiel #5
0
 def add_state(self, state):
     BaseClock.add_state(self, state)
     xml.stateNode(state,
                   text=False,
                   id="Indicators.c:%s" % self.name,
                   spec="parameter.BooleanParameter",
                   dimension=42)
     xml.stateNode(state,
                   text="0.1",
                   id="clockrates.c:%s" % self.name,
                   spec="parameter.RealParameter",
                   dimension=42)
     self.shape_id = "randomClockGammaShape:%s" % self.name
     # Domain and initial values for Gamma params copied from rate heterogeneity
     # implementation in BaseModel
     xml.parameter(state,
                   text="5.0",
                   id=self.shape_id,
                   name="stateNode",
                   lower="1.1",
                   upper="1000.0")
     self.scale_id = "randomClockGammaScale:%s" % self.name
     xml.parameter(state, text="0.2", id=self.scale_id, name="stateNode")
Beispiel #6
0
    def add_state(self, state):

        BaseModel.add_state(self, state)
        for f in self.features:
            fname = "%s:%s" % (self.name, f)

            N = self.valuecounts[f]
            dimension = N*(N-1)
            if self.symmetric:
                dimension = int(dimension/2)

            xml.stateNode(
                state,
                text="true",
                id="rateIndicator.s:%s" % fname,
                spec="parameter.BooleanParameter",
                dimension=dimension)

            xml.parameter(
                state,
                text="1.0",
                id="relativeGeoRates.s:%s" % fname,
                name="stateNode",
                dimension=dimension)