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

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

[复制链接]
发表于 2012-2-25 21:21:43 | 显示全部楼层 |阅读模式
assocTestRegression(GWASTools)
assocTestRegression()所属R语言包:GWASTools

                                        Association tests
                                         协会测试

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

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

This function performs regression based association tests.  It also performs genotype counts for association tests.
此功能执行回归基于关联测试。它还执行关联测试的基因型计数。


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


assocTestRegression(genoData, outcome, model.type,
                                        covar.list = NULL, ivar.list = NULL,
                    gene.action.list = NULL,
                    scan.chromosome.filter = NULL,
                    scan.exclude = NULL, CI = 0.95,
                    robust = FALSE, geno.counts = TRUE,
                    chromosome.set = NULL, block.set = NULL,
                    block.size = 5000, verbose = TRUE,
                    outfile = NULL)



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

参数:genoData
GenotypeData object, should contain phenotypes and covariates in scan annotation
GenotypeData对象,应包含在扫描注释的表型和协


参数:outcome
Vector (of length equal to the number of models) of names of the outcome variables for each model. These names must be in the scan annotation of genoData. e.g. c("case.cntl.status", "blood.pressure") will use "case.cntl.status" as the outcome for the first model and "blood pressure" for the second. Outcome variables must be coded as 0/1 for logistic regression.  
矢量(长度等于模型)每个模型的结果变量的名称。这些名称必须在扫描genoData注解。例如C(“case.cntl.status”,“blood.pressure”)将使用“case.cntl.status”第一模式和第二个“血压”的结果。 logistic回归结果变量必须被编码为0/1。


参数:model.type
vector (of length equal to the number of models) with the types of models to be fitted.   The elements should be one of: "logistic", "linear", or "poisson".  e.g. c("logistic", "linear") will perform two tests:  the first using logistic regression, and the second using linear regression.
矢量(长度等于模型)模型要安装的类型。的元素之一,应该是:“MF”,“线性”,或“泊松”。例如C(“MF”,“线性”)将执行两项测试:首先使用Logistic回归,采用线性回归的第二个。


参数:covar.list
list (of length equal to the number of models) of vectors containing the names of covariates to be used  in the regression model (blank, i.e. "" if none).  The default value is NULL and will include no covariates in any of the models. The covariate names must be in the scan annotation of genoData. e.g.    covar.list() <- list();   covar.list[[1]] <- c("age","sex");   covar.list[[2]] <- c("");    will use both "age" and "sex" as covariates for the first model and no covariates for the second model (this regresses on only the genotype).
向量含有协变量在回归模型中使用的名称(空白,即“”如果没有)名单(长度等于模型)。默认值是NULL“将包括在任何型号没有变项。协变量的名称必须是在扫描genoData注解。例如   covar.list() <- list();   covar.list[[1]] <- c("age","sex");   covar.list[[2]] <- c("");   将使用两个“年龄”和“性”作为第一个模型的协变量和第二种模式没有变项(这是倒退,只有基因型)。


参数:ivar.list
list (of length equal to the number of models) of vectors containing the names of covariates for which to include an  interaction with genotype (blank, i.e. "" if none).  The default value is NULL and will include no interactions in any of the models. The covariate names must be in the scan annotation of genoData. e.g.    ivar.list() <- list();   ivar.list[[1]] <- c("sex");   ivar.list[[2]] <- c("");    will include a genotype*"sex" interaction term for the first model and no interactions for the second model.
向量含有协变量的名称列表(长度等于模型的数量),其中包括与基因型的相互作用(空白,即“如果没有)。默认值是NULL“将包括任何型号的无相互作用。协变量的名称必须是在扫描genoData注解。例如   ivar.list() <- list();   ivar.list[[1]] <- c("sex");   ivar.list[[2]] <- c("");   将包括基因型*“性”的第一个模型交互项和第二个模型中没有相互作用。


