recode.geno(CGEN)
recode.geno()所属R语言包:CGEN
Recode a vector of genotypes
重新编码1基因型的向量
译者:生物统计家园网 机器人LoveR
描述----------Description----------
Recodes a vector of genotypes for a single SNP
重新编码为一个单一的SNP基因型向量
用法----------Usage----------
heter.codes=NULL, subset=NULL)
参数----------Arguments----------
参数:vec
Vector of genotypes. No default
基因型向量。没有默认
参数:in.miss
Vector of categories which denote missing values in vec. These categories will be changed to out.miss provided out.miss is not NULL. The default is " " (2 spaces).
矢量表示在vec遗漏值的类别。这些类别将改为out.miss提供out.miss是不是NULL。默认是“”(2位)。
参数:out.miss
New category for the missing values. Use NULL to keep the original missing values. The default is NA.
遗漏值的新的类别。使用NULL,以保持原有的缺失值。默认情况下是不适用。
参数:out.genotypes
Vector of length 3 containing the new genotypes. The first element is for the major homozygous genotype, the second element is for the heterozygous genotype, and the third is for the minor homozygous genotype. Use NULL for no recoding of the genotypes; only the missing values will be changed. The default is c(0, 1, 2).
长度为3向量的新的基因型。主要合子基因型的第一个元素,第二个元素是为杂合子基因型,第三是为未成年人的纯合基因型。使用NULL没有重新编码的基因型,唯一缺少的值将被改变。默认为C(0,1,2)。
参数:heter.codes
Vector of codes in vec used for the heterozygous genotype. If NULL, then it is assumed that the heterozygous genotype is of the form "AB", "Aa", "CT", etc (a 2-character string with different characters). The default is NULL.
在代码向量vec用于杂合子基因型。如果为NULL,那么它被认为杂合子基因型的形式是“AB公司”,“AA”,“CT”的,等(2个字符的字符串,用不同的字符)。默认值为NULL。
参数:subset
Logical vector of length length(vec) to be used in determining the major and minor homozygous genotypes. This option is useful for case-control studies where typically only the controls are used to determine the major and minor alleles. The default is NULL so that all (non-missing) elements of vec will be used.
线长度的逻辑向量(VEC),用于确定的主要和次要的纯合子基因型。此选项是有用的病例对照研究,通常只有控制被用来确定主要和次要等位基因。将用于使VEC所有元素(非丢失),默认值为NULL。
Details
详情----------Details----------
The input vector vec can be either character or numeric. If it is numeric, then heter.codes should be set. This function is useful if the input vector of genotypes is of the form (AA, AB, BB) and the standard (0, 1, 2) coding is desired, or vice-versa.
输入向量vec可以是字符或数字。如果它是一个数字,然后heter.codes应设置。这个功能是有用的,如果的基因型输入向量的形式(AA,AB和BB)和标准(0,1,2)编码所需,或反之亦然。
值----------Value----------
Vector of recoded genotypes.
矢量重新编码的基因型。
举例----------Examples----------
# CC is the major homozygous genotype[CC是主要的纯合基因型]
vec <- c("CC", "TT", "CC", "CT", "CT", "CC", " ", "TT", "CT", "CC")
vec2 <- as.integer(recode.geno(vec)$vec)
print(vec2)
# Get vec from vec2[从VEC2 VEC]
recode.geno(vec2, in.miss=NA, out.miss=" ", out.genotypes=c("CC", "CT", "TT"),
heter.codes=1)$vec
vec <- c("CC", "TT", "!!", "CT", "CT", "CC", "NA", "TT", "CT", "CC")
recode.geno(vec, in.miss=c("!!", "NA"))$vec
vec <- c(0, 2, -9, 1, 1, 0, -9, 2, 1, 0)
recode.geno(vec, in.miss=-9, heter.codes=1)$vec
vec <- c("C/C", "T/T", "C/C", "C/T", "C/T", "C/C", " / ", "T/T", "C/T", "C/C")
recode.geno(vec, in.miss=" / ", heter.codes="C/T")$vec
转载请注明:出自 生物统计家园网(http://www.biostatistic.net)。
注:
注1:为了方便大家学习,本文档为生物统计家园网机器人LoveR翻译而成,仅供个人R语言学习参考使用,生物统计家园保留版权。
注2:由于是机器人自动翻译,难免有不准确之处,使用时仔细对照中、英文内容进行反复理解,可以帮助R语言的学习。
注3:如遇到不准确之处,请在本贴的后面进行回帖,我们会逐渐进行修订。
|