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

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

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

                                        Parameters for scanning BAM files
                                         参数扫描的BAM文件

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

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

Use ScanBamParam() to create a parameter object influencing what fields and which records are imported from a (binary) BAM file. Use of which requires that a BAM index file (<filename>.bai) exists.
使用ScanBamParam()影响哪些领域和哪些记录(二进制)的BAM文件导入创建一个参数对象。使用which需要一个BAM索引文件(<filename>.bai)存在。


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



# Constructor
ScanBamParam(flag = scanBamFlag(), simpleCigar = FALSE,
    reverseComplement = FALSE, tag = character(0),
    what = character(0), which)

# Constructor helpers
scanBamFlag(isPaired = NA, isProperPair = NA, isUnmappedQuery = NA,
    hasUnmappedMate = NA, isMinusStrand = NA, isMateMinusStrand = NA,
    isFirstMateRead = NA, isSecondMateRead = NA, isNotPrimaryRead = NA,
    isValidVendorRead = NA, isDuplicate = NA)
scanBamWhat()

# Accessors
bamFlag(object, asInteger=FALSE)
bamFlag(object) &lt;- value
bamReverseComplement(object)
bamReverseComplement(object) &lt;- value
bamSimpleCigar(object)
bamSimpleCigar(object) &lt;- value
bamTag(object)
bamTag(object) &lt;- value
bamWhat(object)
bamWhat(object) &lt;- value
bamWhich(object)
bamWhich(object) &lt;- value

## S4 method for signature 'ScanBamParam'
show(object)

# Flag utils
bamFlagAsBitMatrix(flag)
bamFlagAND(flag1, flag2)
bamFlagTest(flag, value)



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

参数:flag
For ScanBamParam, an integer(2) vector used to filter reads based on their 'flag' entry. This is most easily created with the scanBamFlag() helper function.  For bamFlagAsBitMatrix, bamFlagTest an integer vector where each element represents a 'flag' entry.   
ScanBamParam,一个整数(2)向量用于过滤读取基于他们的“标志”条目。这是最容易创建的scanBamFlag()辅助功能。 bamFlagAsBitMatrix,bamFlagTest整数向量,其中每个元素代表“标志”条目。


参数:simpleCigar
A logical(1) vector which, when TRUE, returns only those reads for which the cigar (run-length encoded representation of the alignment) is missing or contains only matches / mismatches ('M').
逻辑(1)向量,为TRUE时,只返回那些读CIGAR(运行长度编码表示的对齐)丢失或包含只匹配/不匹配('M')。


参数:reverseComplement
A logical(1) vector which, when TRUE, returns the sequence and quality scores of reads mapped to the minus strand in the reverse complement (sequence) and reverse (quality) of the read as stored in the BAM file.
逻辑(1)向量,为TRUE时,返回读取的序列和质量分数在BAM文件存储映射逆补(序列)和反向(质量)读的负链。


参数:tag
A character vector naming tags to be extracted. A tag is an optional field, with arbitrary information, stored with each record. Tags are identified by two-letter codes, so all elements of tag must have exactly 2 characters.
命名标签来提取一个特征向量。标记是一个可选字段,每个记录存储,任意信息。标签是由两个字母组成的代码,所以tag所有元素的确定,必须有整整2个字符。


参数:what
A character vector naming the fields to return. scanBamWhat() returns a vector of available fields. Fields are described on the scanBam help page.
字符向量命名的字段返回。 scanBamWhat()返回一个可用字段的向量。领域scanBam帮助页描述。


参数:which
A GRanges, RangesList, RangedData, or missing object, from which a IRangesList instance will be constructed. Names of the IRangesList correspond to reference sequences, and ranges to the regions on that reference sequence for which matches are desired. Because data types are coerced to IRangesList, which does not include strand information (use the flag argument instead). Only records with a read overlapping the specified ranges are returned. All ranges must have ends less than or equal to 536870912.
一个GRanges,RangesList,RangedData,或缺少的对象,从IRangesList实例将被建造。 IRangesList名称对应参考序列和范围上,参考序列的比赛需要的区域。由于数据类型强制IRangesList,which不包括链信息(使用flag参数,而不是)。返回一个只读的记录,在指定的范围重叠。所有范围内必须有完小于或等于536870912。


