Experimental golang bindings to the native GenomicsDB library. Only queries are supported for now. For importing vcf files into GenomicsDB, use the command line tools - vcf2genomicsdb
or gatk GenomicsDBImport
.
Installation : Only Linux and MacOS are supported
This step is required to install native genomicsdb if it is not available.
- system prerequisites for native genomicsdb are minimal, openssl/curl/zlib.
- verify that $GOPATH is included in the $PATH environment variable
- go install github.com/GenomicsDB/GenomicsDB-Go/install-genomicsdb@latest
- Invoke $GOPATH/bin/install-genomicsdb
- By default, the genomicsdb shared library is installed in
/usr/local
and may requiresudo
access. Set environment variableGENOMICSDB_INSTALL_DIR
to any custom location before invokingInstallGenomicsDB
for installing to locations other than/usr/local
. - Generates a helper
genomicdb.env
file that exportsPKG_CONFIG_PATH
for building andDYLD/LD_LIBRARY_PATH
for usage. This file can be sourced if the native GenomicsDB was installed in a custom location.
- By default, the genomicsdb shared library is installed in
- If a custom location was used for installing GenomicsDB in Step 1, either
- source genomicsdb.env or
- set environment variable
PKG_CONFIG_PATH
to$GENOMICSDB_INSTALL_DIR/lib/pkgconfig/genomicsdb.pc
- go get -u github.com/GenomicsDB/GenomicsDB-Go/bindings from a
go module
If a custom location was used for installing GenomicsDB in Step 1, either
- source genomicsdb.env or
- set environment variable
DYLD_LIBRARY_PATH
for MacOS orLD_LIBRARY_PATH
for Linux to include$GENOMICSDB_INSTALL_DIR/lib
.
#!/bin/bash
mkdir example-genomicsdb-go
pushd example-genomicsdb-go
go mod init example/example-genomicsdb-go
go get -u github.com/GenomicsDB/GenomicsDB-Go/bindings
cat > main.go << EOF
package main
import (
"log"
gdb "github.com/GenomicsDB/GenomicsDB-Go/bindings"
)
func main() {
log.Println("Got GenomicsDB version: ", gdb.GetVersion())
}
EOF
go build
go run .
popd
GenomicsDB-Go/bindings
and GenomicsDB-Go/install_genomicsdb
are separate modules, so both bindings and install_genomicsdb folders have to be git tagged separately for go install
and go get
to function. For example, create bindings/v0.0.1
and install_genomicsdb/v0.0.1
git tags to get the steps for users outlined above to work. Note: If only one of the modules is updated, bump the version only associated with that module.