找回密码
 注册
查看: 422|回复: 0

R语言 scrime包 simulateSNPs()函数中文帮助文档(中英文对照)

[复制链接]
发表于 2012-9-29 23:05:02 | 显示全部楼层 |阅读模式
simulateSNPs(scrime)
simulateSNPs()所属R语言包:scrime

                                        Simulation of SNP data
                                         模拟SNP数据

                                         译者:生物统计家园网 机器人LoveR

描述----------Description----------

Simulates SNP data, where a specified proportion of cases and controls is explained by specified set of SNP interactions. Can also be used to simulate a data set with a multi-categorical response, i.e.\ a data set in which the cases are divided into several classes (e.g., different diseases or subtypes of a disease).
模拟SNP数据,其中病例组和对照组的解释是指定的一组SNP相互作用的特定比例。也可用于模拟与多分类响应一个数据集,例如\一个数据集,在该情况下被分为几类(例如,不同的一种疾病的疾病或亚型)。


用法----------Usage----------


simulateSNPs(n.obs, n.snp, vec.ia, prop.explain = 1,
  list.ia.val = NULL, vec.ia.num = NULL, vec.cat = NULL,
  maf = c(0.1, 0.4), prob.val = rep(1/3, 3), list.equal = NULL,
  prob.equal = 0.8, rm.redundancy = TRUE, shuffle = FALSE,
  shuffle.obs = FALSE, rand = NA)



参数----------Arguments----------

参数:n.obs
either an integer specifying the total number of  observations, or a vector of length 2 specifying the number  of cases and the number of controls. If vec.cat is specified, then the partitioning of the number of cases to the different classes can be governed by vec.ia.num. If n.obs is an integer, then 1 / c of the observations will be controls and the remaining observations will be cases, where c is the total number of groups (including the controls).
无论是一个整数,指定总数的意见,或一个矢量的长度为2的情况下,指定的控件的数量。如果vec.cat指定的分区数的情况下,对不同类别可以受vec.ia.num。 n.obs如果是一个整数,那么1 / c的意见,将控制和其余的意见的情况,其中c组(包括对照组)的总数。


参数:n.snp
integer specifying the number of SNPs.
整数,指定数量的单核苷酸多态性。


参数:vec.ia
a vector of integers specifying the orders of the interactions that explain the cases. c(3,1,2,3), e.g., means that a three-way, a one-way (i.e. just a SNP), a two-way, and a three-way interaction explain the cases.
的向量整数指定订单的相互作用来解释的情况下,。 c(3,1,2,3),例如,表示一个三路,一个单向(即只的SNP),一个双向的,和解释的情况下,一个三通相互作用。


参数:prop.explain
either an integer or a vector of length(vec.ia)  specifying the proportions of cases explained by the interactions of interest among all observation having the interaction of interest. Must be larger than 0.5. E.g., prop.explain = 1 means that only cases have the interactions of interest specified by vec.ia (and list.ia.val). E.g., vec.ia = c(3, 2) and prop.explain = c(1, 0.8) means that only cases have the three-way interaction of interest, while 80% of the observations having the two-way interaction of interest are cases, and 20% are controls.
一个整数或者是一个向量length(vec.ia)指定比例的情况下,所有的观察兴趣,有兴趣的相互作用的相互作用的解释。必须大于0.5。例如,prop.explain = 1是指,只是情况有感兴趣的相互作用指定的vec.ia(list.ia.val“)。例如,vec.ia = c(3, 2)和prop.explain = c(1, 0.8)是指,只有三方互动的兴趣,而80%的意见,双向互动的利益的情况下,20%的控制。


参数:list.ia.val
a list of length(vec.ia) specifying the exact interactions. The objects in this list must be vectors of length vec.ia[i], and consist of the values 0 (for homozygous reference), 1 (heterozygous variant), or 2 (homozygous variant). E.g., vec.ia = c(3, 2) and list.ia.val = list(c(2, 0, 1), c(0, 2))  and prob.equal = 1 (see also list.equal) means that ((SNP1 == 2) \& (SNP2 == 0) \& (SNP3 == 1)) and ((SNP4 == 0) \& (SNP5 == 2)) are the explanatory interactions (if additionally prob.equal = 1; see also list.equal). If NULL, the genotypes are randomly drawn using the probabilities given by prob.val.
的列表length(vec.ia)指定的精确相互作用。在该列表中的对象必须是向量的长度vec.ia[i],并包括的值0(纯合子参考),1(杂合子变种),或2(纯合子变种)。例如,vec.ia = c(3, 2)和list.ia.val = list(c(2, 0, 1), c(0, 2))和prob.equal = 1(参见list.equal)((SNP1 == 2)\&(SNP2 == 0)\&( SNP3 == 1))和((SNP4 == 0)\&(SNP5 == 2))是解释性的相互作用(如果附加prob.equal = 1;又见list.equal)。如果NULL,基因型中随机抽取使用概率的prob.val。


