bsapply(BSgenome)
bsapply()所属R语言包:BSgenome
bsapply
bsapply
译者:生物统计家园网 机器人LoveR
描述----------Description----------
Apply a function to each chromosome in a genome.
套用到每个染色体的基因组中的功能。
用法----------Usage----------
bsapply(BSParams, ...)
参数----------Arguments----------
参数:BSParams
a BSParams object that holds the various parameters needed to configure the bsapply function
1 BSParams持有需要配置bsapply功能的各种参数的对象
参数:...
optional arguments to 'FUN'.
可选参数乐趣。
Details
详情----------Details----------
By default the exclude parameter is set to not exclude anything. A popular option will probably be to set this to "rand" so that random bits of unassigned contigs are filtered out.
默认情况下,排除参数设置不排除任何东西。一个受欢迎的选择可能会设置“兰特”,因此,未分配的重叠群随机位被过滤掉。
值----------Value----------
If BSParams sets simplify = FALSE, a GenomeData object is returned containing the results generated using the remaining BSParams specifications. If BSParams sets simplify = TRUE, an sapply-like simplification is used on the results.
如果BSParams设置simplify = FALSE中,GenomeData对象,则返回包含使用剩余BSParams规格生成的结果。如果BSParams设置simplify = TRUEsapply像简化结果。
作者(S)----------Author(s)----------
Marc Carlson
参见----------See Also----------
BSParams-class, BSgenome-class, BSgenome-utils, GenomeData-class
BSParams类,BSgenome级,BSgenome-utils的,GenomeData级
举例----------Examples----------
## Load the Worm genome:[#装入蠕虫基因组:]
library("BSgenome.Celegans.UCSC.ce2")
## Count the alphabet frequencies for every chromosome but exclude[#计算每一个染色体的字母频率,但不包括]
## mitochrondrial ones:[#线粒体的:]
params <- new("BSParams", X = Celegans, FUN = alphabetFrequency,
exclude = "M")
bsapply(params)
## Or we can do this same function with simplify = TRUE:[#或者,我们可以做的与此相同的功能简化= TRUE:]
params <- new("BSParams", X = Celegans, FUN = alphabetFrequency,
exclude = "M", simplify = TRUE)
bsapply(params)
## Examples to show how we might look for a string (in this case an[#例子,说明我们如何寻找字符串(在这种情况下,]
## ebox motif) across the whole genome. [#eBox的图案)在整个基因组。]
Ebox <- DNAStringSet("CACGTG")
pdict0 <- PDict(Ebox)
params <- new("BSParams", X = Celegans, FUN = countPDict, simplify = TRUE)
bsapply(params, pdict = pdict0)
params@FUN <- matchPDict
bsapply(params, pdict = pdict0)
## And since its really overkill to use matchPDict to find a single pattern:[#因为真的矫枉过正使用matchPDict找到一个单一的模式:]
params@FUN <- matchPattern
bsapply(params, pattern = "CACGTG")
## Examples on how to use the masks[#例如如何使用口罩]
library("BSgenome.Hsapiens.UCSC.hg19")
## I can make things verbose if I want to see the chromosomes getting processed.[#我可以做的事情详细的,如果我想看到的染色体得到处理。]
options(verbose=TRUE)
## For the 1st example, lets use default masks[#1例如,允许使用默认的掩码]
params <- new("BSParams", X = Hsapiens, FUN = alphabetFrequency,
exclude = c(1:8,"M","X","random","hap"), simplify = TRUE)
bsapply(params)
if (interactive()) {
## Set up the motifList to filter out all double T's and all double C's[#设置motifList筛选出所有的双T的所有双C]
params@motifList <-c("TT","CC")
bsapply(params)
## Get rid of the motifList[#获取摆脱motifList]
params@motifList=as.character()
}
##Enable all standard masks[#启用所有标准的口罩。]
params@maskList <- c("RM"=TRUE,"TRF"=TRUE)
bsapply(params)
##Disable all standard masks[#禁用所有标准的口罩。]
params@maskList <- c("AGAPS"=FALSE,"AMB"=FALSE)
bsapply(params)
转载请注明:出自 生物统计家园网(http://www.biostatistic.net)。
注:
注1:为了方便大家学习,本文档为生物统计家园网机器人LoveR翻译而成,仅供个人R语言学习参考使用,生物统计家园保留版权。
注2:由于是机器人自动翻译,难免有不准确之处,使用时仔细对照中、英文内容进行反复理解,可以帮助R语言的学习。
注3:如遇到不准确之处,请在本贴的后面进行回帖,我们会逐渐进行修订。
|