%\VignetteEngine{knitr::knitr} %\VignetteIndexEntry{Motivation and Use of Rhtslib}

Motivation and Use of Rhtslib

This package provides a compiled version of the C htslib for high-throughput seqeunce analysis. It is primary useful to developers of other R packages who want to use the htslib facilities in the C code of their own packages.

Motivation

There are several advantages to using Rhtslib, rather than requiring an explict user system dependency on htslib directly.

Use

Packages with C code should create a file src/Makevars with the following lines

PKG_CFLAGS+=$(shell echo 'Rhtslib::pkgconfig("PKG_CFLAGS")'|\
    "${R_HOME}/bin/R" --vanilla --slave)
PKG_LIBS+=$(shell echo 'Rhtslib::pkgconfig("PKG_LIBS")'|\
    "${R_HOME}/bin/R" --vanilla --slave)

In C or C++ code files, use standard techniques, e.g., #include "htslib.h". Header files are available at

{R headers} system.file(package="Rhtslib", "include")

Implementation notes

The procedure above links to the shared version of the htslib library. This will work on Linux, Mac, and Windows OS, but some tweaks may be needed on other platforms; please let me know of incompatibilities.



dtenenba/Rhtslib documentation built on May 15, 2019, 4:55 p.m.