## example1-----genotypeStat-----------
## import example data
# data(genotypeData)
## get the first line: affection state for samples
# data1=genotypeData[1,,drop=FALSE]
## get the second line: genotype data for a sepcifed snp
# data2=genotypeData[2,,drop=FALSE]
## Statistical allele and genotype frequency of the specified snp for case-control data.
# result=genotypeStat(data2,data1,fromCol=2,naString="?_?",sep="_")
# genotypeCount=result$genotypeCount
# alleleCount=result$alleleCount
## example2-----permuteGenotype-----------
## a matrix with 1 row
# dataLine=matrix(c("rs12","1","2","3","4","5"),nrow=1)
## permutate the elements of the matrix
# newData=permuteGenotype(dataLine=dataLine,fromCol=2)
## example3-----permuteGenotypeCount-----------
# newMatrix=permuteGenotypeCount(case_11=24,case_12=34,case_22=45,
# control_11=23,control_12=45,control_22=34,n=5)
## example4-----OR-----------
## OR(odd ratio) for the risk-allele
# ORvalue=OR(case_allele1=20,case_allele2=30,control_allele1=10,control_allele2=60)
## example5-----OR.TradPerm--------
## import example data
# data(genotypeData)
## get the first line: affection state for samples
# data1=genotypeData[1,,drop=FALSE]
## get the second line: genotype data for a sepcifed snp
# data2=genotypeData[2,,drop=FALSE]
# result1=OR.TradPerm(genotypeLine=data2,affectionLine=data1,fromCol=2,naString="?_?",
# sep="_",repeatNum=5)
# risk_allele=result1$risk_allele
# p=result1$pValue
# obsOR=result$OR
## example6-----OR.MCPerm----------
# OR.MCPerm(case_allele1=34,case_allele2=23,control_allele1=27,control_allele2=45,repeatNum=5)
## example7-----Armitage-------
# Armitage(case_11=23,case_12=45,case_22=12,control_11=27,control_12=12,control_22=45)
## example8-----Armitage.TradPerm-----
## import example data
# data(genotypeData)
## get the first line: affection state for samples
# data1=genotypeData[1,,drop=FALSE]
## get the second line: genotype data for a sepcifed snp
# data2=genotypeData[2,,drop=FALSE]
# Armitage.TradPerm(genotypeLine=data2,affectionLine=data1,
# fromCol=2,naString="?_?",sep="_",repeatNum=1000)
## example9----Armitage.MCPerm--------
# Armitage.MCPerm(case_11=23,case_12=45,case_22=12,
# control_11=27,control_12=12,control_22=45,repeatNum=1000)
## example10---chisq.TradPerm---------
## import example data
data(genotypeData)
## get the first line: affection state for samples
# data1=genotypeData[1,,drop=FALSE]
## get the second line: genotype data for a sepcifed snp
# data2=genotypeData[2,,drop=FALSE]
# chisq.TradPerm(genotypeLine=data2,affectionLine=data1,
# fromCol=2,naString="?_?",sep="_",repeatNum=1000)
## example11---chisq.MCPerm--------
# case_11=23
# case_12=45
# case_22=12
# control_11=27
# control_12=12
# control_22=45
# chisq.MCPerm(23,45,12,27,12,45,repeatNum=5)
## example12---fisher.TradPerm------
# import example data
# data(genotypeData)
## get the first line: affection state for samples
# data1=genotypeData[1,,drop=FALSE]
## get the second line: genotype data for a sepcifed snp
# data2=genotypeData[2,,drop=FALSE]
# fisher.TradPerm(genotypeLine=data2,affectionLine=data1,
# fromCol=2,naString="?_?",sep="_",repeatNum=5)
## example13---fisher.MCPerm-------
#fisher.MCPerm(23,45,12,27,12,45,repeatNum=5)
Run the code above in your browser using DataLab