参数:isPaired
A logical(1) indicating whether unpaired (FALSE), paired (TRUE), or any (NA) read should be returned.
逻辑(1)是否未成(FALSE),配对(真),或(NA)读应返回。


参数:isProperPair
A logical(1) indicating whether improperly paired (FALSE), properly paired (TRUE), or any (NA) read should be returned. A properly paired read is defined by the alignment algorithm and might, e.g., represent reads aligning to identical reference sequences and with a specified distance.
逻辑(1)(FALSE),说明是否不正确配对,正确配对(TRUE),应退还或任何(NA)的只读。一个正确配对的读取定义对齐算法和可能,例如,代表读取对准相同的参考序列,并与指定的距离。


参数:isUnmappedQuery
A logical(1) indicating whether unmapped (TRUE), mapped (FALSE), or any (NA) read should be returned.
逻辑(1)是否未映射(TRUE),映射(假),或(NA)读应返回。


参数:hasUnmappedMate
A logical(1) indicating whether reads with mapped (FALSE), unmapped (TRUE), or any (NA) mate should be returned.
逻辑(1)说明是否读取映射(FALSE),未映射(TRUE),应退还或任何(NA)的队友。


参数:isMinusStrand
A logical(1) indicating whether reads aligned to the plus (FALSE), minus (TRUE), or any (NA) strand should be returned.
逻辑(1)加(假),减号(TRUE),或应退还(NA)链是否读取对齐。


参数:isMateMinusStrand
A logical(1) indicating whether mate reads aligned to the plus (FALSE), minus (TRUE), or any (NA) strand should be returned.
逻辑(1)表示是否读取对齐队友加(假),减号(TRUE),或应退还(NA)链。


参数:isFirstMateRead
A logical(1) indicating whether the first mate read should be returned (TRUE) or not (FALSE), or whether mate read number should be ignored (NA).
逻辑(1)是否应第一队友读的返回(TRUE)或否(false),或者队友读是否应该被忽略(NA)的。


参数:isSecondMateRead
A logical(1) indicating whether the second mate read should be returned (TRUE) or not (FALSE), or whether mate read number should be ignored (NA).
逻辑(1)是否第二队友读应被返回(TRUE)或否(false),或者队友读是否应该被忽略(NA)的。


参数:isNotPrimaryRead
A logical(1) indicating whether reads that are primary (FALSE), are not primary (TRUE) or whose primary status does not matter (NA) should be returned. A non-primary read might result when portions of a read aligns to multiple locations, e.g., when spanning splice junctions).
逻辑(1)说明是否读小学(FALSE),是不是主要的(TRUE)或其主要地位没有问题(NA)应退还。非主读,可能会导致部分读取时对齐多个地点,例如,当跨越剪接路口)。


参数:isValidVendorRead
A logical(1) indicating whether invalid (FALSE), valid (TRUE), or any (NA) read should be returned. A 'valid' read is one flagged by the vendor as passing quality control criteria.
逻辑(1)说明是否无效(FALSE),有效(TRUE),或任何(NA)的读应返回。一个“有效”读标记传递的质量控制标准的供应商之一。


参数:isDuplicate
A logical(1) indicating that un-duplicated (FALSE), duplicated (TRUE), or any (NA) reads should be returned. 'Duplicated' reads may represent PCR or optical duplicates.
逻辑(1)表示,取消重复(假),复制(真),或任何(NA)的读取应退还。 “重复”的内容可能代表PCR或光学重复。


参数:object
An instance of class ScanBamParam.
实例类ScanBamParam。


参数:value
An instance of the corresponding slot, to be assigned to object or, for bamFlagTest, a character(1) name of the flag to test, e.g., &ldquo;isUnmappedQuery&rdquo;, from the arguments to scanBamFlag.
例如,一个相应的插槽被分配到object或bamFlagTest,character(1)名称测试的标志,如“isUnmappedQuery”,从参数到 scanBamFlag。


