getReadLength: Get read length

Description Usage Arguments Value Examples

View source: R/helper.R

Description

Gets the length of the first read in a BAM file

Usage

1
getReadLength(bam.files)

Arguments

bam.files

a character vector pointing to BAM files

Value

a numeric vector, one number per BAM file, the length of the first read in the file

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
# these next lines just write out a BAM file from R
# typically you would already have a BAM file
library(alpineData)
library(GenomicAlignments)
library(rtracklayer)
gap <- ERR188088()
dir <- system.file(package="alpineData", "extdata")
bam.file <- c("ERR188088" = file.path(dir,"ERR188088.bam"))
export(gap, con=bam.file)

getReadLength(bam.file)

alpine documentation built on Nov. 8, 2020, 7:25 p.m.