All Projects → bcgsc → ntCard

bcgsc / ntCard

Licence: MIT License
Estimating k-mer coverage histogram of genomics data

Programming Languages

C++
36643 projects - #6 most used programming language
Makefile
30231 projects
M4
1887 projects
c
50402 projects - #5 most used programming language
shell
77523 projects

Projects that are alternatives of or similar to ntCard

set-sketch-paper
SetSketch: Filling the Gap between MinHash and HyperLogLog
Stars: ✭ 23 (-66.67%)
Mutual labels:  hyperloglog, cardinality-estimation
HyperLogLog
Fast HyperLogLog for Python.
Stars: ✭ 86 (+24.64%)
Mutual labels:  hyperloglog, cardinality-estimation
hyperloglog-sketch-estimation-paper
Paper about the estimation of cardinalities from HyperLogLog sketches
Stars: ✭ 48 (-30.43%)
Mutual labels:  hyperloglog, cardinality-estimation
HyperMinHash-java
Union, intersection, and set cardinality in loglog space
Stars: ✭ 48 (-30.43%)
Mutual labels:  hyperloglog, cardinality-estimation
npstreams
Streaming operations on NumPy arrays
Stars: ✭ 28 (-59.42%)
Mutual labels:  streaming-algorithms
phphll
HyperLogLog for PHP implemented as a C extension
Stars: ✭ 19 (-72.46%)
Mutual labels:  hyperloglog
indelope
find large indels (in the blind spot between GATK/freebayes and SV callers)
Stars: ✭ 38 (-44.93%)
Mutual labels:  k-mer-counting
StreamingAlgorithms
A Set of Streaming Algorithms in C++, Python, and Go
Stars: ✭ 23 (-66.67%)
Mutual labels:  streaming-algorithms
moses
Streaming, Memory-Limited, r-truncated SVD Revisited!
Stars: ✭ 19 (-72.46%)
Mutual labels:  streaming-algorithms
redis-tdigest
t-digest module for Redis
Stars: ✭ 69 (+0%)
Mutual labels:  streaming-algorithms
rust-hyperloglog
A HyperLogLog implementation in Rust.
Stars: ✭ 44 (-36.23%)
Mutual labels:  hyperloglog
federated pca
Federated Principal Component Analysis Revisited!
Stars: ✭ 30 (-56.52%)
Mutual labels:  streaming-algorithms
deepdb-public
Implementation of DeepDB: Learn from Data, not from Queries!
Stars: ✭ 61 (-11.59%)
Mutual labels:  cardinality-estimation
naru
Neural Relation Understanding: neural cardinality estimators for tabular data
Stars: ✭ 76 (+10.14%)
Mutual labels:  cardinality-estimation
sketches
HyperLogLog and other probabilistic data structures for mining in data streams
Stars: ✭ 15 (-78.26%)
Mutual labels:  hyperloglog
Datasketch
MinHash, LSH, LSH Forest, Weighted MinHash, HyperLogLog, HyperLogLog++, LSH Ensemble
Stars: ✭ 1,635 (+2269.57%)
Mutual labels:  hyperloglog
Miller
Miller is like awk, sed, cut, join, and sort for name-indexed data such as CSV, TSV, and tabular JSON
Stars: ✭ 4,633 (+6614.49%)
Mutual labels:  streaming-algorithms

Release Downloads Conda Issues

Logo

ntCard

ntCard is a streaming algorithm for cardinality estimation in genomics datasets. As input it takes file(s) in fasta, fastq, sam, or bam formats and computes the total number of distinct k-mers, F0, and also the k-mer coverage frequency histogram, fi, i>=1.

Install ntCard on macOS

Install Homebrew, and run the command

brew install brewsci/bio/ntcard

Install ntCard on Linux

Install Linuxbrew, and run the command

brew install brewsci/bio/ntcard

Compiling ntCard from GitHub

When installing ntCard from GitHub source the following tools are required:

To generate the configure script and make files:

./autogen.sh

Compiling ntCard from source

To compile and install ntCard in /usr/local:

$ ./configure
$ make 
$ sudo make install 

To install ntCard in a specified directory:

$ ./configure --prefix=/opt/ntCard
$ make 
$ make install 

ntCard uses OpenMP for parallelization, which requires a modern compiler such as GCC 4.2 or greater. If you have an older compiler, it is best to upgrade your compiler if possible. If you have multiple versions of GCC installed, you can specify a different compiler:

$ ./configure CC=gcc-xx CXX=g++-xx 

For the best performance of ntCard, pass -O3 flag:

$ ./configure CFLAGS='-g -O3' CXXFLAGS='-g -O3' 

To run ntCard, its executables should be found in your PATH. If you installed ntCard in /opt/ntCard, add /opt/ntCard/bin to your PATH:

$ PATH=/opt/ntCard/bin:$PATH

Run ntCard

ntcard [OPTIONS] ... FILE(S) ...

Parameters:

  • -t, --threads=N: use N parallel threads [1] (N>=2 should be used when input files are >=2)
  • -k, --kmer=N: the length of k-mer
  • -c, --cov=N: the maximum coverage of k-mer in output [1000]
  • -p, --pref=STRING: the prefix for output file names
  • -o, --output=STRING: the name for single output file name (can be used only for single compact output file)
  • FILE(S): input file or set of files seperated by space, in fasta, fastq, sam, and bam formats. The files can also be in compressed (.gz, .bz2, .xz) formats . A list of files containing file names in each row can be passed with @ prefix.

For example to run ntcard on a test file reads.fastq with k=50 and output the histogram in a file with prefix freq:

$ ntcard -k50 -p freq reads.fastq 

To run ntcard on a test file reads.fastq with multiple k's k=32,64,96,128 and output the histograms in files with prefix freq use:

$ ntcard -k32,64,96,128 -p freq reads.fastq 

As another example, to run ntcard on 5 input files file_1.fq.gz, file_2.fa, file_3.sam, file_4.bam, file_5.fq with k=64 and 6 threads and maximum frequency of c=100 on output file with prefix freq:

$ ntcard -k64 -c100 -t6 -p freq file_1.fq.gz file_2.fa file_3.sam file_4.bam file_5.fq

If we have a list of input files lib.in, to run ntCard with k=144 and 12 threads and output file with prefix freq:

$ ntcard -k144 -t12 -p freq @lib.in 

Output:

  • The numbers Fk provide useful statistics on the input sequences. By default, F0 and F1 are output to stdout along with runtime.
    • F0 denotes the number of distinct k-mers appearing in the stream sequences
    • F1 is the total number of k-mers in the input datasets
    • F2 is the Gini index of variation that can be used to show the diversity of k-mers and
    • F∞ results in the most frequent k-mer in the input reads.
  • A tab separated output file with columns k, f, and n.
    • k k-mer size
    • f the frequency of a k-mer
    • n the number of k-mers with frequency f

Publications

ntCard

Hamid Mohamadi, Hamza Khan, and Inanc Birol. ntCard: a streaming algorithm for cardinality estimation in genomics data. Bioinformatics (2017) 33 (9): 1324-1330. 10.1093/bioinformatics/btw832

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].