read.bam: Reads a BAM file using the Rsamtools package and manipulates...

Description Usage Arguments Details Value Author(s) See Also Examples

Description

The read.bam function reads all alignments between two points from a particular chromosome/reference sequence. A variety of manipulations are performed, including conversion of the read data into a data.frame.

Usage

1
read.bam(bamfile = NULL, chr = NULL, start = 1, end = 1e+07, what = c("qname", "flag", "rname", "strand", "pos", "qwidth", "mapq", "cigar", "mrnm", "mpos", "isize", "seq"), tag = c("NM"), removeN = TRUE)

Arguments

bamfile

Full path to the indexed BAM file

chr

The name of the chromosome from which alignments should be extracted

start

The start position from which alignments should be extracted

end

The end position from which alignments should be extracted

what

A vector of column names to be extracted. See scanBamWhat. At present allowed values are any subset of c("qname","flag","rname","strand","pos","qwidth","mapq","cigar","mrnm","mpos","isize","seq","qual"). We recommend sticking with the default.

tag

Tags to be exctracted from the BAM file. See scanBam. Many different tags are used by the various aligners that exist, and we recommend referring to the manual of your chosen aligner to discover which tags are used, and which you may find useful.

removeN

Logical. Whether or not to remove all sequences that contain Ns

Details

A wrapper around scanBam to read in a subset of aliignments from a BAM file and return those as a data.frame.

Value

A data frame with reads/alignments as rows and columns defined by the "what" and "tag" columns.

Author(s)

Mick Watson

See Also

scanBam, clip.bam

Examples

1
2
3
## Not run: infile <- system.file("data/SRR389184_vs_SINV_sorted.bam", package="viRome")
## Not run: bam <- read.bam(bamfile=infile, chr="SINV", start=1, end=11703, removeN=TRUE)
## Not run: bam[1:10,]

mw55309/viRome_legacy documentation built on Dec. 21, 2021, 11:05 p.m.