Skip to main content
  • Home
  • Development
  • Documentation
  • Donate
  • Operational login
  • Browse the archive

swh logo
SoftwareHeritage
Software
Heritage
Archive
Features
  • Search

  • Downloads

  • Save code now

  • Add forge now

  • Help

https://github.com/bcgsc/ntCard
06 April 2024, 01:58:22 UTC
  • Code
  • Branches (12)
  • Releases (0)
  • Visits
Revision c4aa22e5a5becb9d3aa31f82448f64d3be275e44 authored by Johnathan Wong on 25 September 2020, 23:47:52 UTC, committed by GitHub on 25 September 2020, 23:47:52 UTC
release 1.2.2 (#45)
* release 1.2.2

* ChangeLog: update 1.2.2 date
1 parent ea3be3e
  • Files
  • Changes
    • Branches
    • Releases
    • HEAD
    • refs/heads/azure-macOS
    • refs/heads/low_kmer_sample_check
    • refs/heads/master
    • refs/heads/refactor
    • refs/heads/spacedseeds
    • refs/tags/1.0.0
    • refs/tags/1.0.1
    • refs/tags/1.2.0
    • refs/tags/1.2.1
    • refs/tags/1.2.2
    • refs/tags/v1.1.0
    • refs/tags/v1.1.1
    • c4aa22e5a5becb9d3aa31f82448f64d3be275e44
    No releases to show
  • b2ffbc5
  • /
  • README.md
Raw File Download
Take a new snapshot of a software origin

If the archived software origin currently browsed is not synchronized with its upstream version (for instance when new commits have been issued), you can explicitly request Software Heritage to take a new snapshot of it.

Use the form below to proceed. Once a request has been submitted and accepted, it will be processed as soon as possible. You can then check its processing state by visiting this dedicated page.
swh spinner

Processing "take a new snapshot" request ...

Permalinks

To reference or cite the objects present in the Software Heritage archive, permalinks based on SoftWare Hash IDentifiers (SWHIDs) must be used.
Select below a type of object currently browsed in order to display its associated SWHID and permalink.

  • revision
  • directory
  • content
  • snapshot
origin badgerevision badge
swh:1:rev:c4aa22e5a5becb9d3aa31f82448f64d3be275e44
origin badgedirectory badge Iframe embedding
swh:1:dir:b2ffbc5f7b510d16dc7827a8fff994d72cade967
origin badgecontent badge Iframe embedding
swh:1:cnt:1aa5203a8ed8a93f375ebb76fd8aed3e29407591
origin badgesnapshot badge
swh:1:snp:9765a9dc233d6d78dbee568f9c2afba0f84bcc2b
Citations

This interface enables to generate software citations, provided that the root directory of browsed objects contains a citation.cff or codemeta.json file.
Select below a type of object currently browsed in order to generate citations for them.

  • revision
  • directory
  • content
  • snapshot
Generate software citation in BibTex format (requires biblatex-software package)
Generating citation ...
Generate software citation in BibTex format (requires biblatex-software package)
Generating citation ...
Generate software citation in BibTex format (requires biblatex-software package)
Generating citation ...
Generate software citation in BibTex format (requires biblatex-software package)
Generating citation ...
Tip revision: c4aa22e5a5becb9d3aa31f82448f64d3be275e44 authored by Johnathan Wong on 25 September 2020, 23:47:52 UTC
release 1.2.2 (#45)
Tip revision: c4aa22e
README.md
[![Release](https://img.shields.io/github/release/bcgsc/ntCard.svg)](https://github.com/bcgsc/ntCard/releases)
[![Downloads](https://img.shields.io/github/downloads/bcgsc/ntCard/total?logo=github)](https://github.com/bcgsc/ntCard/archive/master.zip)
[![Conda](https://img.shields.io/conda/dn/bioconda/ntcard?label=Conda)](https://anaconda.org/bioconda/ntcard)
[![Issues](https://img.shields.io/github/issues/bcgsc/ntCard.svg)](https://github.com/bcgsc/ntCard/issues)

![Logo](https://github.com/bcgsc/ntCard/blob/master/ntcard-logo.png)


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, *F<sub>0</sub>*, and also the *k*-mer coverage frequency histogram, *f<sub>i</sub>*, *i>=1*.  


## Install ntCard on macOS

Install [Homebrew](https://brew.sh/), and run the command

	brew install brewsci/bio/ntcard

## Install ntCard on Linux

Install [Linuxbrew](http://linuxbrew.sh/), and run the command

	brew install brewsci/bio/ntcard

Compiling ntCard from GitHub
===========================

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

* [Autoconf](http://www.gnu.org/software/autoconf)
* [Automake](http://www.gnu.org/software/automake)

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 
```
Publications
============

## [ntCard](http://bioinformatics.oxfordjournals.org/content/early/2017/01/04/bioinformatics.btw832)

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 ](http://dx.doi.org/10.1093/bioinformatics/btw832)
The diff you're trying to view is too large. Only the first 1000 changed files have been loaded.
Showing with 0 additions and 0 deletions (0 / 0 diffs computed)
swh spinner

Computing file changes ...

Software Heritage — Copyright (C) 2015–2025, The Software Heritage developers. License: GNU AGPLv3+.
The source code of Software Heritage itself is available on our development forge.
The source code files archived by Software Heritage are available under their own copyright and licenses.
Terms of use: Archive access, API— Contact— JavaScript license information— Web API

back to top