sort_index_idxstats_bam: Sorts, indexes the BAM file, and retrieves the 'idxstats'.

View source: R/process_reads.R

sort_index_idxstats_bamR Documentation

Sorts, indexes the BAM file, and retrieves the idxstats.

Description

Sorts and indexes the BAM file, and retrieves the idxstats (summary of the number of mapped reads on every chromosome) using Rsamtools package.

Usage

sort_index_idxstats_bam(
  bam_file,
  sorted_bam_file,
  sort = TRUE,
  index = TRUE,
  idxstats = TRUE
)

Arguments

bam_file

Input BAM file.

sorted_bam_file

Output file name for sorted BAM file if sort=TRUE.

sort

Logical. If TRUE, sorts the BAM file.

index

Logical. If TRUE, indexes the BAM file.

idxstats

Logical. If TRUE, retrieves idxstats summary of the number of mapped reads in each chromosome.

Examples

## Not run: 
# Sorts, indexes the BAM file, and retrieves the idxstats.
sort_index_idxstats_bam('example.bam', sort=TRUE, index=TRUE, idxstats=TRUE)

# Indexes the BAM file, and retrieves the idxstats, using sorted BAM file.
sort_index_idxstats_bam('example.sorted.bam', sort=FALSE, index=TRUE, idxstats=TRUE)

## End(Not run)

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