Description Usage Arguments Details Value Note References Examples
Function transforms the genetic marker to recessive, dominant or codominant mode.
1 | GenoCod_Gen(data, MA, genotyp, Method, var.nam = NULL, na.rm = FALSE)
|
data |
Data frame of the database |
MA |
Minor allele name in the database |
genotyp |
Genotype name in the database |
Method |
The method to use |
var.nam |
Name of the new variable, by default the name is |
na.rm |
TRUE, the function conserves the missing data and FALSE, it suppresses the individuals, which have the missing data. |
Function that transforms the genetic marker according to the mode ("recessive", "dominant", "co-dominant") and assess the allele minor frequency under Hardy Weinberg equilibrium of the target population.
Return a list containing
datR |
Data frame with the new variable |
MA.frq |
Minor allele frequency |
We use the documentation of the site below to code the genetic markers in "Dominant", "Recessive" and "codominant" mode.
http://wims.unice.fr/wims/wims.cgi?module=U1/genetics/docpopulation.fr
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 | # Example : Genotype data
set.seed(123000)
snp1 <- c("aaAA","AA:aA","Aa/AA","aa/AA","aA/aa","Aa/Aa","AA/Aa","AA/Aa","AA/Aa",NA)
snp2 <- c("Aa/aA","Aa/AA","AA/aa","AA/aA","AA/Aa","Aa,AA","AA/AA","AA/aA","Aa/aa","")
datD<-NULL
for(u in 1:10){
SNP1<-sample(snp1)
SNP2<-sample(snp2)
var1 <- runif(length(snp1))
pheno<- rbinom(length(snp1),c(0,1),prob=c(0.65,0.35))
pheno[sample(1:length(snp1))[3]]<-NA
id<-c(1:length(snp1))
id.fam<-rep(u,length(snp1))
tabGen1<-data.frame(id.fam,id,SNP1,SNP2,var1,pheno)
datD<-rbind(datD,tabGen1)
}
# Result
head(datD)
# Example of the using GenoCod_Gen
# 'a' is the minor allele, method "recessive" the new name is X2
datT1<-GenoCod_Gen(datD,"a","SNP2",Method=c("recessive"),var.nam="X2")
head(datT1$datR)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.