Learn R Programming

SGSeq (version 1.0.6)

getBamInfo: Obtain alignment information from BAM files

Description

Obtain paired-end status, median aligned read length, median aligned insert size and library size from BAM file.

Usage

getBamInfo(sample_info, yieldSize = NULL, BPPARAM = MulticoreParam(1))

Arguments

sample_info
data.frame with sample information including mandatory character columns “sample_name” and “file_bam”.
yieldSize
Number of records used for obtaining alignment information, or NULL for all records
BPPARAM
BiocParallelParam for processing samples in parallel, defaults to MulticoreParam(1)

Value

sample_info with additional columns “paired_end”, “read_length”, “frag_length”, and “lib_size” if yieldSize is NULL

Details

Alignment information can be inferred from a subset of BAM records by setting the number of records via argument yieldSize. Note that library size can only be obtained if yieldSize is NULL.

Examples

Run this code
dir <- system.file("extdata", package = "SGSeq")
si$file_bam <- file.path(dir, "bams", si$file_bam)
si <- si[, c("sample_name", "file_bam")]
si_complete <- getBamInfo(si)

Run the code above in your browser using DataLab