参数:gene.action.list
a list (of length equal to the number of models) of vectors containing the types of gene action models  to be used in the corresponding regression model.  Valid options are "additive", "dominant", and "recessive", referring to how  the minor allele is treated, as well as "dominance". "additive" coding sets the marker variable for homozygous minor allele samples = 2, heterozygous samples = 1,  and homozygous major allele samples = 0. "dominant" coding sets the marker variable for homozygous minor allele samples = 2, heterozygous samples = 2,  and homozygous major allele samples = 0. "recessive" coding sets the marker variable for homozygous minor allele samples = 2, heterozygous samples = 0,  and homozygous major allele samples = 0. "dominance" coding sets the marker variable for homozygous minor allele samples = major allele frequency, heterozygous samples = 0,  and homozygous major allele samples = minor allele frequency. This coding eliminates the additive component of variance for the  marker variable, leaving only the dominance component of variance. The default value is NULL, which assumes only an "additive" gene action model for every test. e.g.    gene.action.list() <- list();   gene.action.list[[1]] <- c("additive");   gene.action.list[[2]] <- c("dominant", "recessive");    will run the first model using "additive" gene action, and will run the second model using both "dominant" and "recessive" gene actions.
一个含有基因行为模式进行相应的回归模型中使用的类型的向量列表(长度等于模型)。有效的选项是“添加剂”,“显性”和“隐性”,指如何对待未成年人的等位基因,以及“主导地位”。 “添加剂”的编码设置为次要等位基因纯合子样本= 2,杂合子样本= 1,纯合子等位基因样本= 0的标记变量。 “主导”的编码设置为次要等位基因纯合子样本= 2,杂合子样品= 2,纯合子等位基因样本= 0的标记变量。 “隐性”的编码设置为次要等位基因纯合子样本= 2,杂合子样品= 0,而纯合子等位基因样本= 0的标记变量。 “显性”编码设置次要等位基因为纯合子样本=主要的等位基因频率,杂合子样品= 0,合子的主要等位基因样本=次要等位基因频率的标记变量。消除此编码标记变量的方差添加剂成分,只剩下方差的优势组件。默认值是的NULL,它假定只有一个“添加剂”基因为每个测试动作模型。例如   gene.action.list() <- list();   gene.action.list[[1]] <- c("additive");   gene.action.list[[2]] <- c("dominant", "recessive");   运行的第一款车型使用的“添加剂”的基因作用,将运行第二个模型,用两个“霸主”和“隐性”基因行动。


参数:scan.chromosome.filter
a logical matrix that can be used to exclude some chromosomes, some scans, or some specific scan-chromosome pairs. Entries should be TRUE if that scan-chromosome pair should be included in the analysis, FALSE if not. The number of rows must be equal to the number of scans in genoData, and the number of columns must be equal to the largest integer chromosome value in genoData. The column number must match the chromosome number. e.g. A scan.chromosome.filter matrix used for an analyis when genoData has SNPs with chromosome=(1-24, 26, 27) (i.e. no Y (25) chromosome SNPs) must have 27 columns (all FALSE in the 25th column). But a scan.chromosome.filter matrix used for an analysis genoData has SNPs chromosome=(1-26) (i.e no Unmapped (27) chromosome SNPs) must have only 26 columns.
逻辑矩阵,可以用来排除一些染色体,一些扫描,或某些特定的扫描对染色体。参赛作品必须是TRUE如果扫描染色体配对应包含在分析中,FALSE如果不是。行数必须等于扫描genoData的数量,列数必须等于最大的genoData整数染色体价值。列数必须匹配的染色体数目。例如一个scan.chromosome.filter矩阵1 analyis使用时genoData有个SNPs与染色体=(1-24,26,27)(即没有Y(25)染色体单核苷酸多态性)必须有27列(所有的<X >在第25列)。但是,scan.chromosome.filter矩阵分析“FALSE有个SNPs染色体=(1-26)(即没有未映射(27)染色体单核苷酸多态性)必须有只有26列。


参数:scan.exclude
an integer vector containing the IDs of entire scans to be excluded.
整数向量,包含整个扫描的ID被排除在外。


参数:CI
sets the confidence level for the confidence interval calculations.  Confidence intervals are computed at every SNP; for the odds ratio when using logistic regression, and for the linear trend parameter when using linear regression. The default value is 0.95 (i.e. a 95% confidence interval). The confidence level must be between 0 and 1.
设置置信水平的置信区间的计算。置信区间计算在每一个SNP;采用logistic回归时的胜算比,使用线性回归时的线性趋势参数。默认值是0.95(即95%置信区间)。必须是介于0和1的置信水平。


参数:robust
logical for whether to use sandwich-based robust standard errors.  The default value is FALSE, and uses model based standard errors.
逻辑是否使用夹心基于稳健标准误差。默认值是FALSE,采用基于模型的标准误差。


