SamToBam: Convert sam format to bam format.

SamToBamR Documentation

Convert sam format to bam format.

Description

This function convert a sam file into a bam file.

Usage

atacSam2Bam(atacProc, samInput = NULL, bamOutput = NULL, isSort = TRUE, ...)

## S4 method for signature 'ATACProc'
atacSam2Bam(atacProc, samInput = NULL, bamOutput = NULL, isSort = TRUE, ...)

sam2bam(samInput, bamOutput = NULL, isSort = TRUE, ...)

Arguments

atacProc

ATACProc-class object scalar. It has to be the return value of upstream process: atacBowtie2Mapping.

samInput

Character scalar. Sam file input path.

bamOutput

Character scalar. Bam file output path. If ignored, bed file will be put in the same path as the sam file.

isSort

Logical scalar. Sort bam.

...

Additional arguments, currently unused.

Details

The parameter related to input and output file path will be automatically obtained from ATACProc-class object(atacProc) or generated based on known parameters if their values are default(e.g. NULL). Otherwise, the generated values will be overwrited. If you want to use this function independently, you can use bamToBed instead.

Value

An invisible ATACProc-class object scalar for downstream analysis.

Author(s)

Wei Zhang

See Also

atacBowtie2Mapping atacBam2Bed atacBamSort

Examples


library(R.utils)
sam_bz <- system.file("extdata", "Example.sam.bz2", package="esATAC")
sam_path <- as.vector(bunzip2(filename = sam_bz,
destname = file.path(getwd(), "Example.sam"),
ext="bz2", FUN=bzfile, remove = FALSE))
sam2bam(samInput = sam_path)


wzthu/esATAC documentation built on Aug. 12, 2022, 7:41 a.m.