Learn R Programming

SGSeq (version 1.2.2)

getBamInfo: Obtain library information from BAM files

Description

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

Usage

getBamInfo(sample_info, yieldSize = NULL, cores = 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 library information, or NULL for all records
cores
Number of cores available for parallel processing

Value

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

Details

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

Examples

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

Run the code above in your browser using DataLab