参数:vec.ia.num
a vector of length(vec.ia) specifying the number of cases (not observations) explained by the interactions in vec.ia. If NULL, all the cases are divided into length(vec.ia) groups of about the same size. sum(vec.ia.num) must be smaller than or equal to the total number of cases. Each entry of vec.ia.num must currently be >= 10.
的向量length(vec.ia)指定的数量的情况下(没有意见)解释的相互作用在vec.ia。如果NULL,所有病例分为length(vec.ia)组大小相同的。 sum(vec.ia.num)必须小于或等于总数的情况下。每个条目的vec.ia.num当前必须> = 10。


参数:vec.cat
a vector of the same length of vec.ia specifying the subclasses of the cases that are explained by the corresponding interaction in vec.ia. If NULL, no subclasses will be considered. This feature is currently not fully tested. So be careful if specifying vec.cat.
相同长度的vec.ia指定的子类进行说明的情况下,由相应的相互作用在vec.ia的向量。如果NULL,将被视为没有子类。此功能目前没有充分的测试。所以,要小心如果指定vec.cat。


参数:maf
either an integer, or a vector of length 2 or n.snp specifying the minor allele frequencies. If an integer, all SNPs will have the same minor allele frequency. If a vector of length n.snp, each SNP will have the minor allele frequency specified in the corresponding entry of maf. If length 2, then maf is interpreted as the range of the minor allele frequencies, and for each SNP, a minor allele frequency will be randomly drawn from a uniform distribution with  the range given by maf. Note: If a SNP belongs to an explanatory interaction, then only the set of observations not explained by this interaction will have the minor allele frequency specified by maf.
一个整数,或向量的长度为2或n.snp指定的次要等位基因频率。如果一个整数,所有SNP将具有相同的次要等位基因频率。如果一个向量的长度n.snp,每个SNP有轻微的等位基因频率在相应的条目,maf。如果长度为2,那么maf被解释为次要等位基因频率的范围,并为每个SNP,未成年人的等位基因频率从均匀分布的maf给定范围内随机抽取。注:如果一个SNP属于解释性的互动,那么只有一组的观测不能解释它们之间的相互作用,将有指定的maf次要等位基因频率。


参数:prob.val
a vector consisting of the probabilities for drawing a 0, 1, or 2, if list.ia.val = NULL, i.e.\ if the genotypes of the SNPs explaining the case-control status should be randomly drawn. Ignored if list.ia.val is specified. By default, each genotype has the same probability of being drawn.
用于绘制一个0,1,或2,如果list.ia.val = NULL,即\如果的单核苷酸多态性的基因型,说明的情况下,控制状态应随机抽取的概率组成的向量中。如果忽略list.ia.val指定。默认情况下,每个基因具有相同的概率被抽。


参数:list.equal
list of same structure as list.ia.val containing only ones and zeros, where a 1 specifies the equality to the corresponding value in list.ia.val, and a 0 specifies the non-equality. Thus, the entries of list.equal specify if the corresponding SNP should be of a particular genotype (when the entry is 1) or should be not of this genotype (when entry is 0). If NULL, this list will be generated automatically using prob.equal. If, e.g., vec.ia = c(3, 2), list.ia.val = list(c(2, 0, 1), c(0, 2)), and list.equal = list(c(1, -1, 1), c(1, -1)), then the explanatory interactions are given by ((SNP1 == 2) \& (SNP2 != 0) \& (SNP3 == 1)) and ((SNP4 == 0) \& (SNP5 != 2))
列表相同的结构list.ia.val只包含1和0,其中1中的相应值list.ia.val指定的平等,0指定的非平等。因此,条目list.equal指定如果相应的SNP应该是一个特定的基因型(当输入项1),或不应该是这个基因型(条目为0时)。如果NULL,这个名单将自动生成使用prob.equal。如果,例如,vec.ia = c(3, 2),list.ia.val = list(c(2, 0, 1), c(0, 2))和list.equal = list(c(1, -1, 1), c(1, -1)),然后解释相互作用给出的((SNP1 == 2)\(SNP2!= 0)\&( SNP3 == 1))和((SNP4 == 0)\&(SNP5!= 2))


参数:prob.equal
a numeric value specifying the probability that a 1 is drawn when generating list.equal. prob.equal is thus the probability for an equal sign.
指定一个数值的概率为1时产生list.equal绘制。 prob.equal是的概率等号的。


参数:rm.redundancy
should redundant SNPs be removed from the explaining interactions? It is possible that one specify an explaining i-way interaction, but an interaction between (i-1) of the variables contained in the i-way interaction already explains all the cases (and controls) that the i-way interaction should explain. In this case, the redundant SNP is removed if rm.redundancy = TRUE.
应被删除多余的单核苷酸多态性的解释相互作用?这可能是一个指定一个说明i-双向交互,但之间的相互作用(i-1)在i包含的变量-相互作用已经解释了所有的情况下(和控制)的方式应该解释i双向互动。在这种情况下,如果除去冗余SNPrm.redundancy = TRUE。


