forked from gaynorr/AlphaSimR
-
Notifications
You must be signed in to change notification settings - Fork 3
Open
Description
In #4 we discuss on how to generate or import tree sequence into R and to generate haplotypes for standard AlphaSimR simulation.
We also want to take the imported tree sequence and grow if further in AlphaSimR.
Assuming we have founderTs with multiple chromosomes (this functionality does not yet exist atm!) and converter asMapPop() from #4 then we could do:
# founderTs is obtained in an appropriate way
founderGenomes = asMapPop(founderTs, segSites = 3)
# asMapPop should recognise how many chromosomes (how many separate tree sequences we have in founderTs)
SP = SimParam$new(founderGenomes)
# Continue with AlphaSimR as usually with the "box of haplotype" approach and
# ignoring tree sequence entirely from this point onwards
# (it was used only to get base population haplotypes stored in founderGenomes)
But we could also create a new class MapPopTs which extends MapPop by also holding tree sequence, so that when we do:
founderGenomesTs = asMapPopTs(founderTs, segSites = 3)
SP = SimParam$new(founderGenomesTs)
SP$ts # place where ts will live in R/AlphaSimR
# Continue with AlphaSimR
we would have base population haplotypes and tree sequence in founderGenomesTs and by passing founderGenomesTs to SimParam$new(founderGenomesTs) we would also automatically set SP$setTrackTs(TRUE).
Alternative to using founderGenomesTs would be to do:
founderGenomes = asMapPop(founderTs, segSites = 3)
SP = SimParam$new(founderGenomes)
SP$setTrackTs(TRUE)
# this would initiate empty tree sequence (ignoring the past!) and we would grow it from this point onwards
SP$ts # place where ts will live in R/AlphaSimR
# Continue with AlphaSimR
or
founderGenomes = asMapPop(founderTs, segSites = 3)
SP = SimParam$new(founderGenomes)
SP$importTs(founderTs) # import the tree sequence
SP$setTrackTs(TRUE) # grow it from this point onwards
SP$ts # place where ts will live in R/AlphaSimR
# Continue with AlphaSimR
Metadata
Metadata
Assignees
Labels
No labels