Skip to content

General Workflow

Niema Moshiri edited this page May 22, 2017 · 38 revisions

Below is a description of the FAVITES workflow as it is implemented in the Driver_Default implementation of the Driver module. Of course, FAVITES is modular, so if you wish to design your own custom workflow, you have the ability to write your own implementation of the Driver module.

  1. The Driver module calls the ContactNetworkGenerator module to create an edge list that represents the contact network (either read one from file or randomly generate one)
  2. The Driver module creates an instance of the ContactNetwork module, using the edge list returned by the ContactNetworkGenerator module
  3. The Driver module then orchestrates the simulation process:
    1. The Driver module initializes the Transmission Network:
      • The Driver calls the SeedSelection module to choose which nodes in the ContactNetwork object to be initially infected
      • Then, for each of these "seed" nodes, the Driver module calls the SeedSequence module to generate initial infection sequence(s) and infection time(s) for each seed node
    2. The Driver module then repeatedly creates transmission events until the ending criteria in the EndCriteria module are reached:
      • The Driver module calls the TransmissionNodeSample module to choose two nodes to be involved in a transmission event
      • The Driver module calls the TransmissionTimeSample module to choose the time of the transmission event
      • The Driver module calls the NodeEvolution and the SequenceEvolution modules on the source node to ensure the source node is evolved until the transmission time
      • The Driver module calls the SourceSample module on the source node, passing in the time of transmission, and the SourceSample module will choose which edge(s) of the source node's viral phylogenetic tree(s) (and thus which viral sequence(s)) to transmit
    3. Once the transmission iterations have completed, the Driver module calls the TimeSample module to choose time points at which to sample each individual in the Contact Network, and it then calls the NumBranchSample module to determine the number of viral branches in the given individual at the given time
    4. The Driver module outputs the full Transmission Network, the sampled phylogenetic tree(s), and the sampled sequence data (i.e., the full simulation output)
  4. The PostValidation module then takes in the full simulation output provided by the Driver module and computes a validity score (i.e., how well the output matches what we would expect)
  5. The Driver module then takes in the full error-free simulation output and introduces real data artifacts:
    1. The Driver module first calls the NodeSample module, which subsamples the nodes in the Transmission Network (to simulate imperfect epidemiological efforts)
    2. The Driver module then calls the Sequencing module (passing in the output of the NodeSample module), which simulates sequencing imperfections (sequence subsampling per individual, sequencing error, post-processing, consensus, ambiguity, etc.)

The Logging module handles all logging functionality.