gaynorr / AlphaSimR

R package for breeding program simulations
https://gaynorr.github.io/AlphaSimR/
Other
43 stars 18 forks source link

Extract only specified loci in pullX() functions #27

Closed gregorgorjanc closed 2 years ago

gregorgorjanc commented 2 years ago

pullX() functions (like pullSegSiteHaplo() and others) grab all loci in the genome (pullSegSiteHaplo(pop)) or all loci on a chromosome (pullSegSiteHaplo(pop, chr = 1)).

Sometimes we want just a short segment of a chromosome. For example, we are developing honeybee extension and have to check csd locus of every bee, which means that we will have to retrieve chromosome with the csd locus for.many individuals, while we need to check only the csd locus. Hence, there will be lots of overhead.

I propose addition of loc argument (or some other name) to pullX() functions to enable retrieval only of the specified region of a chromosome (could provide a list for more regions? lets keep it simple first!).

Looking at code is see we have selectLoci() so maybe we can work around this function?

What do you think @gaynorr?

gregorgorjanc commented 2 years ago

Recent changes address this issue (pullMarkerGeno() and pullMarkerHaplo())