Title: | C++ Library for OpenMP-based multi-threaded sequential profiling of Binary Alignment Map (BAM) files |
---|---|
Description: | This packages provides C++ header files for developers wishing to create R packages that processes BAM files. ompBAM automates file access, memory management, and handling of multiple threads 'behind the scenes', so developers can focus on creating domain-specific functionality. The included vignette contains detailed documentation of this API, including quick-start instructions to create a new ompBAM-based package, and step-by-step explanation of the functionality behind the example packaged included within ompBAM. |
Authors: | Alex Chit Hei Wong [aut, cre, cph] |
Maintainer: | Alex Chit Hei Wong <[email protected]> |
License: | MIT + file LICENSE |
Version: | 1.11.0 |
Built: | 2024-11-29 06:41:02 UTC |
Source: | https://github.com/bioc/ompBAM |
Although various tools for multi-threaded BAM processing (samtools, sambamba) are available, currently there are none available to the R/Bioconductor environment. Parallelism in R is achieved using BiocParallel or related packages. Typical alternatives include processing multiple BAM files, each using a single core. Although easy to set up, memory-intensive applications limit such approaches. ompBAM is a header-only C++ library based on OpenMP, allowing developers to implement OpenMP-based parallelism for the sequential reading of BAM files. ompBAM makes it easy by handling all the parallel file-access and bgzf decompression, allowing developers to focus on multi-threaded handling of individual reads.
For a quick start guide and a full list of functionality, refer to
the vignette
vignette("ompBAM-API-Docs",
package = "ompBAM")
Alex Chit Hei Wong
Useful links:
Two types of BAM files are available. "Unsorted" is an unsorted BAM file of paired RNA-seq of THP1 cell culture from Green et al (GSE130011, GSM3729250), truncated to the first 10k reads. "scRNAseq" is a single cell 10X chromium V2 BAM file (sorted). It is sample E3.5_Rep1 from Nowotschin et al (GSE123046 / GSM3494334), truncated to the first 50k reads.
example_BAM(dataset = c("Unsorted", "scRNAseq"))
example_BAM(dataset = c("Unsorted", "scRNAseq"))
dataset |
Returns the path to either the "Unsorted" or "scRNAseq" BAM. |
A file path to the specified BAM file.
example_BAM("Unsorted")
example_BAM("Unsorted")
Installs the ompBAMExample package included with the ompBAM package
install_ompBAM_example()
install_ompBAM_example()
This function installs the ompBAMExample package located inside the 'examples' subfolder of ompBAM. It uses devtools::load_all() to simulate package creation. After running this function to compile ompBAMExample(), users can run the example functions contained therein.
None.
# The directory containing the source code is given by the path here print(system.file(file.path('examples', "ompBAMExample"), package = 'ompBAM')) # Install the ompBAMExample package install_ompBAM_example()
# The directory containing the source code is given by the path here print(system.file(file.path('examples', "ompBAMExample"), package = 'ompBAM')) # Install the ompBAMExample package install_ompBAM_example()
This function creates a new package in the given directory (unless one already exists). It then sets up the requisite dependencies and 'Make' and 'configure' files so that the source code will successfully compile and link to the appropriate external libraries (OpenMP, zlib) required for ompBAM. All 3 major platforms (Linux, MacOS and Windows) are supported, although MacOS users must first install the required OpenMP libraries first. See details below.
use_ompBAM(path = ".")
use_ompBAM(path = ".")
path |
The path to the desired directory in which to set up a new R package. The directory name is assumed to be the package name. |
OpenMP is natively supported on Linux and Windows but
not on MacOS. To compile ompBAM_based
packages with OpenMP on MacOS, users should install the requisite OpenMP
libraries. An easy way to do this would be to run: brew install libomp
.
For details, refer to
this guide
None
path <- file.path(tempdir(), "myPkgName") use_ompBAM(path)
path <- file.path(tempdir(), "myPkgName") use_ompBAM(path)