参数:geno.counts
if TRUE (default), genotype counts are computed for each linear or logistic model. For linear models, counts are performed over all samples; for logistic models, counts are performed separately for cases and controls.  
如果TRUE(默认),基因型数为每线性或logistic模型计算。对于线性模型,对所有样品进行计数,logistic模型,病例组和对照组分别进行计数。


参数:chromosome.set
integer vector with chromosome(s) to be analyzed.  Use 23, 24, 25, 26, 27 for X, XY, Y, M, Unmapped respectively.
整数向量与染色体(S)进行分析。使用的X,XY,Y,M 23,24,25,26,27分别为未映射。


参数:block.set
list (of length equal to length(chromosome.set)) of vectors where every vectors contains the indices of the  SNP blocks (on that chromosome) to be analyzed. e.g. chromosome.set <- c(1,2); block.set <- list(); chr.1 <- c(1,2,3);   chr.2 <- c(5,6,7,8); block.set$chr.1 <- chr.1; block.set$chr.2 <- chr.2; will analyze first three block on chromosome 1 and 5th through 8th  blocks on chromosome 2. The actual number of SNPs analyzed will depend on block.size.  Default value is NULL. If block.set == NULL, all the SNPs on chromosomes in chromosome.set will be analyzed.  
列表(长度等于length(chromosome.set))每向量包含的SNP块指数(即染色体)进行分析的向量。例如chromosome.set <- c(1,2); block.set <- list(); chr.1 <- c(1,2,3);   chr.2 <- c(5,6,7,8); block.set$chr.1 <- chr.1; block.set$chr.2 <- chr.2;将分析前三个1号染色体上,并通过2号染色体上的8块5块。实际数量的SNPs分析,将取决于block.size。默认值是NULL。如果block.set == NULL,所有染色体在chromosome.set中的单核苷酸多态性会进行分析。


参数:block.size
Number of SNPs to be read from genoData at once.
genoData一次读取数个SNPs。


参数:verbose
if TRUE (default), will print status updates while the function runs. e.g. it will print "chr 1 block 1 of 10" etc. in the R console after each block of SNPs is done being analyzed.
如果TRUE(默认),将打印函数运行时的状态更新。例如它将打印等“CHR 1 10块1”在R控制台后完成正在分析每块单核苷酸多态性。


参数:outfile
a character string to append in front of ".model.j.gene_action.chr.i_k.RData" for naming the output data-frames; where j is the model number, gene_action is the gene.action type,  i is the first chromosome, and k is the last chromosome used in that call to the function.  "chr.i_k." will be omitted if  chromosome.set=NULL.  If set to NULL (default), then the results are returned to the R console.
一个字符串到附加在前面“model.j.gene_action.chr.i_k.RData。”命名的输出数据框;其中j是型号,gene_action是gene.action类型,我是第一染色体,和k,函数调用中使用的是最后的染色体。 “chr.i_k。”将被忽略,如果chromosome.set=NULL。如果设置为NULL(默认),然后将结果返回到R控制台。


Details

详情----------Details----------

When using models without interaction terms, the association tests compare the model including the covariates and genotype value to the model including only the covariates.  When using a model with interaction terms, the association tests compare the model including all the interactions, the covariates, and the genotype value to the model with only the covariates and genotype value (jointly testing for all the interaction effects).  All tests and p-values are found using Wald tests.  The option of using either sandwich based robust standard errors (which make no model assumptions) or using model based standard errors for the confidence intervals and Wald tests is specified by the robust parameter.
当使用无相互作用计算模型,该协会测试比较模型,包括只包括协变量的协变量和基因型值的模型。当使用一个模型与互动方面,该协会测试模型比较,包括所有的互动,协变量和协变量和基因型值(共同所有的互动效应测试)的基因型值的模型。所有测试和p值均发现使用沃尔德测试。 robust参数指定使用任何基于夹心稳健标准误差(不作任何模型假设),或使用模型的标准误差的置信区间和瓦尔德测试的选项。

Three types of regression models are available: "logistic", "linear", or "poisson". Multiple models can be run at the same time by putting multiple arguments in the outcome, model.type, covar.list, ivar.list, and gene.action.list parameters.  For each model, available gene action models  are "additive", "dominant", "recessive", and "dominance."  See above for the correct usage of each of these.
三种类型的回归模型可供选择:“MF”,“线性”,或“泊松”。多种型号,可在同一时间运行把outcome,model.type,covar.list,ivar.list,gene.action.list参数,多个参数。对于每一个模型,可用的基因行为模式是“加法”,“显性”,“隐性”,“优势”。见上面这些正确的用法。

