readBam {ORFik} | R Documentation

## Custom bam reader

### Description

Safer version that handles the most important error done. In the future will use a faster .bam loader for big .bam files in R.

### Usage

    readBam(path, chrStyle = NULL)

### Arguments

`path` | a character path to .bam file. If paired end bam files, input must be a data.table with two columns (forward and reverse) and one row: if paired end reads in single bam file: forward contains paired end bam file path, reverse must be either "paired-end" or "" (single end). if paired end reads split in two files: forward contains paired end bam file path (R1), reverse must be paired end bam file path (R2 file), this is a rare case If all are single-end or you don't need to load data as paired end, the reverse column can be skipped.
`chrStyle` | a GRanges object, TxDb, FaFile, or a `seqlevelsStyle` (Default: NULL) to get seqlevelsStyle from. Is chromosome 1 called chr1 or 1, is mitocondrial chromosome called MT or chrM etc. Will use 1st seqlevel-style if more are present. Like: c("NCBI", "UCSC") -> pick "NCBI"

### Value

a `GAlignments` object of bam file

### See Also

Other utils: `bedToGR()`, `convertToOneBasedRanges()`, `export.bed12()`, `export.wiggle()`, `fimport()`, `findFa()`, `fread.bed()`, `optimizeReads()`, `readWig()`

### Examples

    bam_file <- system.file("extdata", "ribo-seq.bam", package = "ORFik")
    readBam(bam_file, "UCSC")

[Package ORFik version 1.8.6 Index]