Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

document recHist #210

Open
hannesbecher opened this issue Nov 25, 2024 · 4 comments
Open

document recHist #210

hannesbecher opened this issue Nov 25, 2024 · 4 comments

Comments

@hannesbecher
Copy link

Is your feature request related to a problem? Please describe.
The recHist slot/property of the SimParam class is not documented/described, it seems.

Describe the solution you'd like
This is related to #94 of course, but as a start, it would be helpful to add a documentation page to the package explaining the nested structure of the recHist object.

Describe alternatives you've considered
#94

Additional context
An ASR simulation of tetraploids with 3 autosomes:

library(AlphaSimR)

nmp <- runMacs(nInd = 10, segSites = 10000, nChr = 3, ploidy = 4)
nmp

SP <- SimParam$new(nmp)
SP$setTrackPed(isTrackPed = T)
SP$setTrackRec(isTrackRec = T)
g00 <- newPop(nmp)

SP$pedigree

g01 <- randCross(g00, nCrosses = 10)
g02 <- randCross(g01, nCrosses = 10)
g03 <- randCross(g02, nCrosses = 10)
g04 <- randCross(g03, nCrosses = 10)
g05 <- randCross(g04, nCrosses = 10)
g06 <- randCross(g05, nCrosses = 10)
g07 <- randCross(g06, nCrosses = 10)
g08 <- randCross(g07, nCrosses = 10)
g09 <- randCross(g08, nCrosses = 10)
g09


SP$recHist[[100]] # 3 homologous sets
SP$recHist[[100]][1,1][[1]] # homologous set 1 (of 4 chromosomes)

SP$recHist[[100]][1,1][[1]][1,1][[1]] # the focal individual's chromosome 1st homologous chromosome in set 1
SP$recHist[[100]][1,1][[1]][2,1][[1]] # the focal individual's chromosome 2nd homologous chromosome in set 1
SP$recHist[[100]][1,1][[1]][3,1][[1]] # the focal individual's chromosome 3rd homologous chromosome in set 1
SP$recHist[[100]][1,1][[1]][4,1][[1]] # the focal individual's chromosome 4th homologous chromosome in set 1

The 1st and 2nd chromosome of each set come from the same parent, I think. Which one is it, mother or father?

Feel fee to assign to me/ happy to send a PR.

@gregorgorjanc
Copy link
Contributor

@hannesbecher I replied to this question #34 with an example that you can use/adapt-to-your-case as a starting point - you could lift and polish that explanation ...

@hannesbecher
Copy link
Author

Cool thanks, did nt think to look into the closed issues, @gregorgorjanc. Where should this information best be moved to, a vignette? A documentation page? I guess both would be useful? @gaynorr ?
Doc page
I guess documentation pages can be hard to find if they are not for a specific function. The SimParam class has a very complicated doc page but only its methods are explained. Where would one best document the recHist slot/property of SimParam?
Vignette
I think a general vignette on recombination in ASR would be useful. It might cover:

  • how to specify recombination maps
  • that recombination is recorded on the marker level (not chromosome position)
  • how to interpret recorded recombination histories

@gregorgorjanc
Copy link
Contributor

@hannesbecher this would be best handled by a vignette in my opinion and we have an open issue about this at #94 - I asked @AprilYUZhang to lead on this one, but I reckon we should all pul our shoulder to the wheel to make it happen. I see she started with some edits in AprilYUZhang@7971e9b, but we should move those to a separate independent vignette. Can you lead on this and pull @AprilYUZhang and me as needed and then @gaynorr will surely jump at some point in;)

@gregorgorjanc
Copy link
Contributor

@hannesbecher yes, you have raised good points that should be mentioned in the vignette - how to specify recombination rate, map, marker vs bp level, distances, recHist!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants