diff --git a/NAMESPACE b/NAMESPACE index 2594253a..796f782a 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -133,6 +133,14 @@ exportClasses(TraitADG) exportClasses(TraitAE) exportClasses(TraitAEG) exportClasses(TraitAG) +exportMethods(makeCross) +exportMethods(makeCross2) +exportMethods(makeDH) +exportMethods(randCross) +exportMethods(randCross2) +exportMethods(selectCross) +exportMethods(self) +exportMethods(setPheno) import(Rcpp) importFrom(R6,R6Class) importFrom(Rdpack,reprompt) diff --git a/R/crossing.R b/R/crossing.R index d84be75f..8fb88419 100644 --- a/R/crossing.R +++ b/R/crossing.R @@ -31,8 +31,29 @@ #' pop2 = makeCross(pop, crossPlan, simParam=SP) #' #' @export -makeCross = function(pop,crossPlan,nProgeny=1, - simParam=NULL,nThreads=NULL){ +setGeneric( + "makeCross", + function(pop, crossPlan, nProgeny=1, simParam=NULL, nThreads=NULL){ + standardGeneric("makeCross") + } +) + +#' @describeIn makeCross Method for \code{\link{Pop-class}} +#' @export +setMethod( + "makeCross", + signature(pop = "Pop"), + function(pop, crossPlan, nProgeny=1, simParam=NULL, nThreads=NULL){ + .makeCross_internal( + pop=pop, crossPlan=crossPlan, nProgeny=nProgeny, simParam=simParam, + nThreads=nThreads) + } +) + +# Internal implementation shared by makeCross methods +#' @keywords internal +.makeCross_internal = function(pop,crossPlan,nProgeny=1, + simParam=NULL,nThreads=NULL){ if(is.null(simParam)){ simParam = get("SP",envir=.GlobalEnv) } @@ -42,7 +63,7 @@ makeCross = function(pop,crossPlan,nProgeny=1, nThreads = as.integer(nThreads) } if(pop@ploidy%%2L != 0L){ - stop("You can not cross indiviuals with odd ploidy levels") + stop("You can not cross individuals with odd ploidy levels") } if(is.character(crossPlan)){ #Match by ID crossPlan = cbind(match(crossPlan[,1],pop@id), @@ -102,7 +123,7 @@ makeCross = function(pop,crossPlan,nProgeny=1, #' #' @description #' A wrapper for \code{\link{makeCross}} that randomly -#' selects parental combinations for all possible combinantions. +#' selects parental combinations for all possible combinations. #' #' @param pop an object of \code{\link{Pop-class}} #' @param nCrosses total number of crosses to make @@ -132,7 +153,33 @@ makeCross = function(pop,crossPlan,nProgeny=1, #' pop2 = randCross(pop, 10, simParam=SP) #' #' @export -randCross = function(pop,nCrosses,nProgeny=1, +setGeneric( + "randCross", + function( + pop, nCrosses, nProgeny=1, balance=TRUE, parents=NULL, ignoreSexes=FALSE, + simParam=NULL, nThreads=NULL){ + standardGeneric("randCross") + } +) + +#' @describeIn randCross Method for \code{\link{Pop-class}} +#' @export +setMethod( + "randCross", + signature(pop = "Pop"), + function( + pop, nCrosses, nProgeny=1, balance=TRUE, parents=NULL, ignoreSexes=FALSE, + simParam=NULL, nThreads=NULL){ + .randCross_internal( + pop=pop, nCrosses=nCrosses, nProgeny=nProgeny, balance=balance, + parents=parents, ignoreSexes=ignoreSexes, simParam=simParam, + nThreads=nThreads) + } +) + +# Internal implementation shared by randCross methods +#' @keywords internal +.randCross_internal = function(pop,nCrosses,nProgeny=1, balance=TRUE,parents=NULL, ignoreSexes=FALSE, simParam=NULL,nThreads=NULL){ @@ -250,7 +297,34 @@ randCross = function(pop,nCrosses,nProgeny=1, #' pop2 = selectCross(pop, nInd=4, nCrosses=8, simParam=SP) #' #' @export -selectCross = function(pop,nInd=NULL,nFemale=NULL,nMale=NULL,nCrosses, +setGeneric( + "selectCross", + function( + pop, nInd=NULL, nFemale=NULL, nMale=NULL, nCrosses, nProgeny=1, trait=1, + use="pheno", selectTop=TRUE, simParam=NULL, nThreads=NULL, ..., balance=TRUE){ + standardGeneric("selectCross") + } +) + + +#' @describeIn selectCross Method for \code{\link{Pop-class}} +#' @export +setMethod( + "selectCross", + signature(pop = "Pop"), + function( + pop, nInd=NULL, nFemale=NULL, nMale=NULL, nCrosses, nProgeny=1, trait=1, + use="pheno", selectTop=T, simParam=NULL, nThreads=NULL, ..., balance=TRUE){ + .selectCross_internal( + pop=pop, nInd=nInd, nFemale=nFemale, nMale=nMale, nCrosses=nCrosses, + nProgeny=nProgeny, trait=trait, use=use, selectTop=selectTop, + simParam=simParam, nThreads=nThreads, ..., balance=balance) + } +) + +# Internal implementation shared by selectCross methods +#' @keywords internal +.selectCross_internal = function(pop,nInd=NULL,nFemale=NULL,nMale=NULL,nCrosses, nProgeny=1,trait=1,use="pheno",selectTop=TRUE, simParam=NULL,nThreads=NULL,...,balance=TRUE){ if(is.null(simParam)){ @@ -324,7 +398,28 @@ selectCross = function(pop,nInd=NULL,nFemale=NULL,nMale=NULL,nCrosses, #' pop2 = makeCross2(pop, pop, crossPlan, simParam=SP) #' #' @export -makeCross2 = function(females,males,crossPlan,nProgeny=1,simParam=NULL, +setGeneric( + "makeCross2", + function(females,males,crossPlan,nProgeny=1,simParam=NULL, nThreads=NULL){ + standardGeneric("makeCross2") + } +) + +#' @describeIn makeCross2 Method for \code{\link{Pop-class}} +#' @export +setMethod( + "makeCross2", + signature(females = "Pop", males = "Pop"), + function(females,males,crossPlan,nProgeny=1,simParam=NULL, nThreads=NULL){ + .makeCross2_internal( + females=females, males=males, crossPlan=crossPlan, nProgeny=nProgeny, + simParam=simParam, nThreads=nThreads) + } +) + +# Internal implementation shared by makeCross2 methods +#' @keywords internal +.makeCross2_internal = function(females,males,crossPlan,nProgeny=1,simParam=NULL, nThreads=NULL){ if(is.null(simParam)){ simParam = get("SP",envir=.GlobalEnv) @@ -336,7 +431,7 @@ makeCross2 = function(females,males,crossPlan,nProgeny=1,simParam=NULL, } if((females@ploidy%%2L != 0L) | (males@ploidy%%2L != 0L)){ - stop("You can not cross indiviuals with odd ploidy levels") + stop("You can not cross individuals with odd ploidy levels") } if(is.character(crossPlan)){ #Match by ID crossPlan = cbind(match(crossPlan[,1],females@id), @@ -397,7 +492,7 @@ makeCross2 = function(females,males,crossPlan,nProgeny=1,simParam=NULL, #' #' @description #' A wrapper for \code{\link{makeCross2}} that randomly -#' selects parental combinations for all possible combinantions between +#' selects parental combinations for all possible combinations between #' two populations. #' #' @param females an object of \code{\link{Pop-class}} for female parents. @@ -432,10 +527,37 @@ makeCross2 = function(females,males,crossPlan,nProgeny=1,simParam=NULL, #' pop2 = randCross2(pop, pop, 10, simParam=SP) #' #' @export -randCross2 = function(females,males,nCrosses,nProgeny=1, - balance=TRUE,femaleParents=NULL, - maleParents=NULL,ignoreSexes=FALSE, - simParam=NULL,nThreads=NULL){ +setGeneric( + "randCross2", + function( + females, males, nCrosses, nProgeny=1, balance=TRUE, femaleParents=NULL, + maleParents=NULL, ignoreSexes=FALSE, simParam=NULL, nThreads=NULL){ + standardGeneric("randCross2") + } +) + +#' @describeIn randCross2 Method for \code{\link{Pop-class}} +#' @export +setMethod( + "randCross2", + signature(females = "Pop", males = "Pop"), + function( + females, males, nCrosses, nProgeny=1, balance=TRUE, femaleParents=NULL, + maleParents=NULL, ignoreSexes=FALSE, simParam=NULL, nThreads=NULL){ + .randCross2_internal( + females = females, males = males, nCrosses = nCrosses, + nProgeny = nProgeny, balance = balance, femaleParents = femaleParents, + maleParents = maleParents, ignoreSexes = ignoreSexes, + simParam = simParam, nThreads = nThreads) + } +) + +# Internal implementation shared by randCross2 methods +#' @keywords internal +.randCross2_internal = function( + females, males, nCrosses, nProgeny=1, balance=TRUE, femaleParents=NULL, + maleParents=NULL, ignoreSexes=FALSE, simParam=NULL, nThreads=NULL){ + if(is.null(simParam)){ simParam = get("SP",envir=.GlobalEnv) } @@ -528,8 +650,34 @@ randCross2 = function(females,males,nCrosses,nProgeny=1, #' pop2 = self(pop, simParam=SP) #' #' @export -self = function(pop,nProgeny=1,parents=NULL,keepParents=TRUE, - simParam=NULL,nThreads=NULL){ +setGeneric( + "self", + function( + pop, nProgeny=1, parents=NULL, keepParents=TRUE, simParam=NULL, + nThreads=NULL){ + standardGeneric("self") + } +) + +#' @describeIn self Method for \code{\link{Pop-class}} +#' @export +setMethod( + "self", + signature(pop = "Pop"), + function( + pop, nProgeny=1, parents=NULL, keepParents=TRUE, simParam=NULL, + nThreads=NULL){ + .self_internal( + pop=pop, nProgeny=nProgeny, parents=parents, keepParents=keepParents, + simParam=simParam, nThreads = nThreads + ) + } +) + +# Internal implementation shared by self methods +#' @keywords internal +.self_internal = function( + pop,nProgeny=1,parents=NULL,keepParents=TRUE,simParam=NULL,nThreads=NULL){ if(is.null(simParam)){ simParam = get("SP",envir=.GlobalEnv) } @@ -639,8 +787,31 @@ self = function(pop,nProgeny=1,parents=NULL,keepParents=TRUE, #' pop2 = makeDH(pop, simParam=SP) #' #' @export -makeDH = function(pop,nDH=1,useFemale=TRUE,keepParents=TRUE, - simParam=NULL,nThreads=NULL){ +setGeneric( + "makeDH", + function( + pop,nDH=1,useFemale=TRUE,keepParents=TRUE,simParam=NULL,nThreads=NULL){ + standardGeneric("makeDH") + } +) + +#' @describeIn makeDH Method for \code{\link{Pop-class}} +#' @export +setMethod( + "makeDH", + signature(pop = "Pop"), + function( + pop,nDH=1,useFemale=TRUE,keepParents=TRUE,simParam=NULL,nThreads=NULL){ + .makeDH_internal( + pop=pop, nDH=nDH, useFemale=useFemale, keepParents=keepParents, + simParam=simParam, nThreads=nThreads) + } +) + +# Internal implementation shared by .makeDH_internal methods +#' @keywords internal +.makeDH_internal = function( + pop,nDH=1,useFemale=TRUE,keepParents=TRUE,simParam=NULL,nThreads=NULL){ if(is.null(simParam)){ simParam = get("SP",envir=.GlobalEnv) } @@ -756,7 +927,7 @@ sortPed = function(id, mother, father, maxCycle=100){ } } if(any(unsorted)){ - stop("Failed to sort pedigree, may contain loops or require a higher maxGen") + stop("Failed to sort pedigree, may contain loops or require a higher maxCycle") } return(output) } @@ -769,7 +940,7 @@ sortPed = function(id, mother, father, maxCycle=100){ #' #' @param founderPop a \code{\link{Pop-class}} #' @param id a vector of unique identifiers for individuals -#' in the pedigree. The values of these IDs are seperate from +#' in the pedigree. The values of these IDs are separate from #' the IDs in the founderPop if matchID=FALSE. #' @param mother a vector of identifiers for the mothers #' of individuals in the pedigree. Must match one of the diff --git a/R/phenotypes.R b/R/phenotypes.R index 0f4120f9..f329d87e 100644 --- a/R/phenotypes.R +++ b/R/phenotypes.R @@ -152,9 +152,50 @@ calcPheno = function(pop, varE, reps, p, traits, simParam=NULL){ #' pop = setPheno(pop, varE=1) #' #' @export -setPheno = function(pop, h2=NULL, H2=NULL, varE=NULL, corE=NULL, - reps=1, fixEff=1L, p=NULL, onlyPheno=FALSE, - traits=NULL, simParam=NULL){ +setGeneric( + "setPheno", + function( + pop, h2=NULL, H2=NULL, varE=NULL, corE=NULL, reps=1, fixEff=1L, p=NULL, + onlyPheno=FALSE, traits=NULL, simParam=NULL,...){ + standardGeneric("setPheno") + } +) + +#' @describeIn setPheno Method for \code{\link{Pop-class}} +#' @export +setMethod( + "setPheno", + signature(pop = "Pop"), + function( + pop, h2=NULL, H2=NULL, varE=NULL, corE=NULL, reps=1, fixEff=1L, p=NULL, + onlyPheno=FALSE, traits=NULL, simParam=NULL) { + .setPheno_internal( + pop=pop, h2=h2, H2=H2, varE=varE, corE=corE, reps=reps, fixEff=fixEff, + p=p, onlyPheno=onlyPheno, traits=traits, simParam=simParam + ) + } +) + +#' @describeIn setPheno Method for \code{\link{MultiPop-class}} objects +#' @export +setMethod( + "setPheno", + signature(pop = "MultiPop"), + function( + pop, h2=NULL, H2=NULL, varE=NULL, corE=NULL, reps=1, fixEff=1L, p=NULL, + onlyPheno=FALSE, traits=NULL, simParam=NULL) { + .setPheno_internal( + pop=pop, h2=h2, H2=H2, varE=varE, corE=corE, reps=reps, fixEff=fixEff, + p=p, onlyPheno=onlyPheno, traits=traits,simParam=simParam + ) + } +) + +# Internal implementation shared by all setPheno methods. +# @keywords internal +.setPheno_internal = function( + pop, h2=NULL, H2=NULL, varE=NULL, corE=NULL, reps=1, fixEff=1L, p=NULL, + onlyPheno=FALSE, traits=NULL, simParam=NULL) { if(is.null(simParam)){ simParam = get("SP",envir=.GlobalEnv) } @@ -315,9 +356,9 @@ setPheno = function(pop, h2=NULL, H2=NULL, varE=NULL, corE=NULL, #' SP$setVarE(varE = trtVarELog) #' pop = newPop(founderPop) #' popLarge = randCross(pop, nCrosses = 1000) -#' +#' #' meanVarFun = function(x) list(mean = mean(x), var = var(x)) -#' +#' #' #Latent phenotypes and parameters #' (phenoLog = pheno(pop)) #' phenoLogLarge = pheno(popLarge) @@ -339,7 +380,7 @@ setPheno = function(pop, h2=NULL, H2=NULL, varE=NULL, corE=NULL, #' cbind(phenoLog = phenoLog[, 1], #' phenoExpMeanLog0 = phenoExpMeanLog0, #' phenoExpMeanExp1 = phenoExpMeanExp1) -#' +#' #' tmp = cbind(phenoLog = phenoLogLarge[, 1], #' phenoExpMeanLog0 = c(asLogNormal(phenoLogLarge[, 1])), #' phenoExpMeanExp1 = c(asLogNormal(phenoLogLarge[, 1], meanlog = -trtVarPLog[1]/2))) @@ -357,12 +398,12 @@ setPheno = function(pop, h2=NULL, H2=NULL, varE=NULL, corE=NULL, #' try(asLogNormal(x = pheno(pop), meanlog = 0)) #' asLogNormal(x = pheno(pop), meanlog = c(0, 1)) #' asLogNormal(x = pheno(pop), meanlog = list(0, NULL)) -#' +#' #' #Store the recoded trait manually #' pheno(pop) #' pop@pheno[, 1] = asLogNormal(x = pheno(pop)[, 1]) #' pheno(pop) -#' +#' #' #Apply and store the transformation automatically via SimParam$finalizePop() #' SP$finalizePop = function(pop, simParam = SP) { #' pop@pheno[, 1] = asLogNormal(x = pheno(pop)[, 1]) @@ -481,12 +522,12 @@ asLogNormal <- function(x, meanlog = NULL) { #' p = list(c(0.5, 0.5), #' p), #' mean = trtMean, var = trtVarP) -#' +#' #' #Store the recoded trait manually #' pheno(pop) #' pop@pheno[, 1] = asCategorical(x = pheno(pop)[, 1]) #' pheno(pop) -#' +#' #' #Apply and store the transformation automatically via SimParam$finalizePop() #' SP$finalizePop = function(pop, simParam = SP) { #' pop@pheno[, 1] = asCategorical(x = pheno(pop)[, 1]) diff --git a/man/makeCross.Rd b/man/makeCross.Rd index 4dee9d31..8d1996eb 100644 --- a/man/makeCross.Rd +++ b/man/makeCross.Rd @@ -2,9 +2,12 @@ % Please edit documentation in R/crossing.R \name{makeCross} \alias{makeCross} +\alias{makeCross,Pop-method} \title{Make designed crosses} \usage{ makeCross(pop, crossPlan, nProgeny = 1, simParam = NULL, nThreads = NULL) + +\S4method{makeCross}{Pop}(pop, crossPlan, nProgeny = 1, simParam = NULL, nThreads = NULL) } \arguments{ \item{pop}{an object of \code{\link{Pop-class}}} @@ -27,6 +30,11 @@ Returns an object of \code{\link{Pop-class}} Makes crosses within a population using a user supplied crossing plan. } +\section{Functions}{ +\itemize{ +\item \code{makeCross(Pop)}: Method for \code{\link{Pop-class}} + +}} \examples{ #Create founder haplotypes founderPop = quickHaplo(nInd=10, nChr=1, segSites=10) diff --git a/man/makeCross2.Rd b/man/makeCross2.Rd index 721492ed..2829af4b 100644 --- a/man/makeCross2.Rd +++ b/man/makeCross2.Rd @@ -2,6 +2,7 @@ % Please edit documentation in R/crossing.R \name{makeCross2} \alias{makeCross2} +\alias{makeCross2,Pop,Pop-method} \title{Make designed crosses} \usage{ makeCross2( @@ -12,6 +13,15 @@ makeCross2( simParam = NULL, nThreads = NULL ) + +\S4method{makeCross2}{Pop,Pop}( + females, + males, + crossPlan, + nProgeny = 1, + simParam = NULL, + nThreads = NULL +) } \arguments{ \item{females}{an object of \code{\link{Pop-class}} for female parents.} @@ -36,6 +46,11 @@ Returns an object of \code{\link{Pop-class}} Makes crosses between two populations using a user supplied crossing plan. } +\section{Functions}{ +\itemize{ +\item \code{makeCross2(females = Pop, males = Pop)}: Method for \code{\link{Pop-class}} + +}} \examples{ #Create founder haplotypes founderPop = quickHaplo(nInd=10, nChr=1, segSites=10) diff --git a/man/makeDH.Rd b/man/makeDH.Rd index 46a649a8..90a95fab 100644 --- a/man/makeDH.Rd +++ b/man/makeDH.Rd @@ -2,6 +2,7 @@ % Please edit documentation in R/crossing.R \name{makeDH} \alias{makeDH} +\alias{makeDH,Pop-method} \title{Generates DH lines} \usage{ makeDH( @@ -12,6 +13,15 @@ makeDH( simParam = NULL, nThreads = NULL ) + +\S4method{makeDH}{Pop}( + pop, + nDH = 1, + useFemale = TRUE, + keepParents = TRUE, + simParam = NULL, + nThreads = NULL +) } \arguments{ \item{pop}{an object of 'Pop' superclass} @@ -36,6 +46,11 @@ Creates DH lines from each individual in a population. Only works with diploid individuals. For polyploids, use \code{\link{reduceGenome}} and \code{\link{doubleGenome}}. } +\section{Functions}{ +\itemize{ +\item \code{makeDH(Pop)}: Method for \code{\link{Pop-class}} + +}} \examples{ #Create founder haplotypes founderPop = quickHaplo(nInd=2, nChr=1, segSites=10) diff --git a/man/pedigreeCross.Rd b/man/pedigreeCross.Rd index 487944cd..3ef09c93 100644 --- a/man/pedigreeCross.Rd +++ b/man/pedigreeCross.Rd @@ -22,7 +22,7 @@ pedigreeCross( \item{founderPop}{a \code{\link{Pop-class}}} \item{id}{a vector of unique identifiers for individuals -in the pedigree. The values of these IDs are seperate from +in the pedigree. The values of these IDs are separate from the IDs in the founderPop if matchID=FALSE.} \item{mother}{a vector of identifiers for the mothers diff --git a/man/randCross.Rd b/man/randCross.Rd index d300e0a7..0af43d84 100644 --- a/man/randCross.Rd +++ b/man/randCross.Rd @@ -2,6 +2,7 @@ % Please edit documentation in R/crossing.R \name{randCross} \alias{randCross} +\alias{randCross,Pop-method} \title{Make random crosses} \usage{ randCross( @@ -14,6 +15,17 @@ randCross( simParam = NULL, nThreads = NULL ) + +\S4method{randCross}{Pop}( + pop, + nCrosses, + nProgeny = 1, + balance = TRUE, + parents = NULL, + ignoreSexes = FALSE, + simParam = NULL, + nThreads = NULL +) } \arguments{ \item{pop}{an object of \code{\link{Pop-class}}} @@ -39,8 +51,13 @@ Returns an object of \code{\link{Pop-class}} } \description{ A wrapper for \code{\link{makeCross}} that randomly -selects parental combinations for all possible combinantions. +selects parental combinations for all possible combinations. } +\section{Functions}{ +\itemize{ +\item \code{randCross(Pop)}: Method for \code{\link{Pop-class}} + +}} \examples{ #Create founder haplotypes founderPop = quickHaplo(nInd=10, nChr=1, segSites=10) diff --git a/man/randCross2.Rd b/man/randCross2.Rd index 608321be..ae0974e5 100644 --- a/man/randCross2.Rd +++ b/man/randCross2.Rd @@ -2,6 +2,7 @@ % Please edit documentation in R/crossing.R \name{randCross2} \alias{randCross2} +\alias{randCross2,Pop,Pop-method} \title{Make random crosses} \usage{ randCross2( @@ -16,6 +17,19 @@ randCross2( simParam = NULL, nThreads = NULL ) + +\S4method{randCross2}{Pop,Pop}( + females, + males, + nCrosses, + nProgeny = 1, + balance = TRUE, + femaleParents = NULL, + maleParents = NULL, + ignoreSexes = FALSE, + simParam = NULL, + nThreads = NULL +) } \arguments{ \item{females}{an object of \code{\link{Pop-class}} for female parents.} @@ -47,9 +61,14 @@ Returns an object of \code{\link{Pop-class}} } \description{ A wrapper for \code{\link{makeCross2}} that randomly -selects parental combinations for all possible combinantions between +selects parental combinations for all possible combinations between two populations. } +\section{Functions}{ +\itemize{ +\item \code{randCross2(females = Pop, males = Pop)}: Method for \code{\link{Pop-class}} + +}} \examples{ #Create founder haplotypes founderPop = quickHaplo(nInd=10, nChr=1, segSites=10) diff --git a/man/selectCross.Rd b/man/selectCross.Rd index 8baf6e90..a9aa2680 100644 --- a/man/selectCross.Rd +++ b/man/selectCross.Rd @@ -2,6 +2,7 @@ % Please edit documentation in R/crossing.R \name{selectCross} \alias{selectCross} +\alias{selectCross,Pop-method} \title{Select and randomly cross} \usage{ selectCross( @@ -19,6 +20,22 @@ selectCross( ..., balance = TRUE ) + +\S4method{selectCross}{Pop}( + pop, + nInd = NULL, + nFemale = NULL, + nMale = NULL, + nCrosses, + nProgeny = 1, + trait = 1, + use = "pheno", + selectTop = T, + simParam = NULL, + nThreads = NULL, + ..., + balance = TRUE +) } \arguments{ \item{pop}{an object of \code{\link{Pop-class}}} @@ -73,6 +90,11 @@ of intermediate populations created. This reduces RAM usage and simplifies code writing. Note that this wrapper does not provide the full functionality of either function. } +\section{Functions}{ +\itemize{ +\item \code{selectCross(Pop)}: Method for \code{\link{Pop-class}} + +}} \examples{ #Create founder haplotypes founderPop = quickHaplo(nInd=10, nChr=1, segSites=10) diff --git a/man/self.Rd b/man/self.Rd index 64df6ec9..05ad8332 100644 --- a/man/self.Rd +++ b/man/self.Rd @@ -2,6 +2,7 @@ % Please edit documentation in R/crossing.R \name{self} \alias{self} +\alias{self,Pop-method} \title{Self individuals} \usage{ self( @@ -12,6 +13,15 @@ self( simParam = NULL, nThreads = NULL ) + +\S4method{self}{Pop}( + pop, + nProgeny = 1, + parents = NULL, + keepParents = TRUE, + simParam = NULL, + nThreads = NULL +) } \arguments{ \item{pop}{an object of \code{\link{Pop-class}}} @@ -35,6 +45,11 @@ Returns an object of \code{\link{Pop-class}} Creates selfed progeny from each individual in a population. Only works when sexes is "no". } +\section{Functions}{ +\itemize{ +\item \code{self(Pop)}: Method for \code{\link{Pop-class}} + +}} \examples{ #Create founder haplotypes founderPop = quickHaplo(nInd=2, nChr=1, segSites=10) diff --git a/man/setPheno.Rd b/man/setPheno.Rd index aa3866e0..ba65e489 100644 --- a/man/setPheno.Rd +++ b/man/setPheno.Rd @@ -2,9 +2,40 @@ % Please edit documentation in R/phenotypes.R \name{setPheno} \alias{setPheno} +\alias{setPheno,Pop-method} +\alias{setPheno,MultiPop-method} \title{Set phenotypes} \usage{ setPheno( + pop, + h2 = NULL, + H2 = NULL, + varE = NULL, + corE = NULL, + reps = 1, + fixEff = 1L, + p = NULL, + onlyPheno = FALSE, + traits = NULL, + simParam = NULL, + ... +) + +\S4method{setPheno}{Pop}( + pop, + h2 = NULL, + H2 = NULL, + varE = NULL, + corE = NULL, + reps = 1, + fixEff = 1L, + p = NULL, + onlyPheno = FALSE, + traits = NULL, + simParam = NULL +) + +\S4method{setPheno}{MultiPop}( pop, h2 = NULL, H2 = NULL, @@ -93,6 +124,13 @@ breeding programs. In this case, varE is set to the plot error and reps is set to the number of plots per entry. The resulting phenotype represents the entry-means. } +\section{Functions}{ +\itemize{ +\item \code{setPheno(Pop)}: Method for \code{\link{Pop-class}} + +\item \code{setPheno(MultiPop)}: Method for \code{\link{MultiPop-class}} objects + +}} \examples{ #Create founder haplotypes founderPop = quickHaplo(nInd=10, nChr=1, segSites=10)