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

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

[复制链接]
发表于 2012-2-26 13:28:18 | 显示全部楼层 |阅读模式
BamViews(Rsamtools)
BamViews()所属R语言包:Rsamtools

                                        Views into a set of BAM files
                                         成组的BAM文件的意见

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

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

Use BamViews() to reference a set of disk-based BAM files to be processed (e.g., queried using scanBam) as a single "experiment".
使用BamViews()引用一组磁盘基于BAM的文件要处理(例如,使用scanBam)作为一个单一的“实验”的质疑。


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



## Constructor
BamViews(bamPaths=character(0),
     bamIndicies=bamPaths,
     bamSamples=DataFrame(row.names=make.unique(basename(bamPaths))),
     bamRanges, bamExperiment = list(), ...)
## S4 method for signature 'missing'
BamViews(bamPaths=character(0),
     bamIndicies=bamPaths,
     bamSamples=DataFrame(row.names=make.unique(basename(bamPaths))),
     bamRanges, bamExperiment = list(), ..., auto.range=FALSE)
## Accessors
bamPaths(x)
bamSamples(x)
bamSamples(x) <- value
bamRanges(x)
bamRanges(x) <- value
bamExperiment(x)

## S4 method for signature 'BamViews'
names(x)
## S4 replacement method for signature 'BamViews'
names(x) <- value
## S4 method for signature 'BamViews'
dimnames(x)
## S4 replacement method for signature 'BamViews,ANY'
dimnames(x) <- value

bamDirname(x, ...) <- value

## Subset
## S4 method for signature 'BamViews,ANY,ANY'
x[i, j, ..., drop=TRUE]
## S4 method for signature 'BamViews,ANY,missing'
x[i, j, ..., drop=TRUE]
## S4 method for signature 'BamViews,missing,ANY'
x[i, j, ..., drop=TRUE]

## Input
## S4 method for signature 'BamViews'
scanBam(file, index = file, ...,
    param = ScanBamParam(what=scanBamWhat()))
## S4 method for signature 'BamViews'
countBam(file, index = file, ..., param = ScanBamParam())
## S4 method for signature 'BamViews'
readBamGappedAlignments(file, index=file, use.names=FALSE, param=NULL)

## Show
## S4 method for signature 'BamViews'
show(object)

## Counting
## S4 method for signature 'GRanges,BamViews'
summarizeOverlaps(
    features, reads, mode, ignore.strand = FALSE, ..., param = ScanBamParam())




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

参数:bamPaths
A character() vector of BAM path names.
BAM的路径名的字符()向量。


参数:bamIndicies
A character() vector of BAM index file path names, without the ".bai" extension.
一个字符()向量BAM索引文件的路径名,无“白”扩展。


参数:bamSamples
A DataFrame instance with as many rows as length(bamPaths), containing sample information associated with each path.
一个DataFrame作为许多行的实例length(bamPaths),含有样品信息与每个路径关联。


参数:bamRanges
A GRanges, RangedData or missing instance with ranges defined on the spaces of the BAM files. Ranges are not validated against the BAM files.
一个GRanges,RangedData或丢失的BAM文件的空间上定义的范围的实例。没有验证的BAM文件范围。


参数:bamExperiment
A list() containing additional information about the experiment.
一个列表()包含有关实验的其他信息。


参数:auto.range
If TRUE and all bamPaths exist, populate the ranges with the union of ranges returned in the target element of scanBamHeader.
如果TRUE“所有的bamPaths存在,填充与工会返回targetscanBamHeader元素的范围的范围。


参数:...
Additional arguments.
额外的参数。


参数:x
An instance of BamViews.
BamViews实例。


参数:object
An instance of BamViews.
BamViews实例。


参数:value
An object of appropriate type to replace content.
适当类型的对象,以取代内容。


参数:i
During subsetting, a logical or numeric index into bamRanges.
在子集,成bamRanges逻辑或数字索引。


参数:j
During subsetting, a logical or numeric index into bamSamples and bamPaths.
在子集,将bamSamples和bamPaths逻辑或数字索引。


参数:drop
A logical(1), ignored by all BamViews subsetting methods.
逻辑(1),忽略所有BamViews子集的方法。


参数:file
An instance of BamViews.
BamViews实例。


参数:index
A character vector of indices, corresponding to the bamPaths(file).  
一个指数的特征向量,对应bamPaths(file)。


参数:param
An optional ScanBamParam instance to further influence scanning or counting.
可选ScanBamParam实例,进一步影响扫描或计数。


