Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/R-CMD-check.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ jobs:

- uses: r-lib/actions/setup-r-dependencies@v2
with:
extra-packages: any::rcmdcheck
extra-packages: github::LynxJinyangii/RcppTskit/RcppTskit@add-multiple-functions-on-pr-131, any::rcmdcheck
needs: check

- uses: r-lib/actions/check-r-package@v2
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/document.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:
- name: Install dependencies
uses: r-lib/actions/setup-r-dependencies@v2
with:
extra-packages: any::roxygen2
extra-packages: github::LynxJinyangii/RcppTskit/RcppTskit@add-multiple-functions-on-pr-131, any::roxygen2
needs: roxygen2

- name: Document
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pkgdown.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:

- uses: r-lib/actions/setup-r-dependencies@v2
with:
extra-packages: any::pkgdown, local::.
extra-packages: github::LynxJinyangii/RcppTskit/RcppTskit@add-multiple-functions-on-pr-131, any::pkgdown, local::.
needs: website

- name: Build site
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test-coverage.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ jobs:

- uses: r-lib/actions/setup-r-dependencies@v2
with:
extra-packages: any::covr, any::xml2
extra-packages: github::LynxJinyangii/RcppTskit/RcppTskit@add-multiple-functions-on-pr-131, any::covr, any::xml2
needs: coverage

