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

R语言 oligoClasses包 SnpSet-methods()函数中文帮助文档(中英文对照)

[复制链接]
发表于 2012-2-26 08:11:52 | 显示全部楼层 |阅读模式
SnpSet-methods(oligoClasses)
SnpSet-methods()所属R语言包:oligoClasses

                                        Accessors and methods for SnpSet objects
                                         accessor和SnpSet对象方法

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

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

Utility functions for accessing data in SnpSet objects.
SnpSet对象访问数据的实用功能。


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


calls(object)
calls(object) <- value
confs(object, transform=TRUE)
confs(object) <- value



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

参数:object
A SnpSet object.
一个SnpSet对象。


参数:transform
Logical. Whether to transform the integer representation of the confidence score (for memory efficiency) to a probability. See details.
逻辑。是否改造的信心分数的整数表示(记忆效率)的概率。查看详情。


参数:value
A matrix.
矩阵。


Details

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

calls returns the genotype calls. CRLMM stores genotype calls as integers (1 - AA; 2 - AB; 3 - BB).
calls返回的基因型调用。 CRLMM商店基因型称为整数(1  -  AA; 2  -  AB公司; 3  -  BB的)。

confs returns the confidences associated with the genotype calls. The current implementation of CRLMM stores the confidences as integers to save memory on disk by using the transformation:
confs返回与基因型调用关联的机密。目前实施的CRLMM存储整数保存在磁盘上的内存使用改造的信心:

round(-1000*log2(1-p)),
轮(-1000 *为log2(1-P)),

where 'p' is the posterior probability of the call.  confs is a convenience function that transforms the integer representation back to a probability.  Note that if the assayData elements of the SnpSet objects are ff_matrix or ffdf, the confs function will return a warning. For such objects, one should first subset the ff object and coerce to a matrix, then apply the above conversion.  The function snpCallProbability for the callProbability slot of SnpSet objects.  See the examples below.
其中“P”是呼叫后验概率。 confs是一个方便的功能转换的整数表示回到一个概率。注意如果SnpSet对象assayData元素,ff_matrix或ffdf,confs函数将返回一个警告。对于这样的对象,应该第一子集ff对象,并要挟矩阵,然后应用上述转换。函数snpCallProbabilitycallProbabilitySnpSet对象插槽。见下面的例子。

checkOrder checks whether the object is ordered by chromosome and physical position, evaluating to TRUE or FALSE.
checkOrder检查对象是否是由染色体和物理位置排列,评估为TRUE或FALSE。


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

Note that the replacement method for confs<- expects a matrix of probabilities and will automatically convert the probabilities to an integer representation.  See details for the conversion.
请注意confs<-置换法预计的概率矩阵,并会自动转换到一个整数表示的概率。详情请参阅转换。

The accessor snpCallProbability is an accessor for the 'callProbability' element of the assayData.  The name can be misleading, however, as the accessor will not return a probability if the call probabilities are represented as integers.
存取snpCallProbability是存取callProbability元素assayData。可能会产生误导的名称,但是,作为存取不会返回,如果调用的概率表示为整数的概率。


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

See addFeatureAnnotation for adding chromosome, physical position, and an indicator for whether the marker is polymorphic to the featureData slot of a SnpSet object.
看到addFeatureAnnotation加入染色体,物理位置,是否标记多态性featureDataSnpSet对象插槽指标。

The helper functions p2i converts probabilities to integers and i2p converts integers to probabilities.
辅助函数p2i概率转换成整数和i2p转换整数概率。

See order and checkOrder.
看到order和checkOrder。


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



        theCalls <- matrix(sample(1:3, 20, rep=TRUE), nc=2)
        p <- matrix(runif(20), nc=2)
        integerRepresentation <- matrix(as.integer(round(-1000*log(1-p))), 10, 2)
        obj <- new("SnpSet", call=theCalls, callProbability=integerRepresentation)
        calls(obj)
        p2 <- confs(obj)
        dimnames(p2) <- NULL
        all.equal(p2, p)        ## small differences due to rounding[#小的差异,由于四舍五入]
        int &lt;- snpCallProbability(obj) ## not necessarily a probability[#不一定概率]
        p3 &lt;- i2p(int)  ## to convert back to a probability[#转换回一个概率]
        all.equal(p3, p2)

        int &lt;- snpCallProbability(obj) ## not necessarily a probability[#不一定概率]
        p3 &lt;- i2p(int)  ## to convert back to a probability[#转换回一个概率]
        all.equal(p3, p2)

        ## example using ff[#例如使用FF]
        if(require(ff)){
                ldPath(tempdir())
                integerRepresentation <- initializeBigMatrix("tmp", 10, 2)
                for(j in 1:2) integerRepresentation[, j] <- as.integer(round(-1000*log(1-p[, j])))
                integerRepresentation
                obj <- new("SnpSet", call=theCalls, callProbability=integerRepresentation)
                calls(obj)
                res <- tryCatch(confs(obj), error=function(e) NULL)
                is.null(res)
                integerRepresentation <- snpCallProbability(obj)
                ##coerce to matrix by subsetting desired rows and columns (here we choose all rows and columns)[#强迫矩阵子集所需的行和列(在这里我们选择的所有行和列)]
                integerRepresentation <- integerRepresentation[,]
                p3 <- oligoClasses:::i2p(integerRepresentation)
                dimnames(p3) <- NULL
                all.equal(p2, p3)
        }

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


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

使用道具 举报

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

本版积分规则

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

GMT+8, 2025-2-2 16:44 , Processed in 0.019870 second(s), 15 queries .

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

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