sm2ped(GGtools)
sm2ped()所属R语言包:GGtools
create a data.frame representing a PED file (MACH) from a SnpMatrix instance
创建一个数据框代表从SnpMatrix实例1 PED的文件(马赫)
译者:生物统计家园网 机器人LoveR
描述----------Description----------
create a data.frame representing a PED file (MACH) from a SnpMatrix instance
创建一个数据框代表从SnpMatrix实例1 PED的文件(马赫)
用法----------Usage----------
sm2ped(sm, snpsupp, missing.code = "N", family, person, father, mother, sex)
参数----------Arguments----------
参数:sm
SnpMatrix-class instance
SnpMatrix-class实例
参数:snpsupp
data frame of 'supporting' metadata as returned by read.HapMap.data
read.HapMap.data返回支持元数据的数据框
参数:missing.code
token to use for missing genotype
令牌使用缺少的基因型
参数:family
vector of family identifiers as used in PED files for MACH
家庭标识符作为向量使用PED的文件马赫数
参数:person
vector of person identifiers
向量的人标识符
参数:father
each element of this vector specifies the father of the person identified on the same line of the file
此向量中的每个元素指定文件的同一行上确定的人的父亲
参数:mother
as for father
father
参数:sex
1 for male, 2 for female
1为男,女2
Details
详情----------Details----------
basic purpose is to convert SnpMatrix instances to PED to allow genotype imputation
基本目的是转换SnpMatrix实例PED认证,以允许基因型归集
值----------Value----------
a data.frame instance
数据框实例
举例----------Examples----------
if (.Platform$OS.type == "unix") { # can't get pathname in windows?[不能在Windows的路径?]
library(snpStats)
sm = chopsticks::read.HapMap.data(paste("file://",
system.file("hapmap/smallc20CEU.txt.gz", package="GGtools"), sep=""))
supp = sm[[2]]
smat = sm[[1]]
reldata = read.table(system.file("hapmap/relationships_w_pops_051208.txt",
package="GGtools"), header=TRUE)
rownames(reldata) = as.character(reldata[,2])
hids = rownames(smat)
hrel = reldata[hids,]
hrel[1:5,]
args(sm2ped)
ac = as.character
ss = sm2ped(smat, supp, fam=ac(hrel[,1]), person=ac(hrel[,2]), father=ac(hrel[,3]),
mother=ac(hrel[,4]), sex=hrel[,5])
ss[1:5,1:8]
}
转载请注明:出自 生物统计家园网(http://www.biostatistic.net)。
注:
注1:为了方便大家学习,本文档为生物统计家园网机器人LoveR翻译而成,仅供个人R语言学习参考使用,生物统计家园保留版权。
注2:由于是机器人自动翻译,难免有不准确之处,使用时仔细对照中、英文内容进行反复理解,可以帮助R语言的学习。
注3:如遇到不准确之处,请在本贴的后面进行回帖,我们会逐渐进行修订。
|