readBam: readBam

Description Usage Arguments Details Value Author(s) References Examples

Description

Reads a bam file through RSamtools, and converts it into a data frame of class DataFrame

Usage

1
readBam(file_name, tags = character(0))

Arguments

file_name

Character string of bam file location

tags

Bam tags to import into the data frame. By default it only takes the standard values if none are given.

Details

This function formalizes what had been described in the RSamtools documentation and makes it easier to compute the downstream functions in this package.

Value

Returns the bam file contents in a readable dataframe format.

Author(s)

Diana H.P. Low

References

RSamtools package

Examples

1
2
bam.files <- dir(system.file("extdata", package = "ssviz"), full = TRUE, patt = "bam$")
ctrlbam <- readBam(bam.files[1])

Example output

Loading required package: Rsamtools
Loading required package: GenomeInfoDb
Loading required package: BiocGenerics
Loading required package: parallel

Attaching package: 'BiocGenerics'

The following objects are masked from 'package:parallel':

    clusterApply, clusterApplyLB, clusterCall, clusterEvalQ,
    clusterExport, clusterMap, parApply, parCapply, parLapply,
    parLapplyLB, parRapply, parSapply, parSapplyLB

The following objects are masked from 'package:stats':

    IQR, mad, sd, var, xtabs

The following objects are masked from 'package:base':

    Filter, Find, Map, Position, Reduce, anyDuplicated, append,
    as.data.frame, cbind, colMeans, colSums, colnames, do.call,
    duplicated, eval, evalq, get, grep, grepl, intersect, is.unsorted,
    lapply, lengths, mapply, match, mget, order, paste, pmax, pmax.int,
    pmin, pmin.int, rank, rbind, rowMeans, rowSums, rownames, sapply,
    setdiff, sort, table, tapply, union, unique, unsplit, which,
    which.max, which.min

Loading required package: S4Vectors
Loading required package: stats4

Attaching package: 'S4Vectors'

The following object is masked from 'package:base':

    expand.grid

Loading required package: IRanges
Loading required package: GenomicRanges
Loading required package: Biostrings
Loading required package: XVector

Attaching package: 'Biostrings'

The following object is masked from 'package:base':

    strsplit

Loading required package: reshape

Attaching package: 'reshape'

The following objects are masked from 'package:S4Vectors':

    expand, rename

Loading required package: ggplot2
Loading required package: RColorBrewer

ssviz documentation built on Nov. 8, 2020, 5:53 p.m.