bam2stat: Get basic BAM file statistics

View source: R/bam2stat.R

bam2statR Documentation

Get basic BAM file statistics

Description

This function takes as an input aligned reads in BAM and exports some useful statistics like depth of coverage and percentage of genome being coverged by reads.

Usage

bam2stat(
  bamfile,
  bamindex = paste0(bamfile, ".bai"),
  chromosomes = NULL,
  chunkSize = NULL,
  min.mapq = 10,
  filt.flag = 3328,
  filt.alt = FALSE
)

Arguments

bamfile

Bamfile with aligned reads.

bamindex

Bam-index file with or without the .bai ending. If this file does not exist it will be created and a warning is issued.

chromosomes

If only a subset of the chromosomes should be binned, specify them here.

chunkSize

Set for big BAMs to process them in smaller chunks.

min.mapq

Minimum mapping quality when importing from BAM files.

filt.flag

Filter out reads with a given flag.

filt.alt

Set to TRUE if you want to filter out alternative alignments defined in 'XA' tag.

Value

data.frame

Author(s)

David Porubsky


daewoooo/primatR documentation built on Oct. 22, 2024, 9:41 p.m.