Individual samples can be included or excluded from the analysis using the scan.exclude parameter. Individual chromosomes can be included or excluded by specifying the indices of the chromosomes to be included in the chromosome.set parameter.  Specific chromosomes for specific samples can be included or excluded using the scan.chromosome.filter parameter.   The inclusion or exclusion of specific blocks of SNP's on each chromosome can be specified using the block.set parameter. Note that the actual SNP's included or excluded will change according to the value of block.size.
可以包括个别样品,或从使用scan.exclude参数的分析排除。个别染色体可以包含或排除指定染色体chromosome.set参数指标。使用scan.chromosome.filter参数,可以包含或排除特定样品的特定染色体。使用block.set参数,可以指定每条染色体上的SNP的特定块纳入或排除。请注意,实际的SNP的包含或排除会改变根据block.size价值。

Both scan.chromosome.filter and scan.exclude may be used together. If a scan is excluded in EITHER, then it will be excluded from the analysis, but it does NOT need to be excluded in both. This design allows for easy filtering of anomalous scan-chromosome pairs using the scan.chromosome.filter matrix, but still allows easy exclusion of a specific group of scans (e.g. males or Caucasians) using scan.exclude.
既scan.chromosome.filter和scan.exclude可以一起使用。如果可以排除扫描,然后将被排除在分析之外,但它并不需要在这两个排除。这种设计允许的异常染色体扫描使用scan.chromosome.filter矩阵,对容易过滤,但仍允许使用scan.exclude容易排除的特定组扫描(如男性或白种人)。


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

If outfile=NULL (default), all results are returned as a single data.frame.  If outfile is specified, no data is returned but the function saves a data-frame for each model gene-action pair, with the naming convention as described by the variable outfile.
如果outfile=NULL(默认),所有的结果是作为一个单一的数据框返回。如果outfile指定,返回任何数据,但功能节省了模型的基因操作对每个数据框,命名约定由变量outfile所述。

The first three columns of each data-frame are:
每个数据框的前三列是:


参数:snpID
snpID (from genoData) of the SNP
snpID(从genoData)的SNP


参数:MAF
minor allele frequency. Note that calculation of allele frequency for the X chromosome is different than that for the  autosomes and the XY (pseudo-autosomal) region. Hence if chromosome.set includes 23, genoData should provide the sex of the  scan ("M" or "F") i.e. there should be a column named "sex" with "F" for females and "M" for males.
次要等位基因频率。请注意,X染色体上的等位基因频率计算比对常染色体和XY(伪常染色体显性遗传)区域是不同的。因此,如果chromosome.set包括23genoData扫描(的“M”或“F”),即应提供性别,应该是有命名的“F”为女性的“性别”一栏, “M”的男性。


参数:minor.allele
the minor allele. Takes values "A" or "B".
次要等位基因。以值的“A”或“B”。

After these first three columns, for every model gene-action pair there are the following columns: Here, "model.N" is the name assigned to the test where N = 1, 2,..., length(model.type),  and "gene_action" is the gene-action type of the test (one of "additive", "dominant", "recessive", or "dominance").
这些前三列后,每一个模型的基因行动对有下列列:在这里,“model.N”的名称是分配给测试n = 1,2,...,长度(model.type )和“gene_action”是基因测试的“添加剂”,“显性”,“隐性”或“优势”行动的类型。


参数:model.N.gene_action.n
sample size for the regression
样本大小为回归


参数:model.N.gene_action.warningOrError
warning or error occured during model fitting (1 if warning or error, NA if none)
模型拟合过程中发生警告或错误(1警告或错误,NA如果没有)


参数:model.N.gene_action.Est.G
estimate of the regression coefficient for the genotype term.  See the description in gene.action.list above for interpretation.
基因型术语的回归系数的估计。看到gene.action.list上面的解释说明。


参数:model.N.gene_action.SE.G
standard error of the regression coefficient estimate for the genotype term.   Could be either sandwich based (robust) or model based; see description in robust.
基因型术语的回归系数估计的标准误差。可无论是基于夹心(强大)或基于模型;在robust描述。

