SCSamToBam: Convert sam format to bam format.

SCSamToBamR Documentation

Convert sam format to bam format.

Description

This function convert a sam file into a bam file.

Usage

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

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

scSam2bam(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/wzzw documentation built on Aug. 13, 2022, 7:11 a.m.