Skip to content

ts: Add a runMacsTs() version of runMacs() #21

@gregorgorjanc

Description

@gregorgorjanc

Current runMacs() does:

  1. Simulates local trees
  2. Simulates mutation events
  3. Drops mutations down the local trees to generate haplotypes (this is a memory bottleneck with the currently-implemented high mutation rates ~1e-8)
  4. Downsamples sites so we don't ran out of memory in downstream work with AlphaSimR

With @LynxJinyangii and @bryo-han wediscussed today that we would like to:

  • Avoid the memory bottleneck in generating haplotypes (and possibly also downsampling sites)
    • To address the above we could just implement lower mutation rate in the current species models
    • And we set it via a new mutRate argument to runMacs() so users can manipulate it as they need
  • runMacs() to return haplotypes - as MapPop, so that we can continue with the current standard AlphaSimR genome workflow: founderGenomes <- runMacs(...); SP <- SimParam$new(founderGenomes)
  • runMacs() to possibly also return tree sequence - as RcppTskit::TreeSequence and we then do ts <- runMacs(...); founderGenomes <- asMapPop(ts, segSites=n); SP <- SimParam$new(founderGenomes)
    • convert MaCS local trees into RcppTskit::TreeSequence (is this easy or very hard?)
    • add returnTreeSeq argument to runMacs() to control whether we return RcppTskit::TreeSequence or MapPop
  • asMapPop(ts, segSites=n) could be used to downsample sites if needed
  • get genetic and physical maps from MaCS so we have both for downstream work

Are we missing anything in the above summary @LynxJinyangii?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions