Giter Club home page Giter Club logo

lib2bit's Introduction

Build Status

A C library for accessing 2bit files. This is still a work in process. Note that functionality is mostly aimed at what will be needed in a python wrapper.

Introduction

lib2bit is a C-based library for accessing 2bit files. At the moment, only reading 2bit files is supported (there are no plans to change this, though if someone wants to submit a pull request...). Though it's unlikely to matter,

The motivation for this project is due to needing fast access to 2bit files in deepTools. Originally, we were using bx-python for this, which had the benefit of being easy to install and pretty quick. However, that wasn't compatible with python3, so we switched to twobitreader. While doing everything we needed and working under both python2 and python3, it turns out that it has terrible performance (up to 1000x slow down in computeGCBias). Since we'd like to have our cake and eat it too, I began wrote a C library for convenient 2bit access and then a python wrapper around it to work in python2 and 3.

Installation

2bit files are very simple and there are no dependencies. Simply typing make should suffice for compilation. To install into a specific path (the default is /usr/local):

make install prefix=/some/where/else

lib2bit.so and lib2bit.a will then be in /some/where/else/lib and 2bit.h in /some/where/else/include.

Example

See the test/ directory for an example of using the library.

lib2bit's People

Contributors

dpryan79 avatar mmokrejs avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

lib2bit's Issues

Really memory map files?

Does it really make sense to memory map 2bit files? I should profile this with/without doing so, since not doing this would save a bunch of memory.

twobitFrequency() is inefficient

The twobitFrequency() function works, but it's terribly inefficient. If Ns are only ever represented as T in 2bit files then writing a more memory efficient version should be quite doable.

Skipping lib2bit.a and using only lib2bit.so? [Documentation issue mostly I think]

Hey there,

Right now when doing "make" and "make install" we instlal both
lib2bit.a and lib2bit.so. I am not sure I will need the lib2bit.a
though. Would there be a possibility to add a flag to the
Makefile, e. g. to skip building the .a file or remove it?

It's not a big issue - I can manually remove the .a file or
do so via scripts (e. g. ruby compiling lib2bit for me,
and then at post-installation remove the lib2bit.a file).

Rationale: Personally I try to use .so files when possible,
unless it is a statically compiled program. I have had
some issues with .a files before, in particular "relocation
errors" due to -fPIC, such as in bzip2.a or similar files. But
as said, it's no big deal, I can remove it just fine after
make install.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.