RandomGenotype
指定マーカーについて、アレルとそのアレル頻度情報から、HWEに基づき、指定人数分ぷジェノタイプを作成する
Gpool<-RandomGenotype(Np,NL,Alleles,Probs)
RandomGenotype<-function(N,n,Alleles,Probs){
ns<-N
g<-array(0,c(ns,2,n))
noparents<-1:ns
for(i in noparents){
for(j in 1:n){
g[i,,j]<-sample(Alleles[[j]],2,replace=TRUE,Probs[[j]])
}
}
g
}
\name{RandomGenotype}
\alias{RandomGenotype}
%- Also NEED an '\alias' for EACH other topic documented here.
\title{
RandomGenotype
}
\description{
指定マーカーについて、アレルとそのアレル頻度情報から、HWEに基づき、指定人数分ぷジェノタイプを作成する。シミュレーションのため。
}
\usage{
Gpool<-RandomGenotype(Np,NL,Alleles,Probs)
}
\arguments{
\item{Np}{人数}
\item{NL}{マーカー数}
\item{Alleles}{アレル名のベクトルのリスト}
\item{Probs}{アレル頻度のベクトルのリスト}
}
%- maybe also 'usage' for other objects documented here.
\details{
%% ~~ If necessary, more details than the description above ~~
}
\value{
ディプロタイプを表す、3次元アレイ(人数x2xマーカー数)
}
\references{
%% ~put references to the literature/web site here ~
}
\author{
%% ~~who you are~~
}
\note{
%% ~~further notes~~
}
%% ~Make other sections like Warning with \section{Warning }{....} ~
\seealso{
}
\examples{
NL<-15
AandP<-MakeAlleleProb(NL=NL)
Alleles<-AandP$Alleles
Probs<-AandP$Probs
Np<-3
Gpool<-RandomGenotype(Np,NL,Alleles,Probs)
}