samtools_as_bam {FLAMES}R Documentation

Samtools as BAM

Description

Produces a compressed binary BAM file from a text based SAM file, using Rsamtools.

Usage

samtools_as_bam(sam_in, bam_out)

Arguments

sam_in

file path to the input SAM file

bam_out

file path to the output BAM file

Value

file path to the output BAM file.

Examples

temp_path <- tempfile()
bfc <- BiocFileCache::BiocFileCache(temp_path, ask = FALSE)
file_url <-
    "https://raw.githubusercontent.com/OliverVoogd/FLAMESData/master/data"
tmp_sam <- paste0(temp_path, "/tmp_sam.sam")
file.rename(bfc[[names(BiocFileCache::bfcadd(bfc, "Temp SAM", paste(file_url, "tmp_sam.sam", sep = "/")))]], tmp_sam)

samtools_as_bam(tmp_sam, tempfile(fileext = "bam"))

[Package FLAMES version 1.0.2 Index]