heruji / libbwa

Shared library of Burrows-Wheeler Aligner (BWA)

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

libbwa

libbwa is a shared library of Burrows-Wheeler Aligner (BWA) forked from original repository.

Build Status

BWA is a great software in bioinformatics which efficiently maps sequences against a large reference genome. BWA is, however, implemented as a command-line tool, and therefore, it is hard-to-use in programs and it lacks reusability. The purpose of libbwa is providing a shared library of BWA for calling BWA functions from your programs.

To tracking original BWA changes, libbwa is designed in order that original codes are not modified as much as possible. In addition, it uses CMake as a build tool instead of Make for general platforms and prepares unit tests for ensuring the software safety.

Requirements

  • CMake
  • zlib

Installation

$ mkdir build
$ cd build
$ cmake ..
$ make
$ make install

Usage

Include libbwa.h in your source and compile it with libbwa library. libbwa wraps main BWA commands such as index, mem, etc.

#include <libbwa.h>

void index_example(void)
{
    char *db = "path/to/reference.fa";
    char *prefix = "path/to/reference.fa";

    // Equivalent to `bwa index` command
    libbwa_index(db, prefix, LIBBWA_INDEX_ALGO_AUTO, 0);
}

void mem_example(void)
{
    char *db = "path/to/reference.fa";
    char *read = "path/to/read.fq";
    char *out = "path/to/out.sam";

    // Create option struct
    libbwa_mem_opt *opt = libbwa_mem_opt_init();

    // Equivalent to `bwa mem` command
    libbwa_mem(db, read, NULL, out, opt);

    // Release option
    libbwa_mem_opt_destroy(opt);
}

Unfortunately libbwa reference has not been provided yet. Please check libbwa.h for more information.

Tests

CUnit is required to run tests. If you want to run tests, cmake with BUILD_TESTING option.

$ cmake -DBUILD_TESTING=ON ..
$ make
$ make test

License

Copyright 2014 Xcoo, Inc.

libbwa is released under GPLv3. libbwa is based heavily on BWA by Heng Li.

About

Shared library of Burrows-Wheeler Aligner (BWA)

License:GNU General Public License v3.0


Languages

Language:C 90.9%Language:JavaScript 7.1%Language:C++ 1.8%Language:Perl 0.2%