readBamGappedAlignments(Rsamtools)
readBamGappedAlignments()所属R语言包:Rsamtools
Reading GappedAlignments or GappedReads objects from a BAM file
从BAM文件阅读GappedAlignments或GappedReads对象
译者:生物统计家园网 机器人LoveR
描述----------Description----------
Read a BAM file as a GappedAlignments or GappedReads object.
阅读作为的1 GappedAlignments或GappedReads对象的BAM的文件。
用法----------Usage----------
readBamGappedAlignments(file, index=file, use.names=FALSE, param=NULL)
readBamGappedReads(file, index=file, use.names=FALSE, param=NULL)
参数----------Arguments----------
参数:file
The character(1) file name of the "BAM" file to be processed.
要处理的字符(1)咣当文件的文件名。
参数:index
The character(1) name of the index file of the 'BAM' file being processed; this is given without the '.bai' extension.
字符(1)咣当正在处理的文件的索引文件的名称,这是没有的“白”。扩展。
参数:use.names
Use the query template names (QNAME field) as the names of the returned object? If not (the default), then the returned object has no names.
返回的对象的名称,使用查询模板名称(QNAME领域)? (默认),如果没有,则返回的对象没有名称。
参数:param
NULL or an instance of ScanBamParam. Like for scanBam, this influences what fields and which records are imported. However, please note that the fields specified thru this ScanBamParam object will be loaded in addition to any field required for generating the returned object (GappedAlignments or GappedReads object) and will be stored in its elementMetadata part. By default (i.e. param=NULL), no additional field is loaded and the flag used is scanBamFlag(isUnmappedQuery=FALSE, isDuplicate=FALSE) (i.e. all the records corresponding to mapped reads that are not PCR or optical duplicates are loaded).
NULL或ScanBamParam的实例。 scanBam一样,这会影响哪些领域和记录都是进口的。然而,请注意,直通这个ScanBamParam对象中指定的字段将被载入除了产生返回的对象(GappedAlignments或GappedReads对象),将存储在其elementMetadata部分所需的任何领域。默认情况下(即param=NULL),不需要额外的字段被加载并使用该标志是scanBamFlag(isUnmappedQuery=FALSE, isDuplicate=FALSE)(即所有记录读取相应的映射的不PCR或光学重复加载)。
Details
详情----------Details----------
See ?GappedAlignments-class for a description of GappedAlignments objects.
看到?GappedAlignments-classGappedAlignments对象的描述。
See ?GappedReads-class for a description of GappedReads objects.
看到?GappedReads-class的GappedReads对象的描述。
See ?scanBam for a description of the arguments.
看到?scanBam参数的描述。
值----------Value----------
A GappedAlignments object for readBamGappedAlignments.
一个GappedAlignments反对readBamGappedAlignments。
A GappedReads object for readBamGappedReads.
一个readBamGappedReadsGappedReads对象。
注意----------Note----------
BAM records corresponding to unmapped reads or to reads that are PCR or optical duplicates are always ignored.
BAM未映射读取或以读取相应的记录,PCR或光学重复总是被忽略。
作者(S)----------Author(s)----------
H. Pages
参见----------See Also----------
GappedAlignments-class, GappedReads-class, scanBam, ScanBamParam
GappedAlignments级,GappedReads级,scanBam,ScanBamParam
举例----------Examples----------
## Simple use:[#简单的使用:]
bamfile <- system.file("extdata", "ex1.bam", package="Rsamtools")
galn1 <- readBamGappedAlignments(bamfile)
galn1
names(galn1)
## Using the 'use.names' arg:[#使用“use.names参数:]
galn2 <- readBamGappedAlignments(bamfile, use.names=TRUE)
galn2
head(names(galn2))
## Using the 'param' arg to load additional BAM fields:[#使用“参数”参数来加载额外的BAM领域:]
param <- ScanBamParam(what=c("qual", "flag"))
galn3 <- readBamGappedAlignments(bamfile, param=param)
galn3
elementMetadata(galn3)
## Using the 'param' arg to load reads from particular regions.[#使用“参数”参数加载读取特定区域。]
## Note that if we weren't providing a 'what' argument here, all the[#注意,如果我们不能提供一个什么的说法在这里,所有的]
## BAM fields would be loaded:[#BAM的字段将被加载:]
which <- RangesList(seq1=IRanges(1000, 2000),
seq2=IRanges(c(100, 1000), c(1000, 2000)))
param <- ScanBamParam(which=which)
galn4 <- readBamGappedAlignments(bamfile, param=param)
galn4
## Note that a given record is loaded one time for each region it[#注意,给定的记录加载一次为每个区域]
## belongs to (this is a scanBam() feature, readBamGappedAlignments()[#(这是一个scanBam()功能,readBamGappedAlignments(属于)]
## is based on scanBam()):[#基于scanBam()):]
which <- IRangesList(seq2=IRanges(c(1563, 1567), width=1))
param <- ScanBamParam(which=which)
galn5 <- readBamGappedAlignments(bamfile, param=param)
galn5
## Using the 'param' arg to load tags. Except for MF and Aq, the tags[#使用“参数”参数加载标签。除MF和AQ,标签]
## specified below are predefined tags (see the SAM Spec for the list[#指定以下预定义的标签(见列表中的SAM规格]
## of predefined tags and their meaning).[#预定义的标签和它们的含义)。]
param <- ScanBamParam(tag=c("MF", "Aq", "NM", "UQ", "H0", "H1"),
what="isize")
galn6 <- readBamGappedAlignments(bamfile, param=param)
elementMetadata(galn6) # "tag" cols always after "what" cols[cols的“标签”总是在“做什么”COLS]
## readBamGappedReads():[,#readBamGappedReads():]
greads1 <- readBamGappedReads(bamfile)
greads1
names(greads1)
qseq(greads1)
greads2 <- readBamGappedReads(bamfile, use.names=TRUE)
greads2
head(names(greads2))
转载请注明:出自 生物统计家园网(http://www.biostatistic.net)。
注:
注1:为了方便大家学习,本文档为生物统计家园网机器人LoveR翻译而成,仅供个人R语言学习参考使用,生物统计家园保留版权。
注2:由于是机器人自动翻译,难免有不准确之处,使用时仔细对照中、英文内容进行反复理解,可以帮助R语言的学习。
注3:如遇到不准确之处,请在本贴的后面进行回帖,我们会逐渐进行修订。
|