Changelog for epi-sim-0.7.0
Changelog for epi-sim
0.7.0
- Simulation functions (eg
simulationWithGenIO) return either the simulated events of the summary produced by the termination handler if the simulation terminated early. - The
InhomBDSCODPopnow records the number of individuals that have been removed and there are getter functions exported to access this information. - Add
TerminationHandlerto provide better control over early termination of simulations. For example, this makes it possible to terminate the simulation early if certain stopping conditions are met and to call a function that summarises why the simulation is being terminated. This will break old code in that theconfigurationfunctions provided by the example models all now have an additional parameter of typeMaybe TerminationHandler.
0.6.0
- Improve documentation.
- Allow a flexible start time of the simulation so it does not assume a start time of zero.
- Rename a bunch of the simulation functions so their use case is clearer.
0.5.2
- Include helper functions in
Epidemic.Types.Simulationto make it easier to create PRNG with or without a fixed seed.
0.5.1
- Bug fix and tidy up some code.
0.5.0
- Add absolute times to the extinction and stopping time events to provide a consistent interface.
- Add the
aggregatedfunction to help aggregated individual level samples into population level samples. This is tested inaggregationTests. - Add
TimeStamptype class to abstract working with types that have an absolute time associated with them. - Add
TimeIntervaltype for working with intervals of time, there are also some helper functions to make it easier to work with intervals. - Add the
maybeNextTimedhelper function and clean up some code in theTimemodule. - Extend
ModelParametersclass to have aneventWeightsto provide a vector of event weights for computing which event actually occurred.
0.4.2
- Include
simulationWithGenIOand addscRequireCherryto theSimulationConfigurationrecord type to make it easier to control how simulations are conditioned upon particular observations. - Documentation.
- Bug fix in edge case of no sequenced samples.
0.4.1
- Update the
simulationWithSystemRandomfunction so that this works again.
0.4.0.0
- The following changes to the
EpidemicEventtype will be the real sticking point in moving from0.3.0.0to0.4.0.0:
-- | Events that can occur in an epidemic with their absolute time.
data EpidemicEvent
= Infection AbsoluteTime Person Person -- ^ infection time, infector, infectee
| Removal AbsoluteTime Person -- ^ removal without observation
| Sampling AbsoluteTime Person -- ^ removal and inclusion in phylogeny
| Catastrophe AbsoluteTime People -- ^ scheduled sampling of lineages
| Occurrence AbsoluteTime Person -- ^ removal and observed by not in phylogeny
| Disaster AbsoluteTime People -- ^ scheduled occurrence of lineages
| Extinction -- ^ epidemic went extinct time time can be recovered from the preceeding removal
| StoppingTime -- ^ the simulation reached the stopping time
deriving (Show, Generic, Eq)
becomes
-- | Events that can occur in an epidemic with their absolute time.
data EpidemicEvent
= Infection AbsoluteTime Infector Infectee
| Removal AbsoluteTime Person
| IndividualSample
{ indSampTime :: AbsoluteTime
, indSampPerson :: Person
, indSampSeq :: Bool
}
| PopulationSample
{ popSampTime :: AbsoluteTime
, popSampPeople :: People
, popSampSeq :: Bool
}
| Extinction -- ^ epidemic went extinct time time can be recovered from the preceeding removal
| StoppingTime -- ^ the simulation reached the stopping time
deriving (Show, Generic, Eq)
- Remove CSV export, now there is only JSON export. If you want to include an
orphan instance for working with
cassavathe following might be useful
instance Csv.ToRecord EpidemicEvent where
toRecord e =
case e of
(Infection time person1 person2) ->
Csv.record
[ "infection"
, Csv.toField time
, Csv.toField person1
, Csv.toField person2
]
(Removal time person) ->
Csv.record ["removal", Csv.toField time, Csv.toField person, "NA"]
(Sampling time person) ->
Csv.record ["sampling", Csv.toField time, Csv.toField person, "NA"]
(Catastrophe time people) ->
Csv.record ["catastrophe", Csv.toField time, Csv.toField people, "NA"]
(Occurrence time person) ->
Csv.record ["occurrence", Csv.toField time, Csv.toField person, "NA"]
(Disaster time people) ->
Csv.record ["disaster", Csv.toField time, Csv.toField people, "NA"]
Extinction -> Csv.record ["extinction", "NA", "NA", "NA"]
StoppingTime -> Csv.record ["stop", "NA", "NA", "NA"]
- Move the Newick material into
Epidemic.Types.Newick. - Remvoe the
TransmissionTreeandSampleTreedata types because there is already theEpidemicTreeandReconstructedTreein theEpidemic.Types.Eventswhich should be used preferentially. - Remove dependency on
trifectasince this functionality is not necessary.
0.3.0.0
- Add an
ARCHITECTURE.mdfile to outline the structure of this package. - Move all the temporal types into their own submodule
Epidemic.Types.Timeso they are easier to isolate. - Provide a
Epidemic.Types.Observationsmodule to provide the functionality surrounding extracting the observed events from a simulation. - Add
ExtinctionandStoppingTimeconstructors for theEpidemicEventtype so that we can encode why the simulation finished in the events. As a result of this change, every simulation that was not terminated early should end with anExtinctionevent or aStoppingTimeevent. - Update the resolver to 17.2
- Extend the
ModelParametersclass to include aPopulationparameter type since this is needed to compute event rates in for the logistic model. - Create
Epidemic.Type.Simulationmodule for types relating to running generic simulations from the models to avoid confusion as to where these are defined. - Move class definitions into corresponding
Epidemic.Type.Xmodules. - Add a
Epidemic.Model.LogisticBDSDmodule implementing a logistic birth-death process with unscheduled sampling and scheduled unsequenced sampling. - Move the models into a new
Epidemic.Modelmodule so that it is clearer that these are really just examples of putting together functionality provided by the rest of the library. - Use a new type
Identifierto represent identities of people rather than a raw integer this way it is clearer what it really is. - Replace
TimewithAbsoluteTimeandTimeDeltatypes to make it explicit what is being represented. - Reduce the number of models that are included to the more interesting subset.
0.2.2.0
- Clean up for a release candidate.
0.2.1.0
- Update the stack resolver to
lts-16.17and add bounds on the package versions to use. - Remove dependency upon
epi-typesby moving its modules into this package and include the tests from that package. - Remove unused
Setup.hsfile.
0.2.0.1
- Improve documentation in
Epidemic.BDSCOD. - Upgrade to
epi-types-0.2.1.2for the bug fix.
0.2.0.0
- Predicates such as
isSamplingandisOccurrencehave been replaced with clearer named alternatives:isNonReconTreeObservationandisReconTreeLeafto avoid uncertainty about whether scheduled events are included. - Upgrade to
epi-types-0.2.1.0which adds substantial amounts of Newick functionality meaning this can be removed.
0.1.9.0
- Upgrade to
epi-types-0.2.0.0which makes a lot of functions redundant so they have been removed.
0.1.8.8
- Upgrade to
epi-types-0.1.1.1and removejoinTimedsince it is no longer needed.
0.1.8.7
- Upgrade to
epi-types-0.1.1.0and start using theTimed *class.
0.1.8.6
- Use
-j2to slightly improve compilation time. - Include a
observedEventsfunction which was missing from theInhomogeneousBDSmodule.
0.1.8.5
- Start using cabal directly without hpack.
- Move time dependent parameters into a
epi-simpackage so they are easier to share, and import them here.
0.1.8.4
- Improve documentation of construction of
inhomBDSRatesand include a test to check this conforms to expectations. - Implement a birth-death-sampling model with time-dependent birth rates and include an example of what this returns in the README.
0.1.8.3
- Improve error handling in
birth-death-lines.R. - Refactor some of the plotting code in
birth-death-lines.Rto make it easier to maintain. - Use the
futureandfurrrpackages in R to generate the visualisation of a simulation in parallel since the serial version is frustratingly slow. Both packages are on CRAN so it does not seem unreasonable.
0.1.8.2
- Include an additional parameter in the
simulationandsimulationWithSystemRandomto determine whether the simulation should be conditioned on having at least two sampled leaves in the reconstructed tree. It does this by repeatedly simulating until such a tree is acheved.
0.1.8.1
- Implement an example of the inhomogeneous birth-death process and include it
in the
README. - Fix broken example using the BDSCOD model and organise examples in
examples/rather than just the single one inapp/.
0.1.8.0
- Define an inhomogeneous birth-death process in
InhomogeneousBD. - Define an inhomogeneous exponential random sampler using
Timed Rates. - Extend the
ModelParametersclass to have abirthProbfunction. - Include a
Timedtype for time varying values. - Include a test that the final size of a birth-death simulation is approximately correct.
- Format the changelog to make it easier to read outside of a browser.
- Fix naming convention and exports in the
BirthDeath,BirthDeathSamplingandBirthDeathSamplingOccurrencemodules to conform to the pattern used in theBDSCODmodule and movesimulationinto theUtilitymodule since it is common between all models - Adjust the type of the
ModelParametersinterface to include potential time dependence.
0.1.7.2
- Make
Eventan instance ofFromRecordto match withToRecord.
0.1.7.1
- Provide
vis/birth-death-lines.Rwhich visualises a simulation.
0.1.7.0
- Provide
vis/ott.Rto visualise observations through time and makevis/ltt.Rignore disasters. - Replace some Catastrophe specific functions with equivalents for handling
scheduled events more generally
noCatastrophebecomesnoScheduledEventfirstCatastrophebecomesfirstScheduled
- Change the naming of the BDSCO model to be consistent with the new BDSCOD model.
- Implement a birth-death-sampling-catastrophe-occurrence-disaster model in
Epidemic.BDSCOD.
0.1.6.2
- Update the visualisation code in
vis/ltt.Rsuch that it parses the catastrophe events to draw the LTT. - BUG FIX: In the observed events catastrophes are replicated when they should not be.
0.1.6.1
- Include a visualisation script for the LTT of reconstructed trees:
vis/ltt.Rwhich is described in the README.
0.1.6.0
- Move the
ToFielddeclarations into theEpidemicmodule to avoid orphaned instance and select a representation for multiple people in the CSV output. - Implement a birth-death-sampling-catastrophe-occurrence model in
Epidemic.BirthDeathSamplingCatastropheOccurrence; it's a shame about the length of the name. - Include a contructor for catastrophe events in which multiple people can be sampled simultaneously.
0.1.5.1
- Include a
.gitignore. - Improved documentation with
haddock.
0.1.5.0
- Include some testing with
hspec. - The
Epidemic.BirthDeathSamplingOccurrencemodule now has a function to extract the observable events. - Change the simulation functions to return events in the order they occurred.
- Change the configuration functions to take tuples of model parameters.
0.1.4.0
- Make
Eventan instance of theOrdtypeclass. - Implement types and conversion functions for a
TransmissionTreeand aSampleTree. - Implement a parser and printer for Newick in
Epidemic.Utility.
0.1.3.0
- Implement a birth-death-sampling-occurrence model in
Epidemic.BirthDeathSamplingOccurrence. - Implement a visualisation of the birth-death-sampling LTT in
vis/birthDeathSamplingVisualisation.R. - Implement a birth-death-sampling model in
Epidemic.BirthDeathSampling.
0.1.2.0
- Implement a visualisation of the infection network in
vis/infection-tree.vg.json. - Implement
Epidemic.Utility.eventsAsJsonTree. - Move the
Epidemic.Simulationmodule toEpidemic.Utility.
0.1.1.0
- Write the output to CSV using
cassava
0.1.0.0
- Basic prototype to simulate a constant rate birth-death process.