applyPileups(Rsamtools)
applyPileups()所属R语言包:Rsamtools
Create summary pile-up statistics across multiple BAM files.
创建跨多个BAM的文件的摘要桩统计。
译者:生物统计家园网 机器人LoveR
描述----------Description----------
applyPileups scans one or more BAM files, returning position-specific sequence and quality summaries.
applyPileups扫描一个或更多的BAM文件,返回特定位置的序列和质量总结。
用法----------Usage----------
applyPileups(files, FUN, ..., param)
参数----------Arguments----------
参数:files
A PileupFiles instances.
一个PileupFiles实例。
参数:FUN
A function of 1 argument, x, to be evaluated for each yield (see yieldSize, yieldBy, yieldAll). The argument x is a list, with elements describing the current pile-up. The elements of the list are determined by the argument what, and include:
一个功能参数1,x,每个产量评估(见yieldSize,yieldBy,yieldAll)。参数xlist,描述当前堆积的元素。列表中的元素是由参数what,包括:
seqnamesAlways returned) A named integer() representing the seqnames corresponding to each position reported in the pile-up. This is a run-length encoding, where the names of the elements represent the seqnames, and the values the number of successive positions corresponding to that seqname.
seqnames:总是返回一个名为integer()代表的seqnames每个位置对应的桩报道。这是一个运行长度编码,元素的名称代表的seqnames的,和值的对应,seqname连续位置。
pos:Always returned) A integer() representing the genomic coordinate of each pile-up position.
POS:总是返回)integer()代表基因组的每根桩的位置坐标。
seq:An array of dimensions nucleotide x file x position. The "nucleotide" dimension is length 5, corresponding to "A", "C", "G", "T", and "N" respectively. Entries in the array represent the number of times the nucleotide occurred in reads in the file overlapping the position.
SEQ:一个array尺寸核苷酸x文件的x位置。 “核苷酸”的尺寸是长度为5,“A”,“C”,“G”,“T”,“N”分别对应。数组中的条目倍核苷酸发生在重叠位置的文件读取。
qualike seq, but summarizing quality; the first dimension is the Phred-encoded quality score, ranging from "!" (0) to "~" (93).
QUAL:类似seq,但总结质量第一维是PHRED编码的质量得分,范围从(0)~(93)!。
参数:...
Additional arguments, passed to methods.
额外的参数,传递给方法。
参数:param
An instance of the object returned by PileupParam.
PileupParam返回一个对象的实例。
值----------Value----------
applyPileups returns a list equal in length to the number of times FUN has been called, with each element containing the result of FUN.
applyPileups返回list倍FUN长度等于每个元素,被称为包含FUN结果。
PileupParam returns an object describing the parameters.
PileupParam描述的参数返回一个对象。
作者(S)----------Author(s)----------
Martin Morgan
参考文献----------References----------
<h3>See Also</h3>
举例----------Examples----------
fl <- system.file("extdata", "ex1.bam", package="Rsamtools")
fls <- PileupFiles(c(fl, fl))
calcInfo <-
function(x)
{
## information at each pile-up position[#在每根桩的位置信息]
info <- apply(x[["seq"]], 2, function(y) {
y <- y[c("A", "C", "G", "T"),]
y <- y + 1L # continuity[连续性]
cvg <- colSums(y)
p <- y / cvg[col(y)]
h <- -colSums(p * log(p))
ifelse(cvg == 4L, NA, h)
})
list(seqnames=x[["seqnames"]], pos=x[["pos"]], info=info)
}
which <- GRanges(c("seq1", "seq2"), IRanges(c(1000, 1000), 2000))
param <- PileupParam(which=which, what="seq")
res <- applyPileups(fls, calcInfo, param=param)
str(res)
head(res[[1]][["pos"]]) # positions matching param[职位匹配参数]
head(res[[1]][["info"]]) # inforamtion in each file[在每个文件inforamtion]
## 'param' as part of 'files'[#“参数”的“文件”的一部分]
fls1 <- PileupFiles(c(fl, fl), param=param)
res1 <- applyPileups(fls1, calcInfo)
identical(res, res1)
## yield by position, across ranges[#产生的位置,跨范围]
param <- PileupParam(which=which, yieldSize=500L, yieldBy="position",
what="seq")
res <- applyPileups(fls, calcInfo, param=param)
sapply(res, "[[", "seqnames")
转载请注明:出自 生物统计家园网(http://www.biostatistic.net)。
注:
注1:为了方便大家学习,本文档为生物统计家园网机器人LoveR翻译而成,仅供个人R语言学习参考使用,生物统计家园保留版权。
注2:由于是机器人自动翻译,难免有不准确之处,使用时仔细对照中、英文内容进行反复理解,可以帮助R语言的学习。
注3:如遇到不准确之处,请在本贴的后面进行回帖,我们会逐渐进行修订。
|