参数:asInteger
logical(1) indicating whether "flag" should be returned as an encoded integer vector (TRUE) or human-readable form (FALSE).
逻辑(1)指示是否应作为一个编码的整数向量(TRUE)或人类可读的形式(FALSE)返回标志。


参数:flag1, flag2
Integer vectors containing "flag" entries.
含有“国旗”条目的整数向量。


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

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


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




flag Object of class integer encoding flags to be kept when they have their '0' (keep0) or '1'
flag类integer编码保存的标志时,他们有他们0对象(keep0)或1




simpleCigar Object of class logical indicating, when TRUE, that only 'simple' cigars (empty or 'M') are
simpleCigarObject类的logical表示,如果为TRUE,只有“简单”的CIGAR(空或“M”)




reverseComplement Object of class logical indicating, when TRUE, that reads on the minus strand are to be
reverseComplementObject类的logical表明,当为TRUE,负链上读取




tag Object of class character indicating what
tag characterObject类的说明什么




what Object of class character indicating
what Object类的character表明




which Object of class RangesList indicating
which Object类的RangesList表明


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

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

Constructor:
构造:




ScanBamParam: Returns a ScanBamParam object. The which argument to the constructor can be one of several
ScanBamParam:返回ScanBamParam对象。参数which的构造可以是多种之一

Accessors:
存取:




bamTag, bamTag<- Returns or sets a character vector of
bamTag,bamTag < - 返回或设置一个character向量




bamWhat, bamWhat<- Returns or sets a character vector
bamWhat,bamWhat < - 返回或设置一个character向量




bamWhich, bamWhich<- Returns or sets a RangesList of bounds on reads to be extracted. A length 0 RangesList
<bamWhich,bamWhich  - 返回或设置一个RangesList的界限读取提取。一个长度为0RangesList




bamFlag, bamFlag<- Returns or sets an integer(2)
bamFlag,bamFlag < - 返回或设置一个integer(2)




bamSimpleCigar, bamSimpleCigar<- Returns or sets a logical(1) vector indicating whether reads without indels
bamSimpleCigar,bamSimpleCigar < - 返回或设置一个logical(1)向量表示是否没有INDELS读取




bamReverseComplement, bamReverseComplement<- Returns or sets a logical(1) vector indicating whether reads on the minus strand will be returned with sequence reverse complemented and
bamReverseComplement“,bamReverseComplement < - 返回或设置logical(1)向量表示是否读取负链将返回序列的反向补充和

Methods:
方法:




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


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


Martin Morgan



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

scanBam
scanBam


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


## defaults[#默认]
p0 <- ScanBamParam()

## subset of reads based on genomic coordinates[#读取的子集基于基因组坐标]
which <- RangesList(seq1=IRanges(1000, 2000),
                    seq2=IRanges(c(100, 1000), c(1000, 2000)))
p1 <- ScanBamParam(which=which)

## subset of reads based on 'flag' value[#读取的子集“标志的价值为基础]
p2 <- ScanBamParam(flag=scanBamFlag(isMinusStrand=FALSE))

## subset of fields[#字段的子集]
p3 <- ScanBamParam(what=c("rname", "strand", "pos", "qwidth"))
               
## use[#使用]
fl <- system.file("extdata", "ex1.bam", package="Rsamtools")
res <- scanBam(fl, param=p2)[[1]]
lapply(res, head)

## tags; NM: edit distance; H1: 1-difference hits[#标签;网管:编辑距离; H1的:1,差点击]
p4 <- ScanBamParam(tag=c("NM", "H1"), what="flag")
bam4 <- scanBam(fl, param=p4)
str(bam4[[1]][["tag"]])

## flag utils[#标志utils的]
flag <- scanBamFlag(isUnmappedQuery=FALSE, isMinusStrand=TRUE)
flag
bamFlagAsBitMatrix(flag)
flag4 <- bam4[[1]][["flag"]]
bamFlagAsBitMatrix(flag4[1:9])

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


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

使用道具 举报

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

本版积分规则

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

GMT+8, 2025-1-25 02:18 , Processed in 0.030728 second(s), 16 queries .

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

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