- name: Test coverage
Expand Down
36 changes: 36 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
.Rhistory
.Rproj.user/
.Ruserdata
.Rproj.user.bak/
.httr-oauth
/*.Rcheck/
/.*tar.gz
Expand All @@ -30,3 +31,38 @@ src/Makevars
src/Makevars.win
vignettes/*.html
vignettes/*.pdf
.idea/
src/.idea/
.Rlib/
*tar.gz
__pycache__/
testData/out_phase1_useMacsMut_FALSE/*.trees
testData/out_msprime_from_macs/*.trees
dev/testData/out_phase1_useMacsMut_FALSE/*.trees
dev/testData/out_msprime_from_macs/*.trees
dev/testData/AlphaSimR_extended_TS_*.trees
dev/testData/inbred_test.trees
dev/testData/forward_*.trees
dev/testData/msprime_bridge_*.trees
dev/testData/msprime_direct_*.trees
dev/testData/runMacTS_bridge_*.trees
dev/testData/runMacTS_direct_*.trees
dev/testData/runMacTS_founder_*.trees
dev/testData/runMacsTS_bridge_*.trees
dev/testData/runMacsTS_direct_*.trees
dev/testData/runMacsTS_founder_*.trees
dev/testData/standard_forward_recorder_*.trees
dev/testData/standard_*_forward_recorder_*.trees
dev/testData/standard_msprime_*_input_forward_recorder_*.trees
dev/testData/standard_msprime_vcf_addTsMut_forward_recorder_*.trees
!dev/testData/*.vcf
!dev/testData/AlphaSimR_extended_chr*.trees
!dev/testData/MaCSTS*.trees
!dev/testData/msprime_chr*.trees
dev/testData/*_pairs.json
dev/testData/hotspots*.txt
dev/testData/*_hotspots_for_window_counts.txt
dev/testData/out_phase1_useMacsMut_FALSE/*.debug.txt
dev/testData/out_phase1_useMacsMut_FALSE/*.demography.png
dev/*.html
dev/tmp_tree.*
3 changes: 1 addition & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,7 @@ Depends: R (>= 4.0.0)
Imports: Rcpp (>= 0.12.7), Rdpack, methods, R6, RcppTskit (>= 0.3.0)
RdMacros: Rdpack
LinkingTo: Rcpp, RcppArmadillo (>= 0.7.500.0.0), BH, dqrng (>= 0.4.1), RcppTskit
RoxygenNote: 7.3.3
Suggests: knitr, rmarkdown, testthat
VignetteBuilder: knitr
NeedsCompilation: true
Config/roxygen2/version: 8.0.0
Config/roxygen2/version: 8.1.0
68 changes: 41 additions & 27 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ export(aa)
export(addSegSite)
export(asCategorical)
export(asLogNormal)
export(asMapPop)
export(asPoisson)
export(attrition)
export(bv)
Expand Down Expand Up @@ -41,6 +42,7 @@ export(hybridCross)
export(importGenMap)
export(importHaplo)
export(importInbredGeno)
export(importVCF)
export(isFemale)
export(isHybridPop)
export(isMale)
Expand Down Expand Up @@ -89,6 +91,7 @@ export(rtsk_table_collection_summary2)
export(rtsk_treeseq_get_num_individuals2)
export(runMacs)
export(runMacs2)
export(runMacsTS)
export(sampleHaplo)
export(selIndex)
export(selInt)
Expand All @@ -104,6 +107,8 @@ export(setMarkerHaplo)
export(setPheno)
export(setPhenoGCA)
export(setPhenoProgTest)
export(simAnc)
export(simMut)
export(smithHazel)
export(solveMKM)
export(solveMVM)
Expand All @@ -114,6 +119,9 @@ export(solveRRBLUP_EM)
export(solveRRBLUP_EM2)
export(solveRRBLUP_EM3)
export(solveUVM)
export(tsForwardFinalizeFromSimParam)
export(tsForwardHasRecorder)
export(tsForwardWriteTreesFromSimParam)
export(unnameMultiPop)
export(usefulness)
export(varA)
Expand Down Expand Up @@ -146,31 +154,37 @@ import(Rcpp)
import(RcppTskit)
importFrom(R6,R6Class)
importFrom(Rdpack,reprompt)
importFrom(methods,.hasSlot)
importFrom(methods,classLabel)
importFrom(methods,is)
importFrom(methods,new)
importFrom(methods,show)
importFrom(methods,slot)
importFrom(methods,validObject)
importFrom(stats,aggregate)
importFrom(stats,coef)
importFrom(stats,cov2cor)
importFrom(stats,dnorm)
importFrom(stats,lm)
importFrom(stats,model.matrix)
importFrom(stats,na.omit)
importFrom(stats,pnorm)
importFrom(stats,qgamma)
importFrom(stats,qnorm)
importFrom(stats,rbinom)
importFrom(stats,rnorm)
importFrom(stats,rpois)
importFrom(stats,runif)
importFrom(stats,setNames)
importFrom(stats,var)
importFrom(utils,combn)
importFrom(utils,packageDescription)
importFrom(utils,read.table)
importFrom(utils,write.table)
importFrom(methods,
.hasSlot,
classLabel,
is,
new,
show,
slot,
validObject
)
importFrom(stats,
aggregate,
coef,
cov2cor,
dnorm,
lm,
model.matrix,
na.omit,
pnorm,
qgamma,
qnorm,
rbinom,
rnorm,
rpois,
runif,
setNames,
var
)
importFrom(utils,
combn,
packageDescription,
read.table,
write.table
)
useDynLib(AlphaSimR, .registration = TRUE)
14 changes: 11 additions & 3 deletions R/Class-Pop.R
Original file line number Diff line number Diff line change
Expand Up @@ -686,7 +686,7 @@ newPop = function(rawPop,ploidy=NULL,simParam=NULL,nThreads=NULL,...){
.newPop = function(rawPop, id=NULL, mother=NULL, father=NULL,
iMother=NULL, iFather=NULL, isDH=NULL,
femaleParentPop=NULL, maleParentPop=NULL,
hist=NULL, simParam=NULL, nThreads=NULL,...){
hist=NULL, histGen=NULL, simParam=NULL, nThreads=NULL,...){
if(is.null(simParam)){
simParam = get("SP",envir=.GlobalEnv)
}
Expand Down Expand Up @@ -813,7 +813,7 @@ newPop = function(rawPop,ploidy=NULL,simParam=NULL,nThreads=NULL,...){

if(simParam$isTrackPed){
if(simParam$isTrackRec){
simParam$addToRec(lastId,id,iMother,iFather,isDH,hist,output@ploidy)
simParam$addToRec(lastId,id,iMother,iFather,isDH,hist,histGen,output@ploidy) #Jinyang modified
}else{
simParam$addToPed(lastId,id,iMother,iFather,isDH)
}
Expand All @@ -823,6 +823,14 @@ newPop = function(rawPop,ploidy=NULL,simParam=NULL,nThreads=NULL,...){

output = simParam$finalizePop(output, simParam=simParam, ...)

ts_forward_attrs <- c("tsForwardSource", "tsForwardPosMeta")
for (nm in ts_forward_attrs) {
val <- attr(rawPop, nm, exact = TRUE)
if (!is.null(val)) {
attr(output, nm) <- val
}
}

return(output)
}

Expand Down Expand Up @@ -1534,4 +1542,4 @@ unnameMultiPop = function(x, level = Inf) {
}
validObject(mp)
return(mp)
}
}
Loading
Loading