For tests with interaction variables: Here, "ivar_name" refers to the name of the interaction variable; if there are multiple interaction variables, there will be a  column with each different "ivar_name".
互动变量的测试:在这里,“ivar_name”指的是交互变量的名称;如果有多个互动变量,会有一列每一个不同的“ivar_name”。


参数:model.N.gene_action.Est.G.ivar_name
estimate of the regression coefficient for the interaction between genotype and ivar_name.
估计回归系数之间基因型和ivar_name互动。


参数:model.N.gene_action.SE.G.ivar_name
standard error of the regression coefficient estimate. Could be either sandwich based (robust) or model based; see description in robust.
回归系数估计的标准误差。可无论是基于夹心(强大)或基于模型;在robust描述。

For tests that use logistic regression with no interaction variables:
对于使用没有互动变量logistic回归测试:


参数:model.N.gene_action.OR.G
odds ratio for the genotype term. This is exp(the regression coefficient).  See the description in "gene.action.list" above for interpretation.
基因型术语的胜算比。这是EXP(回归系数)。看到“gene.action.list”上述解释说明。


参数:model.N.gene_action.OR_L95.G
lower 95% confidence limit for the odds ratio  (95 will be replaced with whatever confidence level is chosen in CI).
胜算比(95将取代CI选择的置信水平)降低95%可信限。


参数:model.N.gene_action.OR_U95.G
upper 95% confidence limit for the odds ratio  (95 will be replaced with whatever confidence level is chosen in CI).
上95%的置信下限的比值比(95将取代CI选择的置信水平)。

For tests that use logistic regression and interaction variables:
对于测试,使用logistic回归和交互变量:


参数:model.N.gene_action.OR.G.ivar_name
odds ratio for the genotype*ivar_name interaction term. This is exp(the interaction regression coefficient).  A separate odds ratio is calculated for each interaction term.  See the description in "gene.action.list" above for interpretation.
胜算比为* ivar_name相互作用的基因型。这是EXP(互动回归系数)。一个单独的赔率比计算每个互动一词。看到“gene.action.list”上述解释说明。


参数:model.N.gene_action.OR_L95.G.ivar_name
lower 95% confidence limit for the odds ratio  (95 will be replaced with whatever confidence level is chosen in CI).
胜算比(95将取代CI选择的置信水平)降低95%可信限。


参数:model.N.gene_action.OR_U95.G.ivar_name
upper 95% confidence limit for the odds ratio  (95 will be replaced with whatever confidence level is chosen in CI).
上95%的置信下限的比值比(95将取代CI选择的置信水平)。

For tests that use linear or poisson regression with no interaction variables:
对于测试,使用线性或泊松回归,没有互动的变数:


参数:model.N.gene_action.L95.G
lower 95% confidence limit for the genotype coefficient  (95 will be replaced with whatever confidence level is chosen in CI).
降低95%可信限为的基因型系数(95将取代CI选择的置信水平)。


参数:model.N.gene_action.U95.G
upper 95% confidence limit for the genotype coefficient (95 will be replaced with whatever confidence level is chosen in CI).
上基因型系数为95%置信下限(95%将被替换任何置信水平在CI选择)。

For tests that use linear or poisson regression and interaction variables:
对于使用线性或泊松回归和交互变量的测试:


参数:model.N.gene_action.L95.G.ivar_name
lower 95% confidence limit for the genotype*ivar_name interaction coefficient  (95 will be replaced with whatever confidence level is chosen in CI).
降低95%置信下限的基因型* ivar_name相互作用系数(95将取代CI选择的置信水平)。


参数:model.N.gene_action.U95.G.ivar_name
upper 95% confidence limit for the genotype*ivar_name interaction coefficient (95 will be replaced with whatever confidence level is chosen in CI).
上95%的基因型的信心限制* ivar_name相互作用系数(95将取代CI选择的置信水平)。

For tests with no interaction variables:
对于没有互动变量的测试:


参数:model.N.gene_action.Stat.G
value of the Wald test statistic for testing the genotype parameter
测试基因型参数的Wald检验统计量的值


参数:model.N.gene_action.pvalue.G
Wald test p-value.   This can be calculated using either sandwich based robust standard errors or model based standard errors (see robust).
Wald检验的p值。这可以使用或者三明治的稳健标准错误或基于模型的标准误差计算(见robust)。

For tests with interaction variables:
对于具有交互变量的测试:


参数:model.N.gene_action.Stat.GxE
value of the Wald test statistic for jointly testing all genotype interaction parameters
联合测试的所有基因型的相互作用参数的Wald检验统计量的值