参数:use.names
Construct the names of the returned object from the query template names (QNAME field)? If not (the default), then the returned object has no names.
构建查询模板名称(QNAME领域)返回的对象的名称是什么? (默认),如果没有,则返回的对象没有名称。


参数:reads
A BamFileList that represents the data to be counted by summarizeOverlaps.  
一个BamFileList表示被由summarizeOverlaps计算的数据。


参数:features
A GRanges or a GRangesList object of genomic regions of  interest. When a GRanges is supplied, each row is considered a  feature. When a GRangesList is supplied, each higher list-level is considered a feature. This distinction is important when defining an overlap between a read and a feature. See examples for details.   
一个农庄或GRangesList对象的基因组区域的利益。当格朗提供,每一行被认为是一种功能。当GRangesList提供,每一个更高的列表级别被认为是一种功能。定义读和功能之间的重叠时,这个区别很重要。有关详细信息,请参阅例子。


参数:mode
A function that defines the method to be used when a read overlaps more than one feature. Pre-defined options are "Union", "IntersectionStrict", or "IntersectionNotEmpty" and are designed after the counting modes available in the HTSeq package by Simon Anders (see references).   
一个函数定义要使用的方法时读多个功能重叠。预先定义的选项是“联盟”,“IntersectionStrict”,或“IntersectionNotEmpty”的设计后,由西蒙·安德斯HTSeq包(参见参考资料)中的计数模式。

"Union" : (Default) Reads that overlap any portion of exactly one  feature are counted. Reads that overlap multiple features are  discarded.   
“联盟”:(默认)读取重叠的部分计算任何一个功能。读取该重叠多种功能都将被丢弃。

"IntersectionStrict" : A read must fall completely "within" the feature to be counted. If a read overlaps multiple features but falls "within" only one, the read is counted for that feature. If the read is "within" multiple features, the read is discarded.   
“IntersectionStrict”:“读”必须完全属于“内”的计算功能。如果读的多种功能重叠,但属于“内的”只有一个,读计数该功能。如果读的是“内”多种功能,读取被丢弃。

"IntersectionNotEmpty" : A read must fall in a unique disjoint region of a feature to be counted. When a read overlaps multiple features, the features are partitioned into disjoint intervals.  Regions that are shared between the features are discarded leaving only the unique disjoint regions. If the read overlaps one of  these remaining regions, it is assigned to the feature the unique disjoint region came from.  
“IntersectionNotEmpty”:一个只读必须属于一个以计数的功能独特的相交区域。当读重叠多种功能,功能划分为不相交的时间间隔。功能之间共享的区域将被丢弃,只留下了独特的不相交的区域。如果读的重叠,这些剩余的区域之一,它被分配的功能来自独特的相交区域。


参数:ignore.strand
A logical value indicating if strand should be considered when matching.  
匹配时,应被视为一个逻辑值,指出如果链。


类的对象----------Objects from the Class----------

Objects are created by calls of the form BamViews().
对象的创建形式BamViews()检测。


插槽----------Slots----------




bamPaths A character() vector of BAM path names.
bamPaths字符()向量BAM的路径名。




bamIndicies A character() vector of BAM index path names.
bamIndicies字符()BAM索引路径名的向量。




bamSamples A DataFrame instance with as many rows as length(bamPaths), containing sample information
DataFrame,含有样品信息尽可能多的行bamSamples一个length(bamPaths)实例




bamRanges A GRanges instance with ranges defined on the spaces of the BAM files. Ranges are not
的BAM文件的空间上定义的范围bamRanges一个GRanges实例。范围不




bamExperiment A list() containing additional information about
bamExperiment列表()包含有关的其他信息


函数和方法----------Functions and methods----------

See 'Usage' for details on invocation.
在调用的详细信息,请参阅“用法”。

Constructor:
构造:




BamViews: Returns a BamViews object.
BamViews:返回一个BamViews对象。

Accessors:
存取:




bamPaths Returns a character() vector of BAM path names.
bamPaths返回了BAM的路径名的字符()的向量。




bamIndicies Returns a character() vector of BAM index path
bamIndicies返回BAM的索引路径的矢量字符()




bamSamples Returns a DataFrame instance with as many rows as length(bamPaths), containing sample
bamSamples返回许多行DataFramelength(bamPaths)实例,包含样本




bamSamples<- Assign a DataFrame instance with as many rows as length(bamPaths), containing sample
bamSamples < - 与DataFrame多行分配一个length(bamPaths)实例,包含示例




bamRanges Returns a GRanges instance with ranges defined on the spaces of the BAM files. Ranges are
bamRanges返回GRanges实例的BAM文件的空间上定义的范围。范围是




