ld.snp(chopsticks)
ld.snp()所属R语言包:chopsticks
Function to calculate pairwise D', $r^2$
函数计算成对D“,$ R ^ 2 $
译者:生物统计家园网 机器人LoveR
描述----------Description----------
ld.snp takes an object of snp.matrix class and suitable range and depth and calculation the pairwise D', $r^2$, LOD and return the result as a snp.dprime object.
ld.snpsnp.matrix类和适当的范围和深度,计算成对D“,$ R ^ 2 $,LOD和回报snp.dprime对象的结果对象。
用法----------Usage----------
ld.snp(snpdata, depth = 100, start = 1, end = dim(snpdata)[2], signed.r=FALSE)
参数----------Arguments----------
参数:snpdata
An object of snp.matrix class with M samples of N snps
一个snp.matrixM样点的N个SNPs类的对象
参数:depth
The depth or lag of pair-wise calculation. Should be between 1 and N-1; default 100. Using 0 (an invalid value) is the same as picking the maximum
成对计算的深度或滞后。应介于1和N-1,默认为100。使用0(无效值)是采摘最大的相同
参数:start
The index of the start of the range of interest. Should be between 1 and (N-1); default 1
该指数的利益范围内开始。应介于1(N-1个),默认为1
参数:end
The index of the end of the range of interest. Should be between 2 and N. default N.
指数利益的范围。应该默认北路2和N之间
参数:signed.r
Boolean for whether to returned signed $r$ values instead of $r^2$
布尔对是否签署返回$ R $值,而不是$ R ^ 2 $
Details
详情----------Details----------
The cubic equation and quadratic equation solver code is borrowed from GSL (GNU Scientific Library).
三次方程和二次方程求解代码是借来的吉斯达(GNU科学库)。
值----------Value----------
return a snp.dprime object, which is a list of 3 named matrices dprime, rsq2 (or r depending on the input), lod, and an attribute snp.names for the list of snps involved. (Note that if $x$ snps are involved, the row numbers of the 3 matrices are $(x-1)$). Only one of rsq2 or r is present.
返回snp.dprime对象,其中3名为矩阵dprime,rsq2(或r根据输入),lod,属性列表snp.names的SNPs名单参与。 (请注意,如果$ X $ SNPs是参与,3个矩阵的行数分别为(X-1)$)。只有一个rsq2或r存在。
参数:dprime
D'
D“
参数:rsq2
$r^2$
$ R ^ 2元
参数:r
signed $r$
签署$ R $
参数:lod
Log of Odd's
登录奇
All the matrices are defined such that the ($n, m$)th entry is the pair-wise value between the ($n$)th snp and the $(n+m)$th snp. Hence the lower right triangles are always filled with zeros. (See example section for the actual layout)
美元(N + M)$个SNP(N,M $),次入口是成对的值($ N $)个SNP和所有的矩阵定义等。因此,在右下角的三角形总是用零填充。 (例如部分的实际布局)
Invalid values are represented by an out-of-range value - currently we use -1 for D', $r^2$ (both of which are between 0 and 1), and -2 for $r$ (valid values are between -1 and +1). lod is set to zero in most of these invalid cases. (lod can be any value so it is not indicative).
无效的值表示范围的价值 - 目前我们使用D“-1,$ R ^ 2元(其中0和1之间),$ R $ -2(有效值介于-1和+1)。 LOD设置在大多数这些无效的情况下为零。 (LOD可以是任何值,所以它是不指示)。
注意----------Note----------
The output snp.dprime object is suitable for input to plot.snp.dprime for drawing.
输出snp.dprime对象是适合绘图输入plot.snp.dprime。
The speed of “ld.snp” LD calculation, on a single-processor opteron 2.2GHz box:
的“ld.snp”劳工处的计算速度,在单处理器的Opteron 2.2GHz的框:
unsigned $r^2$, 13191 snps, depth 100 = 36.4 s (~ 1.3 mil pairs)
无符号$ R ^ 2 $,13191个SNPs,深度100 = 36.4小号(~1.3 MIL双)
signed r , 13191 snps, depth 100 = 40.94s (~ 1.3 mil pairs)
签名R,13191个SNPs,深度100 = 40.94s(~1.3 MIL双)
signed r , 13191 snps, depth 1500 = 582s (~ 18.5 mil pairs)
签名R,13191个SNPs,深度1500 = 582s(~18.5 MIL对)
For depth=1500, it uses 500MB just for the three matrices. So I actually cannot do the full depth at ~13,000; full depth should be under 50 minutes for 87 mil pairs, even in the signed-r version.
深度= 1500,它使用三个矩阵500MB。所以我真的不能做~13000的全面深入,充分的深度应在50分钟87万双,甚至在签名-R版本,。
The LD code can be ran outside of R - mainly for debugging:
劳工处代码可以跑到外面的R - 主要用于调试:
作者(S)----------Author(s)----------
Hin-Tak Leung <a href="mailto:htl10@users.sourceforge.net">htl10@users.sourceforge.net</a>
参考文献----------References----------
whole-genome association studies. Human Heredity 64:45-51.<br> GSL (GNU Scientific Library) http://www.gnu.org/software/gsl/
参见----------See Also----------
snp.dprime-class,
snp.dprime-class
举例----------Examples----------
# LD stats between 500 SNPs at a depth of 50[劳工处统计深度在50至500个SNPs]
data(testdata)
ldinfo <- ld.snp(Autosomes, start=1, end=500, depth=50)
转载请注明:出自 生物统计家园网(http://www.biostatistic.net)。
注:
注1:为了方便大家学习,本文档为生物统计家园网机器人LoveR翻译而成,仅供个人R语言学习参考使用,生物统计家园保留版权。
注2:由于是机器人自动翻译,难免有不准确之处,使用时仔细对照中、英文内容进行反复理解,可以帮助R语言的学习。
注3:如遇到不准确之处,请在本贴的后面进行回帖,我们会逐渐进行修订。
|