public class Simulate
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
class |
Simulate.SimulationException
Exception for when there is a problem with the simulation
|
Constructor and Description |
---|
Simulate(java.util.Map<java.lang.String,Model> m,
java.util.Map<java.lang.String,Tree> t,
Parameters p)
Creates an object to simulate data for a given set of models and trees,
parameters and unobserved states.
|
Simulate(java.util.Map<java.lang.String,Model> m,
java.util.Map<java.lang.String,Tree> t,
Parameters p,
Alignment unobserved)
Creates an object to simulate data for a given set of models and trees,
parameters and unobserved states.
|
Simulate(java.util.Map<java.lang.String,Model> m,
Tree t,
Parameters p)
Creates an object to simulate data for a given set of models, a tree and parameters.
|
Simulate(java.util.Map<java.lang.String,Model> m,
Tree t,
Parameters p,
Alignment unobserved)
Creates an object to simulate data for a given set of models, a tree, parameters
and unobserved states.
|
Simulate(Model m,
java.util.Map<java.lang.String,Tree> t,
Parameters p)
Creates an object to simulate data for a given model, set of trees, parameters
and unobserved states.
|
Simulate(Model m,
java.util.Map<java.lang.String,Tree> t,
Parameters p,
Alignment unobserved)
Creates an object to simulate data for a given model, set of trees, parameters
and unobserved states.
|
Simulate(Model m,
Tree t,
Parameters p)
Creates an object to simulate data for a given model, tree and parameters.
|
Simulate(Model m,
Tree t,
Parameters p,
Alignment unobserved)
Creates an object to simulate data for a given model, tree, parameters
and unobserved states.
|
Modifier and Type | Method and Description |
---|---|
Alignment |
getAlignment(int length)
Gets a simulated alignment, not returning the state of internal nodes
|
Alignment |
getAlignment(int length,
boolean internal)
Gets a simulated alignment
|
Alignment |
getAlignment(int length,
boolean internal,
java.util.Map<java.lang.String,java.lang.String> recode)
Gets a simulated alignment.
|
Alignment |
getAlignment(int length,
java.util.Map<java.lang.String,java.lang.String> recode)
Gets a simulated alignment, not returning the state of internal nodes.
|
Alignment |
getAlignment(java.util.List<java.lang.String> siteClasses)
Gets a simulated alignment, not returning the state of the internal nodes.
|
Alignment |
getAlignment(java.util.List<java.lang.String> siteClasses,
boolean internal)
Gets a simulated alignment.
|
Alignment |
getAlignment(java.util.List<java.lang.String> siteClasses,
boolean internal,
java.util.Map<java.lang.String,java.lang.String> recode)
Gets a simulated alignment.
|
Alignment |
getAlignment(java.util.List<java.lang.String> siteClasses,
java.util.Map<java.lang.String,java.lang.String> recode)
Gets a simulated alignment, not returning the state of the internal nodes.
|
Site |
getSite()
Gets a simulated site without returning the state of the internal nodes
|
Site |
getSite(boolean internal)
Gets a simulated site
|
Site |
getSite(boolean internal,
java.util.Map<java.lang.String,java.lang.String> recode)
Gets a simulated site.
|
Site |
getSite(boolean internal,
java.util.Map<java.lang.String,java.lang.String> recode,
java.lang.String siteClass)
Gets a simulated site.
|
Site |
getSite(boolean internal,
java.lang.String siteClass)
Gets a simulated site
|
Site |
getSite(java.util.Map<java.lang.String,java.lang.String> recode)
Gets a simulated site without returning the state of the internal nodes.
|
Site |
getSite(java.util.Map<java.lang.String,java.lang.String> recode,
java.lang.String siteClass)
Gets a simulated site without returning the state of the internal nodes.
|
Site |
getSite(java.lang.String siteClass)
Gets a simulated site without returning the state of the internal nodes
|
void |
setSeed(long seed)
Seeds the random number generator with the give seed.
|
public Simulate(Model m, Tree t, Parameters p) throws RateCategory.RateException, Model.ModelException, TreeException, Parameters.ParameterException
m
- The modelt
- The treep
- The parametersRateCategory.RateException
- Thrown if there is an issue with
a rate category in the model (e.g. a badly formatted rate).Model.ModelException
- Thrown if there is a problem with the
model (e.g. the rate categories differ in their states)TreeException
- Thrown if there is a problem with the tree.Parameters.ParameterException
- Thrown if there is a problem
with the parameters (e.g. a required parameter is not present)public Simulate(Model m, Tree t, Parameters p, Alignment unobserved) throws RateCategory.RateException, Model.ModelException, TreeException, Parameters.ParameterException
m
- The modelt
- The treep
- The parametersunobserved
- The unobserved statesRateCategory.RateException
- Thrown if there is an issue with
a rate category in the model (e.g. a badly formatted rate).Model.ModelException
- Thrown if there is a problem with the
model (e.g. the rate categories differ in their states)TreeException
- Thrown if there is a problem with the tree.Parameters.ParameterException
- Thrown if there is a problem
with the parameters (e.g. a required parameter is not present)public Simulate(java.util.Map<java.lang.String,Model> m, Tree t, Parameters p) throws RateCategory.RateException, Model.ModelException, TreeException, Parameters.ParameterException
m
- Map from site class to modelt
- The treep
- The parametersRateCategory.RateException
- Thrown if there is an issue with
a rate category in the model (e.g. a badly formatted rate).Model.ModelException
- Thrown if there is a problem with the
model (e.g. the rate categories differ in their states)TreeException
- Thrown if there is a problem with the tree.Parameters.ParameterException
- Thrown if there is a problem
with the parameters (e.g. a required parameter is not present)public Simulate(java.util.Map<java.lang.String,Model> m, Tree t, Parameters p, Alignment unobserved) throws RateCategory.RateException, Model.ModelException, TreeException, Parameters.ParameterException
m
- Map from site class to modelt
- The treep
- The parametersunobserved
- The unobserved statesRateCategory.RateException
- Thrown if there is an issue with
a rate category in the model (e.g. a badly formatted rate).Model.ModelException
- Thrown if there is a problem with the
model (e.g. the rate categories differ in their states)TreeException
- Thrown if there is a problem with the tree.Parameters.ParameterException
- Thrown if there is a problem
with the parameters (e.g. a required parameter is not present)public Simulate(Model m, java.util.Map<java.lang.String,Tree> t, Parameters p) throws RateCategory.RateException, Model.ModelException, TreeException, Parameters.ParameterException
m
- The modelt
- Map from site class to treep
- The parametersRateCategory.RateException
- Thrown if there is an issue with
a rate category in the model (e.g. a badly formatted rate).Model.ModelException
- Thrown if there is a problem with the
model (e.g. the rate categories differ in their states)TreeException
- Thrown if there is a problem with the tree.Parameters.ParameterException
- Thrown if there is a problem
with the parameters (e.g. a required parameter is not present)public Simulate(Model m, java.util.Map<java.lang.String,Tree> t, Parameters p, Alignment unobserved) throws RateCategory.RateException, Model.ModelException, TreeException, Parameters.ParameterException
m
- The modelt
- Map from site class to treep
- The parametersunobserved
- The unobserved statesRateCategory.RateException
- Thrown if there is an issue with
a rate category in the model (e.g. a badly formatted rate).Model.ModelException
- Thrown if there is a problem with the
model (e.g. the rate categories differ in their states)TreeException
- Thrown if there is a problem with the tree.Parameters.ParameterException
- Thrown if there is a problem
with the parameters (e.g. a required parameter is not present)public Simulate(java.util.Map<java.lang.String,Model> m, java.util.Map<java.lang.String,Tree> t, Parameters p) throws RateCategory.RateException, Model.ModelException, TreeException, Parameters.ParameterException
m
- Map from site class to modelt
- Map from site class to treep
- The parametersRateCategory.RateException
- Thrown if there is an issue with
a rate category in the model (e.g. a badly formatted rate).Model.ModelException
- Thrown if there is a problem with the
model (e.g. the rate categories differ in their states)TreeException
- Thrown if there is a problem with the tree.Parameters.ParameterException
- Thrown if there is a problem
with the parameters (e.g. a required parameter is not present)public Simulate(java.util.Map<java.lang.String,Model> m, java.util.Map<java.lang.String,Tree> t, Parameters p, Alignment unobserved) throws RateCategory.RateException, Model.ModelException, TreeException, Parameters.ParameterException
m
- Map from site class to modelt
- Map from site class to treep
- The parametersunobserved
- The unobserved statesRateCategory.RateException
- Thrown if there is an issue with
a rate category in the model (e.g. a badly formatted rate).Model.ModelException
- Thrown if there is a problem with the
model (e.g. the rate categories differ in their states)TreeException
- Thrown if there is a problem with the tree.Parameters.ParameterException
- Thrown if there is a problem
with the parameters (e.g. a required parameter is not present)public Site getSite() throws Simulate.SimulationException, RateCategory.RateException
Simulate.SimulationException
- Thrown if there is a problem
with the simulation (currently only if attempting to simulate for a site class
we don't have a model)RateCategory.RateException
- if a rate category uses the FitzJohn
method at the root as this method requires likelihoods to calculate the frequency
and we don't have the likelihoods when simulating.public Site getSite(java.lang.String siteClass) throws Simulate.SimulationException, RateCategory.RateException
siteClass
- The site class to simulate forSimulate.SimulationException
- Thrown if there is a problem
with the simulation (currently only if attempting to simulate for a site class
we don't have a model for)RateCategory.RateException
- if a rate category uses the FitzJohn
method at the root as this method requires likelihoods to calculate the frequency
and we don't have the likelihoods when simulating.public Site getSite(java.util.Map<java.lang.String,java.lang.String> recode) throws Simulate.SimulationException, RateCategory.RateException
recode
- Map of recodingsSimulate.SimulationException
- Thrown if there is a problem
with the simulation (currently only if attempting to simulate for a site class
we don't have a model for)RateCategory.RateException
- if a rate category uses the FitzJohn
method at the root as this method requires likelihoods to calculate the frequency
and we don't have the likelihoods when simulating.public Site getSite(java.util.Map<java.lang.String,java.lang.String> recode, java.lang.String siteClass) throws Simulate.SimulationException, RateCategory.RateException
recode
- Map of recodingssiteClass
- The site class to simulate forSimulate.SimulationException
- Thrown if there is a problem
with the simulation (currently only if attempting to simulate for a site class
we don't have a model for)RateCategory.RateException
- if a rate category uses the FitzJohn
method at the root as this method requires likelihoods to calculate the frequency
and we don't have the likelihoods when simulating.public Site getSite(boolean internal) throws Simulate.SimulationException, RateCategory.RateException
internal
- Whether to return the state of the internal nodesSimulate.SimulationException
- Thrown if there is a problem
with the simulation (currently only if attempting to simulate for a site class
we don't have a model for)RateCategory.RateException
- if a rate category uses the FitzJohn
method at the root as this method requires likelihoods to calculate the frequency
and we don't have the likelihoods when simulating.public Site getSite(boolean internal, java.lang.String siteClass) throws Simulate.SimulationException, RateCategory.RateException
internal
- Whether to return the state of the internal nodessiteClass
- The site class to simulate forSimulate.SimulationException
- Thrown if there is a problem
with the simulation (currently only if attempting to simulate for a site class
we don't have a model for)RateCategory.RateException
- if a rate category uses the FitzJohn
method at the root as this method requires likelihoods to calculate the frequency
and we don't have the likelihoods when simulating.public Site getSite(boolean internal, java.util.Map<java.lang.String,java.lang.String> recode) throws Simulate.SimulationException, RateCategory.RateException
recode
- Map of recodingsinternal
- Whether to return the state of the internal nodesSimulate.SimulationException
- Thrown if there is a problem
with the simulation (currently only if attempting to simulate for a site class
we don't have a model for)RateCategory.RateException
- if a rate category uses the FitzJohn
method at the root as this method requires likelihoods to calculate the frequency
and we don't have the likelihoods when simulating.public Site getSite(boolean internal, java.util.Map<java.lang.String,java.lang.String> recode, java.lang.String siteClass) throws Simulate.SimulationException, RateCategory.RateException
recode
- Map of recodingsinternal
- Whether to return the state of the internal nodessiteClass
- The site class to simulate forSimulate.SimulationException
- Thrown if there is a problem
with the simulation (currently only if attempting to simulate for a site class
we don't have a model for)RateCategory.RateException
- if a rate category uses the FitzJohn
method at the root as this method requires likelihoods to calculate the frequency
and we don't have the likelihoods when simulating.public Alignment getAlignment(int length) throws AlignmentException, Simulate.SimulationException, RateCategory.RateException
length
- The length of the alignmentAlignmentException
- Thrown if there is a problem with the alignmentSimulate.SimulationException
- Thrown if there is a problem
with the simulation (currently only if attempting to simulate for a site class
we don't have a model for)RateCategory.RateException
- if a rate category uses the FitzJohn
method at the root as this method requires likelihoods to calculate the frequency
and we don't have the likelihoods when simulating.public Alignment getAlignment(int length, boolean internal) throws AlignmentException, Simulate.SimulationException, RateCategory.RateException
length
- The length of the alignmentinternal
- Whether to return the state of the internal nodesAlignmentException
- Thrown if there is a problem with the alignmentSimulate.SimulationException
- Thrown if there is a problem
with the simulation (currently only if attempting to simulate for a site class
we don't have a model for)RateCategory.RateException
- if a rate category uses the FitzJohn
method at the root as this method requires likelihoods to calculate the frequency
and we don't have the likelihoods when simulating.public Alignment getAlignment(int length, java.util.Map<java.lang.String,java.lang.String> recode) throws AlignmentException, Simulate.SimulationException, RateCategory.RateException
length
- The length of the alignmentrecode
- Map of recodingsAlignmentException
- Thrown if there is a problem with the alignmentSimulate.SimulationException
- Thrown if there is a problem
with the simulation (currently only if attempting to simulate for a site class
we don't have a model for)RateCategory.RateException
- if a rate category uses the FitzJohn
method at the root as this method requires likelihoods to calculate the frequency
and we don't have the likelihoods when simulating.public Alignment getAlignment(int length, boolean internal, java.util.Map<java.lang.String,java.lang.String> recode) throws AlignmentException, Simulate.SimulationException, RateCategory.RateException
length
- The length of the alignmentinternal
- Whether to return the state of the internal nodesrecode
- Map of recodingsAlignmentException
- Thrown if there is a problem with the alignmentSimulate.SimulationException
- Thrown if there is a problem
with the simulation (currently only if attempting to simulate for a site class
we don't have a model for)RateCategory.RateException
- if a rate category uses the FitzJohn
method at the root as this method requires likelihoods to calculate the frequency
and we don't have the likelihoods when simulating.public Alignment getAlignment(java.util.List<java.lang.String> siteClasses) throws AlignmentException, Simulate.SimulationException, RateCategory.RateException
siteClasses
- List of site classes used to generate the alignmentAlignmentException
- Thrown if there is a problem with the alignmentSimulate.SimulationException
- Thrown if there is a problem
with the simulation (currently only if attempting to simulate for a site class
we don't have a model for)RateCategory.RateException
- if a rate category uses the FitzJohn
method at the root as this method requires likelihoods to calculate the frequency
and we don't have the likelihoods when simulating.public Alignment getAlignment(java.util.List<java.lang.String> siteClasses, boolean internal) throws AlignmentException, Simulate.SimulationException, RateCategory.RateException
siteClasses
- List of site classes used to generate the alignmentinternal
- Whether to return the state of the internal nodesAlignmentException
- Thrown if there is a problem with the alignmentSimulate.SimulationException
- Thrown if there is a problem
with the simulation (currently only if attempting to simulate for a site class
we don't have a model for)RateCategory.RateException
- if a rate category uses the FitzJohn
method at the root as this method requires likelihoods to calculate the frequency
and we don't have the likelihoods when simulating.public Alignment getAlignment(java.util.List<java.lang.String> siteClasses, java.util.Map<java.lang.String,java.lang.String> recode) throws AlignmentException, Simulate.SimulationException, RateCategory.RateException
siteClasses
- List of site classes used to generate the alignmentrecode
- Map of recodingsAlignmentException
- Thrown if there is a problem with the alignmentSimulate.SimulationException
- Thrown if there is a problem
with the simulation (currently only if attempting to simulate for a site class
we don't have a model for)RateCategory.RateException
- if a rate category uses the FitzJohn
method at the root as this method requires likelihoods to calculate the frequency
and we don't have the likelihoods when simulating.public Alignment getAlignment(java.util.List<java.lang.String> siteClasses, boolean internal, java.util.Map<java.lang.String,java.lang.String> recode) throws AlignmentException, Simulate.SimulationException, RateCategory.RateException
siteClasses
- List of site classes used to generate the alignmentinternal
- Whether to return the state of the internal nodesrecode
- Map of recodingsAlignmentException
- Thrown if there is a problem with the alignmentSimulate.SimulationException
- Thrown if there is a problem
with the simulation (currently only if attempting to simulate for a site class
we don't have a model for)RateCategory.RateException
- if a rate category uses the FitzJohn
method at the root as this method requires likelihoods to calculate the frequency
and we don't have the likelihoods when simulating.public void setSeed(long seed)
seed
- The seed to be used