bamRanges<- Assign a GRanges instance with ranges defined on the spaces of the BAM files. Ranges are
bamRanges < - GRanges实例分配的BAM文件的空间上定义的范围。范围是




bamExperiment Returns a list() containing additional
bamExperiment返回一个列表()包含额外




names Return the column names of the BamViews
名称返回BamViews列名




names<- Assign the column names of the BamViews
名< - 分配BamViews列名




dimnames Return the row and column names of the
dimnames返回的行和列名




dimnames<- Assign the row and column names of the
dimnames < - 指定的行和列的名称

Methods:
方法:




"[" Subset the object by bamRanges or bamSamples.
“”子集bamRanges或bamSamples的对象。




scanBam Visit each path in bamPaths(file), returning the result of scanBam applied to the specified path. bamRanges(file) takes precedence over
scanBam访问bamPaths(file)每个路径,返回scanBam适用于指定的路径中的结果。 bamRanges(file)优先




countBam Visit each path in bamPaths(file), returning the result of countBam applied to the specified path. bamRanges(file) takes precedence over
countBam访问bamPaths(file)每个路径,返回countBam适用于指定的路径中的结果。 bamRanges(file)优先




readBamGappedAlignments Visit each path in bamPaths(file), returning the result of readBamGappedAlignments applied to the specified path. When index is missing, it is set equal to bamIndicies(file). Only reads in bamRanges(file) are returned (if param is supplied, bamRanges(file) takes precedence over bamWhich(param)). The return value is a SimpleList, with elements of the list corresponding to each path. bamSamples(file) is available as elementMetadata of the returned
readBamGappedAlignments访问bamPaths(file)每个路径,返回readBamGappedAlignments适用于指定的路径中的结果。当index丢失,这是设置平等bamIndicies(file)。只读取bamRanges(file)返回(param如果提供,bamRanges(file)接管bamWhich(param)优先)。返回值是一个SimpleList每个路径列表中相应的元素。 bamSamples(file)是elementMetadata返回




show Compactly display the object.
显示紧显示对象。


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


Martin Morgan



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

readBamGappedAlignments. The GenomicRanges package is where the summarizeOverlaps method originates.
readBamGappedAlignments。 GenomicRanges包summarizeOverlaps方法的起源。


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



fls <- list.files(system.file("extdata", package="Rsamtools"),
                  "\\.bam$", full=TRUE)
rngs <- GRanges(seqnames = Rle(c("chr1", "chr2"), c(9, 9)),
                ranges = c(IRanges(seq(10000, 90000, 10000), width=500),
                           IRanges(seq(100000, 900000, 100000), width=5000)),
                Count = seq_len(18L))
v <- BamViews(fls, bamRanges=rngs)
v
v[1:5,]
bamRanges(v[c(1:5, 11:15),])
bamDirname(v) <- getwd()
v

bv <- BamViews(fls,
               bamSamples=DataFrame(info="test", row.names="ex1"),
               auto.range=TRUE)
aln <- readBamGappedAlignments(bv)
aln
aln[[1]]
aln[colnames(bv)]
elementMetadata(aln)

##---------------------------------------------------------------------------##[#------------------------------------------------- --------------------------#]
## How to use summarizeOverlaps with a BamViews object.[#如何使用与BamViews对象的summarizeOverlaps的。]
fls = list.files(system.file("extdata",package="GenomicRanges"),
                 recursive=TRUE, pattern="*bam$", full=TRUE)
bfs <- BamViews(fls)

## "features" will be the argument for an "annotations" object (GRanges[#“功能”将是一个“注释”的对象(农庄参数]
## or GRangesList object.[#或GRangesList的对象。]
group_id <- c("A", "B", "C", "C", "D", "D", "E", "F", "G", "H", "H")
features <- GRanges(
    seqnames = Rle(c("chr2L", "chr2R", "chr2L", "chr2R", "chr2L", "chr2R",
        "chr2L", "chr2R", "chr2R", "chr3L", "chr3L")),
    strand = strand(rep("+", length(group_id))),
    ranges = IRanges(
        start=c(1000, 2000, 3000, 3600, 7000, 7500, 4000, 4000, 3000, 5000, 5400),
        width=c(500, 900, 500, 300, 600, 300, 500, 900, 500, 500, 500)),
   DataFrame(group_id)
)
## Then call the method:[#然后调用该方法:]
summarizeOverlaps(features, bfs, mode = Union, ignore.strand=TRUE)


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


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

使用道具 举报

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

本版积分规则

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

GMT+8, 2025-1-25 03:41 , Processed in 0.036416 second(s), 15 queries .

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

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