参数:model.N.gene_action.pvalue.GxE
Wald test p-value for jointly testing all genotype interaction parameters.   This can be calculated using either sandwich based robust standard errors or model based standard errors (see robust).
Wald检验的p值共同所有基因型的相互作用参数测试。这可以使用或者三明治的稳健标准错误或基于模型的标准误差计算(见robust)。

If geno.counts = TRUE, for tests that use linear regression:
如果geno.counts = TRUE,测试,使用线性回归:


参数:model.N.nAA
        number of AA genotypes in samples
数样品中AA基因型


参数:model.N.nAB
        number of AB genotypes in samples
AB基因型在样本数


参数:model.N.nBB
        number of BB genotypes in samples
BB基因型样本数

If geno.counts = TRUE, for tests that use logistic regression:
如果geno.counts = TRUE,测试,使用logistic回归:


参数:model.N.nAA.cc0
number of AA genotypes in samples with outcome coded as 0
AA基因型的编码为0,结果样品的数量


参数:model.N.nAB.cc0
number of AB genotypes in samples with outcome coded as 0
AB基因型的编码为0,结果样品的数量


参数:model.N.nBB.cc0
number of BB genotypes in samples with outcome coded as 0
BB基因型个体数编码为0,结果样本


参数:model.N.nAA.cc1
number of AA genotypes in samples with outcome coded as 1
结果样品编码为1的AA基因型


参数:model.N.nAB.cc1
number of AB genotypes in samples with outcome coded as 1
AB基因型的数目,结果样品编码为1


参数:model.N.nBB.cc1
number of BB genotypes in samples with outcome coded as 1
结果样品数为1编码的BB基因型

Attributes:
属性:

There is also an attribute for each output data-frame called "model" that shows the model used for the test.  This can be viewed with the following R command: attr(mod.res, "model") where mod.res is the output data-frame from the function. The attr() command will return something like: model.1.additive "case.cntl.status ~ age + sex , logistic regression, additive gene action"
还有一个所谓的“模型”的每个输出数据框显示用于试验的模型的属性。这可以用下面的R命令:attr(mod.res, "model")其中mod.res输出功能的数据框。 attr()命令将返回类似:model.1.additive“case.cntl.status~年龄性别,logistic回归,基因加性行动”

There is another attribute called "SE" that shows if Robust or Model Based standard errors were used for the test. This can be viewed with the following R command: attr(mod.res, "SE") where mod.res is the output data-frame from the function.
另一个属性是被称为“东南”,表明如果用于测试鲁棒或基于模型的标准误差。这可以用下面的R命令:attr(mod.res, "SE")其中mod.res输出功能的数据框。

Warnings:
警告:

Another file will be saved with the name "outfile.chr.i_k.warnings.RData" that contains any warnings generated by the function. An example of what would be contained in this file: Warning messages: 1: Model 1 , Y chromosome tests are confounded with sex and should be run separately without sex in the model 2: Model 2 , Y chromosome tests are confounded with sex and should be run separately without sex in the model
另一个文件将被保存的名称为“outfile.chr.i_k.warnings.RData”,它包含的功能产生任何警告。这个文件将包含在一个什么样的例子:警告消息:1:1型号,Y染色体测试与性别混淆,应运行无性别分别在模型2:模型2,Y染色体测试与性别混淆,应该运行无性别分别在模型


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


Tushar Bhangale, Matt Conomos



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

GenotypeData, lm,
GenotypeData,lm


举例----------Examples----------


# The following example would perform 3 tests (from 2 models): [下面的例子将执行3个测试(2款):]
# the first a logistic regression of case.cntl.status on genotype, age, and sex, including an interaction term between genotype and sex, using additive gene action; [第一logistic回归的case.cntl.status基因型,年龄,性别,包括基因型和性别之间的相互作用来看,使用添加剂的基因的作用;]
# the second a linear regression of blood pressure on genotype using dominant gene action, [第二个是血压的线性回归使用显性基因作用的基因型,]
# and the third, a linear regression of blood pressure on genotype again, but this time using recessive gene action.[第三,血压的基因型线性回归,但这次使用的隐性基因的作用。]
# This test would only use chromosome 21.  It would also use sandwich based robust standard errors.[此测试只使用21号染色体。它也将使用三明治的稳健标准误差。]

