Skip to main content

Compact Bit-Sliced Signature Index (COBS)

Project description

Compact Bit-Sliced Signature Index (COBS)

COBS (COmpact Bit-sliced Signature index) is a cross-over between an inverted index and Bloom filters. Our target application is to index k-mers of DNA samples or q-grams from text documents and process approximate pattern matching queries on the corpus with a user-chosen coverage threshold. Query results may contain a number of false positives which decreases exponentially with the query length and the false positive rate of the index determined at construction time. COBS' compact but simple data structure outperforms other indexes in construction time and query performance with Mantis by Pandey et al. in second place. However, unlike Mantis and other previous work, COBS does not need the complete index in RAM and is thus designed to scale to larger document sets.

cobs-architecture

COBS has two interfaces:

More information about COBS is presented in our current research paper: Timo Bingmann, Phelim Bradley, Florian Gauger, and Zamin Iqbal. "COBS: a Compact Bit-Sliced Signature Index". In: 26th International Symposium on String Processing and Information Retrieval (SPIRE). pages 285-303. Spinger. October 2019. preprint arXiv:1905.09624.

Installation and First Steps

Installation

COBS requires CMake, a C++17 compiler or the Boost.Filesystem library.

To download and install COBS run:

git clone --recursive https://github.com/bingmann/cobs.git
mkdir cobs/build
cd cobs/build
cmake ..
make -j4

and optionally run make test to check the build.

Building an Index

COBS can read FASTA files (*.fa, *.fasta, *.fa.gz, *.fasta.gz), FASTQ files (*.fq, *.fastq, *.fq.gz., *.fastq.gz), McCortex files (*.ctx), or text files (*.txt).

You can either recursively scan a directory for all files matching any of these files, or pass a *.list file which lists all paths COBS should index.

To check the document list to be indexed, run for example

src/cobs doc-list tests/data/fasta/

To construct a compact COBS index from these seven example documents run

src/cobs compact-construct tests/data/fasta/ example.cobs_compact

Check --help for many options.

Query an Index

COBS has a simple command line query tool:

src/cobs query -i example.cobs_compact AGTCAACGCTAAGGCATTTCCCCCCTGCCTCCTGCCTGCTGCCAAGCCCT

or a fasta file of queries with

src/cobs query -i example.cobs_compact -f query.fa

Python Interface

COBS also has a Python frontend interface which can be used to construct and query an index. See https://bingmann.github.io/cobs-python-docs/ for a tutorial.

Experimental Results

In our paper we compare COBS against seven other k-mer indexing software packages. These are the main results, scaling by number of documents in the index, and in the second diagram shown per document.

cobs-experiments-scaling cobs-experiments-scaling-per-documents

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

cobs_index-0.1.2.tar.gz (2.7 MB view hashes)

Uploaded Source

Built Distributions

cobs_index-0.1.2-cp38-cp38-manylinux2010_x86_64.whl (971.8 kB view hashes)

Uploaded CPython 3.8 manylinux: glibc 2.12+ x86-64

cobs_index-0.1.2-cp37-cp37m-manylinux2010_x86_64.whl (974.6 kB view hashes)

Uploaded CPython 3.7m manylinux: glibc 2.12+ x86-64

cobs_index-0.1.2-cp36-cp36m-manylinux2010_x86_64.whl (974.4 kB view hashes)

Uploaded CPython 3.6m manylinux: glibc 2.12+ x86-64

cobs_index-0.1.2-cp35-cp35m-manylinux2010_x86_64.whl (974.4 kB view hashes)

Uploaded CPython 3.5m manylinux: glibc 2.12+ x86-64

cobs_index-0.1.2-cp34-cp34m-manylinux2010_x86_64.whl (974.3 kB view hashes)

Uploaded CPython 3.4m manylinux: glibc 2.12+ x86-64

cobs_index-0.1.2-cp27-cp27mu-manylinux2010_x86_64.whl (975.1 kB view hashes)

Uploaded CPython 2.7mu manylinux: glibc 2.12+ x86-64

cobs_index-0.1.2-cp27-cp27m-manylinux2010_x86_64.whl (975.1 kB view hashes)

Uploaded CPython 2.7m manylinux: glibc 2.12+ x86-64

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page