get_total_reads: Gets total number of mapped reads from the 'idxstats' file

View source: R/process_reads.R

get_total_readsR Documentation

Gets total number of mapped reads from the idxstats file

Description

Loads the idxstats file, and counts the total number of mapped reads generated by bam_sort_index_stats.

Usage

get_total_reads(
  idxstats_file,
  select_chr = TRUE,
  chrs = paste0("chr", c(1:22))
)

Arguments

idxstats_file

idxstats file.

select_chr

Logical. If TRUE, counts reads in chromosomes specified in ‘chrs’. Otherwise, uses all chromosomes in idxstats_file.

chrs

Chromosomes to be included (default: chr1, ..., chr22).

Value

The total number of mapped reads.

Examples

## Not run: 
total_mapped_reads <- get_total_reads('sample.bam.idxstats.txt')

## End(Not run)

HarteminkLab/TOP documentation built on July 27, 2023, 6:14 p.m.