SamToBam: Convert sam format to bam format.

Description Usage Arguments Details Value Author(s) See Also Examples

Description

This function convert a sam file into a bam file.

Usage

1
2
3
4
5
6
atacSam2Bam(atacProc, samInput = NULL, bamOutput = NULL, ...)

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

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

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.

...

Additional arguments, currently unused.

Details

The sam file wiil be automatically obtained from object(atacProc) or input by hand. bamOutput can be ignored.

Value

An invisible ATACProc-class object scalar for downstream analysis.

Author(s)

Wei Zhang

See Also

atacBowtie2Mapping atacBam2Bed atacBamSort

Examples

1
2
3
4
5
6
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)

esATAC documentation built on Nov. 8, 2020, 6:58 p.m.