# an example of a scan chromosome matrix[扫描染色体矩阵的一个例子]
# desiged to eliminate duplicated individuals[消除重复的个人desiged]
# and scans with missing values of sex[与性别缺失值和扫描]
library(GWASdata)
data(affy_scan_annot)
scanAnnot <- ScanAnnotationDataFrame(affy_scan_annot)
samp.chr.matrix <- matrix(TRUE,nrow(scanAnnot),26)
dup <- duplicated(scanAnnot$subjectID)
samp.chr.matrix[dup | is.na(scanAnnot$sex),] <- FALSE

# additionally, exclude YRI subjects[此外,排除YRI人群科目]
scan.exclude <- scanAnnot$scanID[scanAnnot$race == "YRI"]

# create some variables for the scans[创建一些变量扫描]
scanAnnot$sex <- as.factor(scanAnnot$sex)
scanAnnot$age <- rnorm(nrow(scanAnnot),mean=40, sd=10)
scanAnnot$case.cntl.status <- rbinom(nrow(scanAnnot),1,0.4)
scanAnnot$blood.pressure[scanAnnot$case.cntl.status==1] <- rnorm(sum(scanAnnot$case.cntl.status==1),mean=100,sd=10)
scanAnnot$blood.pressure[scanAnnot$case.cntl.status==0] <- rnorm(sum(scanAnnot$case.cntl.status==0),mean=90,sd=5)

# create data object[创建数据对象]
ncfile <- system.file("extdata", "affy_geno.nc", package="GWASdata")
nc <- NcdfGenotypeReader(ncfile)
genoData <-  GenotypeData(nc, scanAnnot=scanAnnot)

# set regression variables and models[设定回归变量和模型]
outcome <- c("case.cntl.status","blood.pressure")

covar.list <- list()
covar.list[[1]] <- c("age","sex")
covar.list[[2]] <- c("")

ivar.list <- list();
ivar.list[[1]] <- c("sex");
ivar.list[[2]] <- c("");
  
model.type <- c("logistic","linear")

gene.action.list <- list()
gene.action.list[[1]] <- c("additive")
gene.action.list[[2]] <- c("dominant", "recessive")

chr.set <- 21

outfile <- tempfile()

assocTestRegression(genoData,
                    outcome = outcome,
                                        model.type = model.type,
                    covar.list = covar.list,
                    ivar.list = ivar.list,
                    gene.action.list = gene.action.list,
                    scan.chromosome.filter = samp.chr.matrix,
                    scan.exclude = scan.exclude,
                    CI = 0.95,
                    robust = TRUE,
                    geno.counts = TRUE,
                    chromosome.set = chr.set,
                    outfile = outfile)

model1 <- getobj(paste(outfile, ".model.1.additive.chr.21_21.RData", sep=""))
model2 <- getobj(paste(outfile, ".model.2.dominant.chr.21_21.RData", sep=""))
model3 <- getobj(paste(outfile, ".model.2.recessive.chr.21_21.RData", sep=""))

close(genoData)
unlink(paste(outfile, "*", sep=""))

# In order to run the test on all chromosomes, it is suggested to run the function in parallel.[为了运行所有染色体上的考验,它是并行运行的功能。]
# To run the function in parallel the following unix can be used:[运行在平行可以用下面的UNIX功能:]
# R --vanilla --args 21 22 &lt; assoc.analysis.r &gt;logfile.txt &amp;[的R  - 香草 - 的ARGS 21 22 <assoc.analysis.r> logfile.txt]
# where the file assoc.analysis.r will include commands similar to this example [,文件assoc.analysis.r将包括这个例子类似的命令]
# where chromosome.set and/or block.set can be passed to R using --args[其中chromosome.set和/或block.set的可传递到R  - 参数]
# Here, tests on chromosomes 21 and 22 are performed; these could be replaced by any set of chromosomes[在这里,21和22号染色体上进行测试,这些都可以通过任何一套染色体取代]
# these values are retrieved in R by putting a[把一个检索这些值在R]
# chr.set &lt;- as.numeric(commandArgs(trailingOnly=TRUE))[chr.set < -  as.numeric(commandArgs(trailingOnly = TRUE))]
# command in assoc.analysis.r [命令在assoc.analysis.r]

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


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

使用道具 举报

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

本版积分规则

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

GMT+8, 2025-2-6 10:05 , Processed in 0.025539 second(s), 15 queries .

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

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