load_BAM: Load .BAM file into R as tibble

View source: R/load_BAM.R

load_BAMR Documentation

Load .BAM file into R as tibble

Description

This function reads alignment data from a .BAM file and formats it as a tibble (data frame) in R. It allows for the selection of specific genomic regions by specifying chromosomes and positions, and it extracts relevant alignment data including tags for further analysis. The function also includes processing of UMI tags and correction for hard clips in the CIGAR strings.

Usage

load_BAM(BamPath, chr = NULL, pos = NULL)

Arguments

BamPath

The file path to the .BAM file to be loaded.

chr

A vector of chromosome identifiers indicating the chromosomes of interest for the analysis. (strings)

pos

A vector of numeric positions indicating the specific locations of interest within the chromosomes. (numeric)

Value

A tibble (data frame) containing the extracted alignment data from the .BAM file, including processed UMI features and genomic positions, as well as any necessary corrections for alignment issues such as hard clipping.


JakobPedersenLab/dreams documentation built on Feb. 2, 2024, 3:14 p.m.