samtools_sort_index {FLAMES} | R Documentation |
Sort and index the given BAM file, using Rsamtools.
samtools_sort_index(bam_in, bam_out)
bam_in |
the file path to the BAM file to sort and index |
bam_out |
path to the output indexed BAM file. |
file path to the created BAM
temp_path <- tempfile() bfc <- BiocFileCache::BiocFileCache(temp_path, ask = FALSE) file_url <- "https://raw.githubusercontent.com/OliverVoogd/FLAMESData/master/data" genome_bam <- paste0(temp_path, "/align2genome.bam") file.rename(bfc[[names(BiocFileCache::bfcadd(bfc, "Genome BAM", paste(file_url, "align2genome.bam", sep = "/")))]], genome_bam) samtools_sort_index(genome_bam, tempfile(fileext = ".bam"))