参数:shuffle
logical. By default, the first sum(vec.ia) columns of the generated data set contain the explanatory SNPs in the same order as they appear in this data set. If TRUE, this order will be shuffled.
逻辑。默认情况下,第一个sum(vec.ia)列生成的数据集包含的解释以相同的顺序,因为它们出现在这组数据的单核苷酸多态性。如果TRUE,此订单将被打乱。


参数:shuffle.obs
should the observations be shuffled?
观测洗牌?


参数:rand
integer. Sets the random number generator in a reproducible state.
整数。随机数发生器设置在可再现的状态。


值----------Value----------

An object of class simulatedSNPs composed of <table summary="R valueblock"> <tr valign="top"><td>data</td> <td> a matrix with n.obs rows and n.snp columns containing the SNP data.</td></tr> <tr valign="top"><td>cl</td> <td> a vector of length n.obs comprising the case-control status of the observations.</td></tr> <tr valign="top"><td>tab.explain</td> <td> a table naming the explanatory interactions and the numbers of cases and controls explained by them.</td></tr> <tr valign="top"><td>ia</td> <td> character vector naming the interactions.</td></tr> <tr valign="top"><td>maf</td> <td> vector of length n.snp containing the minor allele frequencies.</td></tr> </table>
类的一个对象simulatedSNPs组成的<table summary="R valueblock"> <tr valign="top"> <TD> data</ TD> <td>一个矩阵n.obs的行和n.snp列包含的SNP数据。</ TD> </ TR> <tr valign="top"> <TD>cl </ TD> <td>一个向量的长度 n.obs包括的意见的情况下控制状态。</ TD> </ TR> <tr valign="top"> <TD>tab.explain</ TD> <td>一个表命名的解释互动和病例组和对照组的数字解释。</ TD> </ TR> <tr valign="top"> <TD>ia </ TD> <TD>字符向量命名的相互作用。 / TD> </ TR> <tr valign="top"> <TD> maf </ TD> <TD>向量的长度n.snp包含次要等位基因频率。</ TD> </ TR> </ TABLE>


注意----------Note----------

Currently, the genotypes of all SNPs are simulated independently from each other
目前,所有SNP的基因型是彼此独立地模拟


(作者)----------Author(s)----------


Holger Schwender <a href="mailto:holger.schwender@udo.edu">holger.schwender@udo.edu</a>



参见----------See Also----------

simulateSNPglm, simulateSNPcatResponse
simulateSNPglm,simulateSNPcatResponse


实例----------Examples----------


# Simulate a data set containing 2000 observations (1000 cases[模拟一个数据集,其中包含2000的意见(1000例]
# and 1000 controls) and 50 SNPs, where one three-way and two [和1000名对照)和50个SNP位点,其中一个三路和2]
# two-way interactions are chosen randomly to be explanatory [的双向互动是随机选取的,是解释]
# for the case-control status.[的情况下控制状态。]

sim1 <- simulateSNPs(2000, 50, c(3, 2, 2))
sim1

# Simulate data of 1200 cases and 800 controls for 50 SNPs, [模拟数据为1200例和800控制的50个SNPs,]
# where 90% of the observations showing a randomly chosen [其中示出一个随机选择的90%的观测值]
# three-way interaction are cases, and 95% of the observations [三通相互作用的情况下,和95%的观察]
# showing a randomly chosen two-way interactions are cases.[显示一个随机选择的双向互动的情况。]

sim2 <- simulateSNPs(c(1200, 800), 50, c(3, 2),
   prop.explain = c(0.9, 0.95))
sim2

# Simulate a data set consisting of 1000 observations and 50 SNPs,[模拟数据集由1000个观测和50个SNP位点,]
# where the minor allele frequency of each SNP is 0.25, and[每个SNP的次要等位基因频率为0.25,且]
# the interactions [的相互作用]
# ((SNP1 == 2) &amp; (SNP2 != 0) &amp; (SNP3 == 1))   and [((SNP1 == 2)&(SNP2!= 0)&(SNP3 == 1))和]
# ((SNP4 == 0) &amp; (SNP5 != 2))[((SNP4 == 0)&(SNP5!= 2))]
# are explanatory for 200 and 250 of the 500 cases, respectively,[说明分别为500例,200和250,]
# and for none of the 500 controls.[并没有500控制。]

list1 <- list(c(2, 0, 1), c(0, 2))
list2 <- list(c(1, 0, 1), c(1, 0))
sim3 <- simulateSNPs(1000, 50, c(3, 2), list.ia.val = list1,
    list.equal = list2, vec.ia.num = c(200, 250), maf = 0.25)



转载请注明:出自 生物统计家园网(http://www.biostatistic.net)。


注:
注1:为了方便大家学习,本文档为生物统计家园网机器人LoveR翻译而成,仅供个人R语言学习参考使用,生物统计家园保留版权。
注2:由于是机器人自动翻译,难免有不准确之处,使用时仔细对照中、英文内容进行反复理解,可以帮助R语言的学习。
注3:如遇到不准确之处,请在本贴的后面进行回帖,我们会逐渐进行修订。
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

手机版|小黑屋|生物统计家园 网站价格

GMT+8, 2024-11-30 00:33 , Processed in 0.071517 second(s), 15 queries .

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表