preprocessBam {epialleleR}R Documentation

preprocessBam

Description

This function reads and preprocesses BAM file.

Usage

preprocessBam(bam.file, min.mapq = 0, skip.duplicates = FALSE, verbose = TRUE)

Arguments

bam.file

BAM file location string.

min.mapq

non-negative integer threshold for minimum read mapping quality (default: 0).

skip.duplicates

boolean defining if duplicate aligned reads should be skipped (default: FALSE). Option has no effect if duplicate reads were not marked by alignment software.

verbose

boolean to report progress and timings (default: TRUE).

Details

The function loads and preprocesses BAM file, saving time when multiple analyses are to be performed on large input files. Currently, Rsamtools package is used to read the data, but this will change in the future with a goal of speeding up this step even further.

This function is also used internally when BAM file location is supplied as an input for other 'epialleleR' methods.

'preprocessBam' automatically determines whether BAM is derived from single-end or paired-end sequencing. When the latter is the case, paired reads are merged so that the overlapping fragments of second read are clipped (because quality of the second read is usually lower than of the first). These merged reads are then processed as a single entity in all 'epialleleR' methods.

Please also note that for all its methods, 'epialleleR' requires methylation call string to be present in a BAM file - i.e. methylation calling must be performed after read mapping/alignment by your software of choice.

Value

data.table object containing preprocessed BAM data.

See Also

generateCytosineReport for methylation statistics at the level of individual cytosines, generateBedReport for genomic region-based statistics, generateVcfReport for evaluating epiallele-SNV associations, generateBedEcdf for analysing the distribution of per-read beta values, and 'epialleleR' vignettes for the description of usage and sample data.

Sequence Alignment/Map format specifications, duplicate alignments marking by Samtools and Illumina DRAGEN Bio IT Platform.

Examples

  capture.bam <- system.file("extdata", "capture.bam", package="epialleleR")
  bam.data    <- preprocessBam(capture.bam)

[Package epialleleR version 1.0.0 Index]