ntCard-1.2.2/000077500000000000000000000000001373350065000127315ustar00rootroot00000000000000ntCard-1.2.2/.clang-format000066400000000000000000000003231373350065000153020ustar00rootroot00000000000000BasedOnStyle: Mozilla AlignAfterOpenBracket: AlwaysBreak AlignOperands: true ColumnLimit: 100 ContinuationIndentWidth: 4 IndentCaseLabels: false IndentWidth: 4 TabWidth: 4 UseTab: ForIndentation Standard: C++03 ntCard-1.2.2/CITATION.bib000066400000000000000000000007521373350065000146250ustar00rootroot00000000000000@article{doi:10.1093/bioinformatics/btw832, author = {Mohamadi, Hamid and Khan, Hamza and Birol, Inanc}, title = {ntCard: a streaming algorithm for cardinality estimation in genomics data}, journal = {Bioinformatics}, volume = {33}, number = {9}, pages = {1324}, year = {2017}, doi = {10.1093/bioinformatics/btw832}, URL = { + http://dx.doi.org/10.1093/bioinformatics/btw832}, eprint = {/oup/backfile/content_public/journal/bioinformatics/33/9/10.1093_bioinformatics_btw832/2/btw832.pdf} } ntCard-1.2.2/ChangeLog000066400000000000000000000007531373350065000145100ustar00rootroot000000000000002020-09-25 Johnathan Wong * Release version 1.2.2 * Fixed compilation error with gcc-9 2020-01-27 Johnathan Wong * Release version 1.2.1 * Fixed a bug with reading fasta files 2020-01-24 Johnathan Wong * Release version 1.2.0 * Added support for RNA sequences * Added support for gap seeds (spaced seeds which have all the wildcards in the middle) 2017-01-11 Hamid Mohamadi * Release version 1.0.0 ntCard-1.2.2/Common/000077500000000000000000000000001373350065000141615ustar00rootroot00000000000000ntCard-1.2.2/Common/Fcontrol.cpp000066400000000000000000000004231373350065000164520ustar00rootroot00000000000000#include "Fcontrol.h" #include /* Set the FD_CLOEXEC flag of the specified file descriptor. */ int setCloexec(int fd) { int flags = fcntl(fd, F_GETFD, 0); if (flags == -1) return -1; flags |= FD_CLOEXEC; return fcntl(fd, F_SETFD, flags); } ntCard-1.2.2/Common/Fcontrol.h000066400000000000000000000001111373350065000161110ustar00rootroot00000000000000#ifndef FCONTROL_H #define FCONTROL_H 1 int setCloexec(int fd); #endif ntCard-1.2.2/Common/SignalHandler.cpp000066400000000000000000000030271373350065000174020ustar00rootroot00000000000000/** * Signal handling code, particularly SIGCHLD. */ #include "SignalHandler.h" #include #include #include // for perror #include #include #include #include using namespace std; /** Print the specified exit status. */ static void printStatus(pid_t pid, int status) { if (WIFEXITED(status)) cerr << "PID " << pid << " exited with status " << WEXITSTATUS(status) << endl; else if (WIFSIGNALED(status)) cerr << "PID " << pid << " killed by signal " << WTERMSIG(status) << endl; else cerr << "PID " << pid << " exited with code " << status << endl; } /** SIGCHLD handler. Reap child processes and report an error if any * fail. */ static void sigchldHandler(int sig) { assert(sig == SIGCHLD); (void)sig; pid_t pid; int status; while ((pid = waitpid(-1, &status, WNOHANG)) > 0) { // Writing to cerr in a signal handler is not allowed, but // we're about to exit and an error message would be really // helpful. if (status != 0) { printStatus(pid, status); exit(EXIT_FAILURE); } } if (pid == -1 && errno != ECHILD) { perror("waitpid"); exit(EXIT_FAILURE); } } /** Install a handler for SIGCHLD. */ void signalInit() { struct sigaction action; action.sa_handler = sigchldHandler; sigemptyset(&action.sa_mask); action.sa_flags = SA_RESTART; sigaction(SIGCHLD, &action, NULL); } ntCard-1.2.2/Common/SignalHandler.h000066400000000000000000000001161373350065000170430ustar00rootroot00000000000000#ifndef SIGNALHANDLER_H #define SIGNALHANDLER_H 1 void signalInit(); #endif ntCard-1.2.2/Common/StringUtil.h000066400000000000000000000121371373350065000164420ustar00rootroot00000000000000#ifndef STRINGUTIL_H #define STRINGUTIL_H 1 #include #include #include #include #include /** Return the last character of s and remove it. */ static inline char chop(std::string& s) { assert(s.length() > 1); unsigned back = s.length() - 1; char c = s[back]; s.erase(back); return c; } /** If the last character of s is c, remove it and return true. */ static inline bool chomp(std::string& s, char c = '\n') { unsigned back = s.length() - 1; if (!s.empty() && s[back] == c) { s.erase(back); return true; } else return false; } /** Return the SI representation of n. */ static inline std::string toSI(double n) { std::ostringstream s; s << std::setprecision(3); if (n < 1e3) s << n << ' '; else if (n < 1e6) s << n/1e3 << " k"; else if (n < 1e9) s << n/1e6 << " M"; else if (n < 1e12) s << n/1e9 << " G"; else s << n/1e12 << " T"; return s.str(); } /** Return the SI representation of a number in bytes. */ static inline std::string bytesToSI(size_t n) { std::ostringstream s; s << std::setprecision(3); if (n < 1024) s << n; else if (n < (1ULL<<20)) s << (double)n/(1ULL<<10) << "k"; else if (n < (1ULL<<30)) s << (double)n/(1ULL<<20) << "M"; else s << (double)n/(1ULL<<30) << "G"; return s.str(); } /** * Convert a quantity with SI units to the equivalent floating * point number. */ static inline double fromSI(std::istringstream& iss) { double size; std::string units; iss >> size; if (iss.fail()) { // not prefixed by a number return 0; } iss >> units; if (iss.fail() && iss.eof()) { // no units given; clear fail flag // and just return the number iss.clear(std::ios::eofbit); return size; } if (units.size() > 1) { // unrecognized multichar suffix iss.setstate(std::ios::failbit); return 0; } switch(tolower(units[0])) { case 'k': size *= 1000ULL; break; case 'm': size *= 1000ULL*1000; break; case 'g': size *= 1000ULL*1000*1000; break; case 't': size *= 1000ULL*1000*1000*1000; break; default: iss.setstate(std::ios::failbit); return 0; } return size; } /** * Convert a quantity with SI units to the equivalent floating * point number. */ static inline double fromSI(const std::string& str) { std::istringstream iss(str); return fromSI(iss); } /** Return the engineering string representation of n. */ template static inline std::string toEng(T n) { std::ostringstream s; s << std::setprecision(4); if (n < 10000000) s << n; else if (n < 1e9) s << n/1e6 << "e6"; else if (n < 1e12) s << n/1e9 << "e9"; else s << n/1e12 << "e12"; return s.str(); } /** Return true if the second string is a prefix of the string s. */ template bool startsWith(const std::string& s, const char (&prefix)[N]) { size_t n = N - 1; return s.size() > n && equal(s.begin(), s.begin() + n, prefix); } /** Return true if the second string is a suffix of the string s. */ template bool endsWith(const std::string& s, const char (&suffix)[N]) { size_t n = N - 1; return s.size() > n && equal(s.end() - n, s.end(), suffix); } /** Return true if the second string is a suffix of the string s. */ static inline bool endsWith(const std::string& s, const std::string& suffix) { size_t n = suffix.size(); return s.size() > n && equal(s.end() - n, s.end(), suffix.begin()); } static inline bool isReadNamePair(const std::string& name1, const std::string& name2) { assert(!name1.empty() && !name2.empty()); if (name1 == name2) return true; if (endsWith(name1,"/1") && endsWith(name2,"/2")) { int len1 = name1.length(); int len2 = name2.length(); assert(len1 > 2 && len2 > 2); return name1.compare(0, len1-2, name2, 0, len2-2) == 0; } return false; } static inline size_t SIToBytes(std::istringstream& iss) { double size; std::string units; iss >> size; if (iss.fail()) { // not prefixed by a number return 0; } iss >> units; if (iss.fail() && iss.eof()) { // no units given; clear fail flag // and assume bytes iss.clear(std::ios::eofbit); return (size_t)ceil(size); } if (units.size() > 1) { // unrecognized multichar suffix iss.setstate(std::ios::failbit); return 0; } switch(tolower(units[0])) { case 'k': size *= (size_t)1<<10; break; case 'm': size *= (size_t)1<<20; break; case 'g': size *= (size_t)1<<30; break; default: iss.setstate(std::ios::failbit); return 0; } return (size_t)ceil(size); } static inline size_t SIToBytes(const std::string& str) { std::istringstream iss(str); return SIToBytes(iss); } #endif ntCard-1.2.2/Common/Uncompress.cpp000066400000000000000000000144361373350065000170330ustar00rootroot00000000000000/** Uncompress input files using pipes. * Hook the standard file opening functions, open, fopen and fopen64. * If the extension of the file being opened indicates the file is * compressed (.gz, .bz2, .xz), open a pipe to a program that * decompresses that file (gunzip, bunzip2 or xzdec) and return a * handle to the open pipe. * @author Shaun Jackman */ #include "Fcontrol.h" #include "SignalHandler.h" #include "StringUtil.h" #include #include // for perror #include #include #include #include using namespace std; static const char* wgetExec(const string& path) { return startsWith(path, "http://") ? "wget -O-" : startsWith(path, "https://") ? "wget -O-" : startsWith(path, "ftp://") ? "wget -O-" : NULL; } static const char* zcatExec(const string& path) { return endsWith(path, ".ar") ? "ar -p" : endsWith(path, ".tar") ? "tar -xOf" : endsWith(path, ".tar.Z") ? "tar -zxOf" : endsWith(path, ".tar.gz") ? "tar -zxOf" : endsWith(path, ".tar.bz2") ? "tar -jxOf" : endsWith(path, ".tar.xz") ? "tar --use-compress-program=xzdec -xOf" : endsWith(path, ".Z") ? "gunzip -c" : endsWith(path, ".gz") ? "gunzip -c" : endsWith(path, ".bz2") ? "bunzip2 -c" : endsWith(path, ".xz") ? "xzdec -c" : endsWith(path, ".zip") ? "unzip -p" : endsWith(path, ".bam") ? "samtools view -h" : endsWith(path, ".jf") ? "jellyfish dump" : endsWith(path, ".jfq") ? "jellyfish qdump" : endsWith(path, ".sra") ? "fastq-dump -Z --split-spot" : endsWith(path, ".url") ? "wget -O- -i" : NULL; } extern "C" { /** Open a pipe to uncompress the specified file. * Not thread safe. * @return a file descriptor */ static int uncompress(const char *path) { const char *wget = wgetExec(path); const char *zcat = wget != NULL ? wget : zcatExec(path); assert(zcat != NULL); int fd[2]; if (pipe(fd) == -1) return -1; int err = setCloexec(fd[0]); assert(err == 0); (void)err; char arg0[16], arg1[16], arg2[16]; int n = sscanf(zcat, "%s %s %s", arg0, arg1, arg2); assert(n == 2 || n == 3); /* It would be more portable to use fork than vfork, but fork can * fail with ENOMEM when the process calling fork is using a lot * of memory. A workaround for this problem is to set * sysctl vm.overcommit_memory=1 */ #if HAVE_WORKING_VFORK pid_t pid = vfork(); #else pid_t pid = fork(); #endif if (pid == -1) return -1; if (pid == 0) { dup2(fd[1], STDOUT_FILENO); close(fd[1]); if (n == 2) execlp(arg0, arg0, arg1, path, NULL); else execlp(arg0, arg0, arg1, arg2, path, NULL); // Calling perror after vfork is not allowed, but we're about // to exit and an error message would be really helpful. perror(arg0); _exit(EXIT_FAILURE); } else { close(fd[1]); return fd[0]; } } /** Open a pipe to uncompress the specified file. * @return a FILE pointer */ static FILE* funcompress(const char* path) { int fd = uncompress(path); if (fd == -1) { perror(path); exit(EXIT_FAILURE); } return fdopen(fd, "r"); } typedef FILE* (*fopen_t)(const char *path, const char *mode); /** If the specified file is compressed, return a pipe that * uncompresses it. */ FILE *fopen(const char *path, const char *mode) { static fopen_t real_fopen; if (real_fopen == NULL) real_fopen = (fopen_t)dlsym(RTLD_NEXT, "fopen"); if (real_fopen == NULL) { fprintf(stderr, "error: dlsym fopen: %s\n", dlerror()); exit(EXIT_FAILURE); } // open a web address if (wgetExec(path) != NULL) return funcompress(path); // to check if the file exists, we need to attempt to open it FILE* stream = real_fopen(path, mode); if (string(mode) != "r" || !stream || zcatExec(path) == NULL) return stream; else { fclose(stream); return funcompress(path); } } /** If the specified file is compressed, return a pipe that * uncompresses it. */ FILE *fopen64(const char *path, const char *mode) { static fopen_t real_fopen64; if (real_fopen64 == NULL) real_fopen64 = (fopen_t)dlsym(RTLD_NEXT, "fopen64"); if (real_fopen64 == NULL) { fprintf(stderr, "error: dlsym fopen64: %s\n", dlerror()); exit(EXIT_FAILURE); } // open a web address if (wgetExec(path) != NULL) return funcompress(path); // to check if the file exists, we need to attempt to open it FILE* stream = real_fopen64(path, mode); if (string(mode) != "r" || !stream || zcatExec(path) == NULL) return stream; else { fclose(stream); return funcompress(path); } } typedef int (*open_t)(const char *path, int flags, mode_t mode); /** If the specified file is compressed, return a pipe that * uncompresses it. */ int open(const char *path, int flags, mode_t mode) { static open_t real_open; if (real_open == NULL) real_open = (open_t)dlsym(RTLD_NEXT, "open"); if (real_open == NULL) { fprintf(stderr, "error: dlsym open: %s\n", dlerror()); exit(EXIT_FAILURE); } // open a web address if (wgetExec(path) != NULL) return uncompress(path); // to check if the file exists, we need to attempt to open it int filedesc = real_open(path, flags, mode); if (mode != ios_base::in || filedesc < 0 || zcatExec(path) == NULL) return filedesc; else { close(filedesc); return uncompress(path); } } } // extern "C" /** Initialize the uncompress module. */ bool uncompress_init() { signalInit(); return true; } ntCard-1.2.2/Common/Uncompress.h000066400000000000000000000004211373350065000164650ustar00rootroot00000000000000#ifndef UNCOMPRESS_H #define UNCOMPRESS_H 1 bool uncompress_init(); namespace { const bool uncompressInitialized = uncompress_init(); bool getUncompressInitialized() __attribute__((unused)); bool getUncompressInitialized() { return uncompressInitialized; } } #endif ntCard-1.2.2/LICENSE000066400000000000000000000020571373350065000137420ustar00rootroot00000000000000MIT License Copyright (c) 2018 Hamid Mohamadi Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ntCard-1.2.2/Makefile.am000066400000000000000000000051231373350065000147660ustar00rootroot00000000000000bin_PROGRAMS = ntcard nthll ntcard_CPPFLAGS = -I$(top_srcdir)/Common ntcard_SOURCES = \ Common/Uncompress.cpp \ Common/Uncompress.h \ Common/SignalHandler.cpp \ Common/SignalHandler.h \ Common/StringUtil.h \ Common/Fcontrol.cpp \ Common/Fcontrol.h \ ntcard.cpp nthll_CPPFLAGS = -I$(top_srcdir)/Common nthll_SOURCES = \ Common/Uncompress.cpp \ Common/Uncompress.h \ Common/SignalHandler.cpp \ Common/SignalHandler.h \ Common/Fcontrol.cpp \ Common/Fcontrol.h \ nthll.cpp dist_doc_DATA = \ ChangeLog \ CITATION.bib \ LICENSE \ README.md EXTRA_DIST= autogen.sh SUBDIRS = \ vendor \ data test-reads.fq.gz: wget https://www.bcgsc.ca/downloads/btl/ntcard/test-reads.fq.gz test-rna-reads.fq.gz: wget https://www.bcgsc.ca/downloads/btl/ntcard/test-rna-reads.fq.gz test-reads.fa: test-reads.fq.gz zcat test-reads.fq.gz |sed -n '1~4s/^@/>/p;2~4p' > test-reads.fa test_k12.hist: test-reads.fq.gz ./ntcard -k 12 -p test test-reads.fq.gz test-rna_k12.hist: test-rna-reads.fq.gz ./ntcard -k 12 -p test-rna test-rna-reads.fq.gz test-fa_k12.hist: test-reads.fa ./ntcard -k 12 -p test-fa test-reads.fa test-gap_k12.hist: test-reads.fq.gz ./ntcard -k 12 -p test-gap -g 2 test-reads.fq.gz test-rna-gap_k12.hist: test-rna-reads.fq.gz ./ntcard -k 12 -p test-rna-gap -g 2 test-rna-reads.fq.gz test-fa-gap_k12.hist: test-reads.fa ./ntcard -k 12 -p test-fa-gap -g 2 test-reads.fa check-dna: test_k12.hist diff -q test_k12.hist $(srcdir)/data/test_k12.hist.good check-dna-gap: test-gap_k12.hist diff -q test-gap_k12.hist $(srcdir)/data/test-gap_k12.hist.good check-rna: test-rna_k12.hist diff -q test-rna_k12.hist $(srcdir)/data/test_k12.hist.good check-rna-gap: test-rna-gap_k12.hist diff -q test-rna-gap_k12.hist $(srcdir)/data/test-gap_k12.hist.good check-fa: test-fa_k12.hist diff -q test-fa_k12.hist $(srcdir)/data/test_k12.hist.good check-fa-gap: test-fa-gap_k12.hist diff -q test-fa-gap_k12.hist $(srcdir)/data/test-gap_k12.hist.good check: check-dna check-rna check-fa check-dna-gap check-rna-gap check-fa-gap # Check the C++ source code for white-space errors with clang-format. clang-format: for i in ntcard.cpp; do clang-format -style=file $$i >$$i.fixed; done for i in ntcard.cpp; do diff -su $$i $$i.fixed && rm -f $$i.fixed; done if ls *.fixed; then exit 1; fi clean-local: rm test-reads.fq.gz rm test_k12.hist rm test-gap_k12.hist rm test-rna-reads.fq.gz rm test-rna_k12.hist rm test-rna-gap_k12.hist rm test-reads.fa rm test-fa_k12.hist rm test-fa-gap_k12.hist ntCard-1.2.2/README.md000066400000000000000000000101361373350065000142110ustar00rootroot00000000000000[![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, *F0*, and also the *k*-mer coverage frequency histogram, *fi*, *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) ntCard-1.2.2/autogen.sh000077500000000000000000000000721373350065000147310ustar00rootroot00000000000000#!/bin/sh set -ex aclocal autoconf autoheader automake -a ntCard-1.2.2/azure-pipelines.yml000066400000000000000000000041111373350065000165650ustar00rootroot00000000000000jobs: - job: linux pool: vmImage: Ubuntu 16.04 steps: - script: | sudo apt-get update -qq sudo apt-get install -qq software-properties-common sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test sudo apt-get update -qq sudo apt-get install -qq autoconf automake gcc g++ make displayName: Install common - script: | ./autogen.sh ./configure make distcheck displayName: Compiling and testing ntCard - script: | curl https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add - sudo apt-add-repository "deb http://apt.llvm.org/xenial/ llvm-toolchain-xenial-7 main" sudo apt-get update sudo apt-get install -y --no-install-recommends clang-format-7 sudo ln -sf clang-format-7 /usr/bin/clang-format displayName: Install clang-format - script: make clang-format displayName: Run clang-format - job: linux_gcc9 pool: vmImage: Ubuntu 16.04 steps: - script: | sudo apt-get update -qq sudo apt-get install -qq software-properties-common sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test sudo apt-get update -qq sudo apt-get install -qq autoconf automake gcc-9 g++-9 make displayName: Install common - script: | ./autogen.sh export DISTCHECK_CONFIGURE_FLAGS="CC=gcc-9 CXX=g++-9" ./configure CC=gcc-9 CXX=g++-9 make distcheck displayName: Compiling and testing ntCard with gcc 9 - job: linux_clang9 pool: vmImage: Ubuntu 16.04 steps: - script: | sudo apt-get update -qq sudo apt-get install -qq software-properties-common sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test sudo apt-get update -qq sudo apt-get install -qq autoconf automake gcc-9 g++-9 make displayName: Install common - script: sudo apt-get install -qq clang-9 displayName: Install clang-9 - script: | ./autogen.sh export DISTCHECK_CONFIGURE_FLAGS="CC=clang-9 CXX=clang++-9" ./configure CC=clang-9 CXX=clang++-9 make distcheck displayName: Compiling and testing ntCard with clang 9 ntCard-1.2.2/configure.ac000066400000000000000000000040131373350065000152150ustar00rootroot00000000000000AC_PREREQ(2.62) AC_INIT(NTCARD, 1.2.2, hmohamadi@bcgsc.ca, ntcard, https://github.com/bcgsc/ntCard) # add 'foreign' to allow README.md instead of README AM_INIT_AUTOMAKE([foreign subdir-objects]) AC_CONFIG_SRCDIR([ntcard.cpp]) AC_CONFIG_HEADER([config.h]) if test -z $CXXFLAGS; then CXXFLAGS='-O3' fi if test -z $CCFLAGS; then CCFLAGS='-O3' fi # Checks for programs. AC_PROG_AWK AC_PROG_CC AC_PROG_CPP AC_PROG_CXX AC_PROG_INSTALL AC_PROG_RANLIB # Checks for header files. AC_CHECK_HEADERS([dlfcn.h fcntl.h float.h limits.h \ stddef.h stdint.h stdlib.h sys/param.h zlib.h]) AC_HEADER_STDBOOL AC_HEADER_STDC # Checks for library functions. AC_CHECK_FUNCS([dup2 gethostname getopt_long getpagesize \ memset strdup strerror strtoul]) AC_FUNC_FORK AC_FUNC_MALLOC AC_FUNC_MEMCMP AC_FUNC_REALLOC AC_FUNC_SETVBUF_REVERSED AC_FUNC_VPRINTF # Checks for typedefs, structures, and compiler characteristics. AC_C_BIGENDIAN AC_C_CONST AC_C_INLINE AC_CHECK_TYPES([ptrdiff_t]) AC_TYPE_MODE_T AC_TYPE_PID_T AC_TYPE_SIZE_T AC_TYPE_SSIZE_T AC_TYPE_INT64_T AC_TYPE_UINT8_T AC_TYPE_UINT16_T AC_TYPE_UINT32_T AC_TYPE_UINT64_T # Check for the math library. AC_CHECK_LIB([m], [sqrt]) AC_CHECK_FUNCS([pow sqrt]) AC_CHECK_FUNC(ceilf, [], AC_DEFINE(ceilf, [ceil], [Define if the system does not provide ceilf])) # Check for the dynamic linking library. AC_CHECK_LIB([dl], [dlsym]) # zlib (optional) AC_CHECK_LIB([z], [gzwrite]) AM_CONDITIONAL([HAVE_LIBZ], [test $ac_cv_header_zlib_h = yes -a $ac_cv_lib_z_gzwrite = yes]) # Check for OpenMP. AC_LANG_PUSH([C++]) AC_OPENMP if test -z $OPENMP_CXXFLAGS; then AC_MSG_ERROR([NTCARD must be compiled with a C++ compiler that supports OpenMP threading.]) fi AC_LANG_POP([C++]) # Find the absolute path to the source. my_abs_srcdir=$(cd $srcdir; pwd) # Set compiler flags AC_SUBST(CPPFLAGS, "-I$my_abs_srcdir $OPENMP_CXXFLAGS $CPPFLAGS") AC_SUBST(LDFLAGS, "$OPENMP_CXXFLAGS $LDFLAGS") AC_SUBST(AM_CXXFLAGS, '-Wall -Wextra -Werror') AC_CONFIG_FILES([ Makefile vendor/Makefile data/Makefile ]) AC_OUTPUT ntCard-1.2.2/data/000077500000000000000000000000001373350065000136425ustar00rootroot00000000000000ntCard-1.2.2/data/Makefile.am000066400000000000000000000001031373350065000156700ustar00rootroot00000000000000EXTRA_DIST = \ test_k12.hist.good \ test-gap_k12.hist.good ntCard-1.2.2/data/test-gap_k12.hist.good000066400000000000000000000135661373350065000176760ustar00rootroot00000000000000F1 1180000 F0 248897 1 78720 2 28544 3 21632 4 21504 5 20928 6 17344 7 13568 8 10239 9 8639 10 5183 11 3519 12 3775 13 3135 14 2559 15 1535 16 1215 17 1023 18 1407 19 575 20 447 21 703 22 383 23 639 24 255 25 191 26 191 27 63 28 191 29 63 30 0 31 0 32 192 33 63 34 0 35 0 36 0 37 0 38 0 39 0 40 64 41 64 42 0 43 0 44 0 45 0 46 0 47 0 48 0 49 64 50 0 51 64 52 0 53 0 54 0 55 0 56 0 57 64 58 64 59 0 60 0 61 0 62 0 63 0 64 0 65 0 66 0 67 0 68 0 69 0 70 0 71 0 72 0 73 0 74 0 75 0 76 0 77 0 78 0 79 0 80 0 81 0 82 0 83 0 84 0 85 0 86 0 87 64 88 0 89 0 90 0 91 0 92 0 93 0 94 0 95 0 96 0 97 0 98 0 99 0 100 0 101 0 102 0 103 0 104 0 105 0 106 0 107 0 108 0 109 0 110 0 111 0 112 0 113 0 114 0 115 0 116 0 117 0 118 0 119 0 120 0 121 0 122 0 123 0 124 0 125 0 126 0 127 0 128 0 129 0 130 0 131 0 132 0 133 0 134 0 135 0 136 0 137 0 138 0 139 0 140 0 141 0 142 0 143 0 144 0 145 0 146 0 147 0 148 0 149 0 150 0 151 0 152 0 153 0 154 0 155 0 156 0 157 0 158 0 159 0 160 0 161 0 162 0 163 0 164 0 165 0 166 0 167 0 168 0 169 0 170 0 171 0 172 0 173 0 174 0 175 0 176 0 177 0 178 0 179 0 180 0 181 0 182 0 183 0 184 0 185 0 186 0 187 0 188 0 189 0 190 0 191 0 192 0 193 0 194 0 195 0 196 0 197 0 198 0 199 0 200 0 201 0 202 0 203 0 204 0 205 0 206 0 207 0 208 0 209 0 210 0 211 0 212 0 213 0 214 0 215 0 216 0 217 0 218 0 219 0 220 0 221 0 222 0 223 0 224 0 225 0 226 0 227 0 228 0 229 0 230 0 231 0 232 0 233 0 234 0 235 0 236 0 237 0 238 0 239 0 240 0 241 0 242 0 243 0 244 0 245 0 246 0 247 0 248 0 249 0 250 0 251 0 252 0 253 0 254 0 255 0 256 0 257 0 258 0 259 0 260 0 261 0 262 0 263 0 264 0 265 0 266 0 267 0 268 0 269 0 270 0 271 0 272 0 273 0 274 0 275 0 276 0 277 0 278 0 279 0 280 0 281 0 282 0 283 0 284 0 285 0 286 0 287 0 288 0 289 0 290 0 291 0 292 0 293 0 294 0 295 0 296 0 297 0 298 0 299 0 300 0 301 0 302 0 303 0 304 0 305 0 306 0 307 0 308 0 309 0 310 0 311 0 312 0 313 0 314 0 315 0 316 0 317 0 318 0 319 0 320 0 321 0 322 0 323 0 324 0 325 0 326 0 327 0 328 0 329 0 330 0 331 0 332 0 333 0 334 0 335 0 336 0 337 0 338 0 339 0 340 0 341 0 342 0 343 0 344 0 345 0 346 0 347 0 348 0 349 0 350 0 351 0 352 0 353 0 354 0 355 0 356 0 357 0 358 0 359 0 360 0 361 0 362 0 363 0 364 0 365 0 366 0 367 0 368 0 369 0 370 0 371 0 372 0 373 0 374 0 375 0 376 0 377 0 378 0 379 0 380 0 381 0 382 0 383 0 384 0 385 0 386 0 387 0 388 0 389 0 390 0 391 0 392 0 393 0 394 0 395 0 396 0 397 0 398 0 399 0 400 0 401 0 402 0 403 0 404 0 405 0 406 0 407 0 408 0 409 0 410 0 411 0 412 0 413 0 414 0 415 0 416 0 417 0 418 0 419 0 420 0 421 0 422 0 423 0 424 0 425 0 426 0 427 0 428 0 429 0 430 0 431 0 432 0 433 0 434 0 435 0 436 0 437 0 438 0 439 0 440 0 441 0 442 0 443 0 444 0 445 0 446 0 447 0 448 0 449 0 450 0 451 0 452 0 453 0 454 0 455 0 456 0 457 0 458 0 459 0 460 0 461 0 462 0 463 0 464 0 465 0 466 0 467 0 468 0 469 0 470 0 471 0 472 0 473 0 474 0 475 0 476 0 477 0 478 0 479 0 480 0 481 0 482 0 483 0 484 0 485 0 486 0 487 0 488 0 489 0 490 0 491 0 492 0 493 0 494 0 495 0 496 0 497 0 498 0 499 0 500 0 501 0 502 0 503 0 504 0 505 0 506 0 507 0 508 0 509 0 510 0 511 0 512 0 513 0 514 0 515 0 516 0 517 0 518 0 519 0 520 0 521 0 522 0 523 0 524 0 525 0 526 0 527 0 528 0 529 0 530 0 531 0 532 0 533 0 534 0 535 0 536 0 537 0 538 0 539 0 540 0 541 0 542 0 543 0 544 0 545 0 546 0 547 0 548 0 549 0 550 0 551 0 552 0 553 0 554 0 555 0 556 0 557 0 558 0 559 0 560 0 561 0 562 0 563 0 564 0 565 0 566 0 567 0 568 0 569 0 570 0 571 0 572 0 573 0 574 0 575 0 576 0 577 0 578 0 579 0 580 0 581 0 582 0 583 0 584 0 585 0 586 0 587 0 588 0 589 0 590 0 591 0 592 0 593 0 594 0 595 0 596 0 597 0 598 0 599 0 600 0 601 0 602 0 603 0 604 0 605 0 606 0 607 0 608 0 609 0 610 0 611 0 612 0 613 0 614 0 615 0 616 0 617 0 618 0 619 0 620 0 621 0 622 0 623 0 624 0 625 0 626 0 627 0 628 0 629 0 630 0 631 0 632 0 633 0 634 0 635 0 636 0 637 0 638 0 639 0 640 0 641 0 642 0 643 0 644 0 645 0 646 0 647 0 648 0 649 0 650 0 651 0 652 0 653 0 654 0 655 0 656 0 657 0 658 0 659 0 660 0 661 0 662 0 663 0 664 0 665 0 666 0 667 0 668 0 669 0 670 0 671 0 672 0 673 0 674 0 675 0 676 0 677 0 678 0 679 0 680 0 681 0 682 0 683 0 684 0 685 0 686 0 687 0 688 0 689 0 690 0 691 0 692 0 693 0 694 0 695 0 696 0 697 0 698 0 699 0 700 0 701 0 702 0 703 0 704 0 705 0 706 0 707 0 708 0 709 0 710 0 711 0 712 0 713 0 714 0 715 0 716 0 717 0 718 0 719 0 720 0 721 0 722 0 723 0 724 0 725 0 726 0 727 0 728 0 729 0 730 0 731 0 732 0 733 0 734 0 735 0 736 0 737 0 738 0 739 0 740 0 741 0 742 0 743 0 744 0 745 0 746 0 747 0 748 0 749 0 750 0 751 0 752 0 753 0 754 0 755 0 756 0 757 0 758 0 759 0 760 0 761 0 762 0 763 0 764 0 765 0 766 0 767 0 768 0 769 0 770 0 771 0 772 0 773 0 774 0 775 0 776 0 777 0 778 0 779 0 780 0 781 0 782 0 783 0 784 0 785 0 786 0 787 0 788 0 789 0 790 0 791 0 792 0 793 0 794 0 795 0 796 0 797 0 798 0 799 0 800 0 801 0 802 0 803 0 804 0 805 0 806 0 807 0 808 0 809 0 810 0 811 0 812 0 813 0 814 0 815 0 816 0 817 0 818 0 819 0 820 0 821 0 822 0 823 0 824 0 825 0 826 0 827 0 828 0 829 0 830 0 831 0 832 0 833 0 834 0 835 0 836 0 837 0 838 0 839 0 840 0 841 0 842 0 843 0 844 0 845 0 846 0 847 0 848 0 849 0 850 0 851 0 852 0 853 0 854 0 855 0 856 0 857 0 858 0 859 0 860 0 861 0 862 0 863 0 864 0 865 0 866 0 867 0 868 0 869 0 870 0 871 0 872 0 873 0 874 0 875 0 876 0 877 0 878 0 879 0 880 0 881 0 882 0 883 0 884 0 885 0 886 0 887 0 888 0 889 0 890 0 891 0 892 0 893 0 894 0 895 0 896 0 897 0 898 0 899 0 900 0 901 0 902 0 903 0 904 0 905 0 906 0 907 0 908 0 909 0 910 0 911 0 912 0 913 0 914 0 915 0 916 0 917 0 918 0 919 0 920 0 921 0 922 0 923 0 924 0 925 0 926 0 927 0 928 0 929 0 930 0 931 0 932 0 933 0 934 0 935 0 936 0 937 0 938 0 939 0 940 0 941 0 942 0 943 0 944 0 945 0 946 0 947 0 948 0 949 0 950 0 951 0 952 0 953 0 954 0 955 0 956 0 957 0 958 0 959 0 960 0 961 0 962 0 963 0 964 0 965 0 966 0 967 0 968 0 969 0 970 0 971 0 972 0 973 0 974 0 975 0 976 0 977 0 978 0 979 0 980 0 981 0 982 0 983 0 984 0 985 0 986 0 987 0 988 0 989 0 990 0 991 0 992 0 993 0 994 0 995 0 996 0 997 0 998 0 999 0 1000 0 ntCard-1.2.2/data/test_k12.hist.good000066400000000000000000000135331373350065000171230ustar00rootroot00000000000000F1 1180000 F0 427653 1 229125 2 38207 3 38080 4 36672 5 32448 6 19775 7 13631 8 8575 9 4543 10 2303 11 1471 12 703 13 447 14 255 15 383 16 127 17 0 18 127 19 0 20 63 21 0 22 0 23 0 24 64 25 64 26 0 27 128 28 0 29 0 30 0 31 0 32 0 33 0 34 64 35 0 36 0 37 0 38 0 39 0 40 64 41 64 42 0 43 0 44 0 45 0 46 0 47 0 48 128 49 0 50 0 51 0 52 64 53 0 54 0 55 0 56 0 57 0 58 0 59 64 60 0 61 0 62 0 63 0 64 0 65 0 66 0 67 0 68 0 69 0 70 0 71 0 72 0 73 0 74 0 75 0 76 0 77 0 78 0 79 0 80 0 81 0 82 0 83 0 84 0 85 0 86 0 87 0 88 0 89 0 90 0 91 0 92 0 93 0 94 0 95 0 96 0 97 0 98 0 99 0 100 0 101 0 102 0 103 0 104 0 105 0 106 0 107 0 108 0 109 0 110 0 111 0 112 0 113 0 114 0 115 0 116 0 117 0 118 0 119 0 120 0 121 0 122 0 123 0 124 0 125 0 126 0 127 0 128 0 129 0 130 0 131 0 132 0 133 0 134 0 135 0 136 0 137 0 138 0 139 0 140 0 141 0 142 0 143 0 144 0 145 0 146 0 147 0 148 0 149 0 150 0 151 0 152 0 153 0 154 0 155 0 156 0 157 0 158 0 159 0 160 0 161 0 162 0 163 0 164 0 165 0 166 0 167 0 168 0 169 0 170 0 171 0 172 0 173 0 174 0 175 0 176 0 177 0 178 0 179 0 180 0 181 0 182 0 183 0 184 0 185 0 186 0 187 0 188 0 189 0 190 0 191 0 192 0 193 0 194 0 195 0 196 0 197 0 198 0 199 0 200 0 201 0 202 0 203 0 204 0 205 0 206 0 207 0 208 0 209 0 210 0 211 0 212 0 213 0 214 0 215 0 216 0 217 0 218 0 219 0 220 0 221 0 222 0 223 0 224 0 225 0 226 0 227 0 228 0 229 0 230 0 231 0 232 0 233 0 234 0 235 0 236 0 237 0 238 0 239 0 240 0 241 0 242 0 243 0 244 0 245 0 246 0 247 0 248 0 249 0 250 0 251 0 252 0 253 0 254 0 255 0 256 0 257 0 258 0 259 0 260 0 261 0 262 0 263 0 264 0 265 0 266 0 267 0 268 0 269 0 270 0 271 0 272 0 273 0 274 0 275 0 276 0 277 0 278 0 279 0 280 0 281 0 282 0 283 0 284 0 285 0 286 0 287 0 288 0 289 0 290 0 291 0 292 0 293 0 294 0 295 0 296 0 297 0 298 0 299 0 300 0 301 0 302 0 303 0 304 0 305 0 306 0 307 0 308 0 309 0 310 0 311 0 312 0 313 0 314 0 315 0 316 0 317 0 318 0 319 0 320 0 321 0 322 0 323 0 324 0 325 0 326 0 327 0 328 0 329 0 330 0 331 0 332 0 333 0 334 0 335 0 336 0 337 0 338 0 339 0 340 0 341 0 342 0 343 0 344 0 345 0 346 0 347 0 348 0 349 0 350 0 351 0 352 0 353 0 354 0 355 0 356 0 357 0 358 0 359 0 360 0 361 0 362 0 363 0 364 0 365 0 366 0 367 0 368 0 369 0 370 0 371 0 372 0 373 0 374 0 375 0 376 0 377 0 378 0 379 0 380 0 381 0 382 0 383 0 384 0 385 0 386 0 387 0 388 0 389 0 390 0 391 0 392 0 393 0 394 0 395 0 396 0 397 0 398 0 399 0 400 0 401 0 402 0 403 0 404 0 405 0 406 0 407 0 408 0 409 0 410 0 411 0 412 0 413 0 414 0 415 0 416 0 417 0 418 0 419 0 420 0 421 0 422 0 423 0 424 0 425 0 426 0 427 0 428 0 429 0 430 0 431 0 432 0 433 0 434 0 435 0 436 0 437 0 438 0 439 0 440 0 441 0 442 0 443 0 444 0 445 0 446 0 447 0 448 0 449 0 450 0 451 0 452 0 453 0 454 0 455 0 456 0 457 0 458 0 459 0 460 0 461 0 462 0 463 0 464 0 465 0 466 0 467 0 468 0 469 0 470 0 471 0 472 0 473 0 474 0 475 0 476 0 477 0 478 0 479 0 480 0 481 0 482 0 483 0 484 0 485 0 486 0 487 0 488 0 489 0 490 0 491 0 492 0 493 0 494 0 495 0 496 0 497 0 498 0 499 0 500 0 501 0 502 0 503 0 504 0 505 0 506 0 507 0 508 0 509 0 510 0 511 0 512 0 513 0 514 0 515 0 516 0 517 0 518 0 519 0 520 0 521 0 522 0 523 0 524 0 525 0 526 0 527 0 528 0 529 0 530 0 531 0 532 0 533 0 534 0 535 0 536 0 537 0 538 0 539 0 540 0 541 0 542 0 543 0 544 0 545 0 546 0 547 0 548 0 549 0 550 0 551 0 552 0 553 0 554 0 555 0 556 0 557 0 558 0 559 0 560 0 561 0 562 0 563 0 564 0 565 0 566 0 567 0 568 0 569 0 570 0 571 0 572 0 573 0 574 0 575 0 576 0 577 0 578 0 579 0 580 0 581 0 582 0 583 0 584 0 585 0 586 0 587 0 588 0 589 0 590 0 591 0 592 0 593 0 594 0 595 0 596 0 597 0 598 0 599 0 600 0 601 0 602 0 603 0 604 0 605 0 606 0 607 0 608 0 609 0 610 0 611 0 612 0 613 0 614 0 615 0 616 0 617 0 618 0 619 0 620 0 621 0 622 0 623 0 624 0 625 0 626 0 627 0 628 0 629 0 630 0 631 0 632 0 633 0 634 0 635 0 636 0 637 0 638 0 639 0 640 0 641 0 642 0 643 0 644 0 645 0 646 0 647 0 648 0 649 0 650 0 651 0 652 0 653 0 654 0 655 0 656 0 657 0 658 0 659 0 660 0 661 0 662 0 663 0 664 0 665 0 666 0 667 0 668 0 669 0 670 0 671 0 672 0 673 0 674 0 675 0 676 0 677 0 678 0 679 0 680 0 681 0 682 0 683 0 684 0 685 0 686 0 687 0 688 0 689 0 690 0 691 0 692 0 693 0 694 0 695 0 696 0 697 0 698 0 699 0 700 0 701 0 702 0 703 0 704 0 705 0 706 0 707 0 708 0 709 0 710 0 711 0 712 0 713 0 714 0 715 0 716 0 717 0 718 0 719 0 720 0 721 0 722 0 723 0 724 0 725 0 726 0 727 0 728 0 729 0 730 0 731 0 732 0 733 0 734 0 735 0 736 0 737 0 738 0 739 0 740 0 741 0 742 0 743 0 744 0 745 0 746 0 747 0 748 0 749 0 750 0 751 0 752 0 753 0 754 0 755 0 756 0 757 0 758 0 759 0 760 0 761 0 762 0 763 0 764 0 765 0 766 0 767 0 768 0 769 0 770 0 771 0 772 0 773 0 774 0 775 0 776 0 777 0 778 0 779 0 780 0 781 0 782 0 783 0 784 0 785 0 786 0 787 0 788 0 789 0 790 0 791 0 792 0 793 0 794 0 795 0 796 0 797 0 798 0 799 0 800 0 801 0 802 0 803 0 804 0 805 0 806 0 807 0 808 0 809 0 810 0 811 0 812 0 813 0 814 0 815 0 816 0 817 0 818 0 819 0 820 0 821 0 822 0 823 0 824 0 825 0 826 0 827 0 828 0 829 0 830 0 831 0 832 0 833 0 834 0 835 0 836 0 837 0 838 0 839 0 840 0 841 0 842 0 843 0 844 0 845 0 846 0 847 0 848 0 849 0 850 0 851 0 852 0 853 0 854 0 855 0 856 0 857 0 858 0 859 0 860 0 861 0 862 0 863 0 864 0 865 0 866 0 867 0 868 0 869 0 870 0 871 0 872 0 873 0 874 0 875 0 876 0 877 0 878 0 879 0 880 0 881 0 882 0 883 0 884 0 885 0 886 0 887 0 888 0 889 0 890 0 891 0 892 0 893 0 894 0 895 0 896 0 897 0 898 0 899 0 900 0 901 0 902 0 903 0 904 0 905 0 906 0 907 0 908 0 909 0 910 0 911 0 912 0 913 0 914 0 915 0 916 0 917 0 918 0 919 0 920 0 921 0 922 0 923 0 924 0 925 0 926 0 927 0 928 0 929 0 930 0 931 0 932 0 933 0 934 0 935 0 936 0 937 0 938 0 939 0 940 0 941 0 942 0 943 0 944 0 945 0 946 0 947 0 948 0 949 0 950 0 951 0 952 0 953 0 954 0 955 0 956 0 957 0 958 0 959 0 960 0 961 0 962 0 963 0 964 0 965 0 966 0 967 0 968 0 969 0 970 0 971 0 972 0 973 0 974 0 975 0 976 0 977 0 978 0 979 0 980 0 981 0 982 0 983 0 984 0 985 0 986 0 987 0 988 0 989 0 990 0 991 0 992 0 993 0 994 0 995 0 996 0 997 0 998 0 999 0 1000 0 ntCard-1.2.2/ntcard-logo.png000066400000000000000000001317721373350065000156630ustar00rootroot00000000000000PNG  IHDRxgAMA a cHRMz&u0`:pQ<eXIfMM*V^(1fixwww.inkscape.orgS pHYs#_#_6iTXtXML:com.adobe.xmp www.inkscape.org 1 UX@IDATx]U@@EE(@6) }> E"b(*gņR|E}Ox!LKNr߷nIf콒Lz€0 €0 €0 €0 €0 €0 €0 €0 €0 €0 €0 €0 €0 €0 €0 €0 €0 €0 €0 €0 €0 ?p,"€0 €0Pd l ~Ca@a@85a/@X<71€0 @I3Pޟ | |;4s0 €0Aև|}eo1 T*p0 @eI+"€0 €0ˀ\zf_1Qa@(i>*'aa@a@H)`R @׹tHb0 €0P :JJY!@a@H)agJ枔+f €0 %n`eWAz"€0X _$*"͟mH{ R H}UqɝI ֲ^+.'入aGE@ [ jzOCw77a@2'fQ/pQyҎ+k7R\v%qCfa@21N{WH;mq] D[nǥٙ(a pA卣pFv NJȓg@*淐< |8 (s$0ƀlƓP[@m7;3 =~,Ro8?ADpݸL(=.W[P=U@͌aw,5Q]{[\,`v#;3$0 0P ?[Gls\+eN]RпM"o@w:(Db׽n6{F'$,qSɀTnKC_?*qX^_$ - 1ۚKMb t_%}">B=đ(@0P<4!qI0RH!ACx~hf\ʠ>,#mN +  3 4$ a` iX6]87?Rc/ rVêncR'{"&i*= ׌:@ Co%~J 7i;-_ t+])l1& 3*WC~*,F0wɷ![aOf   ; <pw,]@~!\z.aʛf>}'̌\`I'{: L>\~PI^U@,ÄN_(k0683\pQDrEyq z^<`0V֗ zhsSLg>+/!BPG1f#<[q 0VL`4-%Tx>Ҵ97 :YʍPb V>pW0?VG~@5`8VVraKQӹ8R$Z|6}׀tfſ(\Qr).v-f=+썩-u OW+!_KL*R=t O1~dw|C5~8W=$9+  3[/_䐄 ۞OB_!ƄzB7\L֭ԇ C~s 7롓C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ʜ2% ܐh<3E=PZ# ,2   no!S\v(4ƍ7[ 5kHe*#_y$#@#`3' =p|˖-]" `xL/| ׸o ~ QH{"[l) 6 #include #include #include #include #include #include #include #include #include #ifdef _OPENMP #include #endif #define PROGRAM "ntCard" static const char VERSION_MESSAGE[] = PROGRAM " 1.2.2 \n" "Written by Hamid Mohamadi.\n" "Copyright 2018 Hamid Mohamadi, Licensed under MIT License\n"; static const char USAGE_MESSAGE[] = "Usage: " PROGRAM " [OPTION]... FILE(S)...\n" "Estimates k-mer coverage histogram in FILE(S).\n\n" "Acceptable file formats: fastq, fasta, sam, bam and in compressed formats gz, bz, zip, xz.\n" "A list of files containing file names in each row can be passed with @ prefix.\n" "\n" " Options:\n" "\n" " -t, --threads=N use N parallel threads [1] (N>=2 should be used when input files are >=2)\n" " -k, --kmer=N the length of kmer \n" " -g, --gap=N the length of gap in the gap seed [0]. g mod 2 must equal k mod 2 unless g == " "0\n" " -g does not support multiple k currently.\n" " -c, --cov=N the maximum coverage of kmer in output [1000]\n" " -p, --pref=STRING the prefix for output file name(s)\n" " -o, --output=STRING the name for output file name (used when output should be a single " "file)\n" " --help display this help and exit\n" " --version output version information and exit\n" "\n" "Report bugs to https://github.com/bcgsc/ntCard/issues\n"; using namespace std; namespace opt { unsigned nThrd = 1; unsigned kmLen = 64; unsigned gap = 0; size_t rBuck; unsigned rBits = 27; unsigned sBits = 11; unsigned sMask; unsigned covMax = 1000; size_t nSamp = 2; size_t nK = 0; string prefix; string output; bool samH = true; std::vector > seedSet; } static const char shortopts[] = "t:s:r:k:c:l:p:f:o:g:"; enum { OPT_HELP = 1, OPT_VERSION }; static const struct option longopts[] = { { "threads", required_argument, NULL, 't' }, { "kmer", required_argument, NULL, 'k' }, { "gap", required_argument, NULL, 'g' }, { "cov", required_argument, NULL, 'c' }, { "rbit", required_argument, NULL, 'r' }, { "sbit", required_argument, NULL, 's' }, { "output", required_argument, NULL, 'o' }, { "pref", required_argument, NULL, 'p' }, { "help", no_argument, NULL, OPT_HELP }, { "version", no_argument, NULL, OPT_VERSION }, { NULL, 0, NULL, 0 } }; size_t getInf(const char* inFile) { std::ifstream in(inFile, std::ifstream::ate | std::ifstream::binary); return in.tellg(); } bool isNumber(const string& seq) { string::const_iterator itr = seq.begin(); while (itr != seq.end() && isdigit(*itr)) ++itr; return (itr == seq.end() && !seq.empty()); } unsigned getftype(std::ifstream& in, std::string& samSeq) { std::string hseq; getline(in, hseq); if (hseq[0] == '>') { return 1; } if (hseq[0] == '@') { if ((hseq[1] == 'H' && hseq[2] == 'D') || (hseq[1] == 'S' && hseq[2] == 'Q') || (hseq[1] == 'R' && hseq[2] == 'G') || (hseq[1] == 'P' && hseq[2] == 'G') || (hseq[1] == 'C' && hseq[2] == 'O')) { return 2; } else return 0; } std::istringstream alnSec(hseq); std::string s1, s2, s3, s4, s5, s6, s7, s8, s9, s10, s11; alnSec >> s1 >> s2 >> s3 >> s4 >> s5 >> s6 >> s7 >> s8 >> s9 >> s10 >> s11; if (isNumber(s2) && isNumber(s5)) { opt::samH = false; samSeq = hseq; return 2; } return 3; } inline void ntComp(const uint64_t hVal, uint16_t* t_Counter) { uint64_t indBit = opt::nSamp; if (hVal >> (63 - opt::sBits) == 1) indBit = 0; if (hVal >> (64 - opt::sBits) == opt::sMask) indBit = 1; if (indBit < opt::nSamp) { size_t shVal = hVal & (opt::rBuck - 1); #pragma omp atomic ++t_Counter[indBit * opt::rBuck + shVal]; } } inline void ntRead(const string& seq, const std::vector& kList, uint16_t* t_Counter, size_t totKmer[]) { for (unsigned k = 0; k < kList.size(); k++) { ntHashIterator itr(seq, 1, kList[k]); while (itr != itr.end()) { ntComp((*itr)[0], t_Counter + k * opt::nSamp * opt::rBuck); ++itr; ++totKmer[k]; } } } inline void stRead(const string& seq, const std::vector& kList, uint16_t* t_Counter, size_t totKmer[]) { for (unsigned k = 0; k < kList.size(); k++) { stHashIterator itr(seq, opt::seedSet, 1, 1, kList[k]); while (itr != itr.end()) { ntComp((*itr)[0], t_Counter + k * opt::nSamp * opt::rBuck); ++itr; ++totKmer[k]; } } } void getEfq(std::ifstream& in, const std::vector& kList, uint16_t* t_Counter, size_t totKmer[]) { bool good = true; for (string seq, hseq; good;) { good = static_cast(getline(in, seq)); good = static_cast(getline(in, hseq)); good = static_cast(getline(in, hseq)); if (good && opt::gap == 0) { ntRead(seq, kList, t_Counter, totKmer); } if (good && opt::gap != 0) { stRead(seq, kList, t_Counter, totKmer); } good = static_cast(getline(in, hseq)); } } void getEfa(std::ifstream& in, const std::vector& kList, uint16_t* t_Counter, size_t totKmer[]) { bool good = true; for (string seq, hseq; good;) { string line; good = static_cast(getline(in, seq)); while (good && seq[0] != '>') { line += seq; good = static_cast(getline(in, seq)); } if (opt::gap == 0) { ntRead(line, kList, t_Counter, totKmer); } else { stRead(line, kList, t_Counter, totKmer); } } } void getEsm( std::ifstream& in, const std::vector& kList, const std::string& samSeq, uint16_t* t_Counter, size_t totKmer[]) { std::string samLine, seq; std::string s1, s2, s3, s4, s5, s6, s7, s8, s9, s11; if (opt::samH) { while (getline(in, samLine)) if (samLine[0] != '@') break; } else samLine = samSeq; do { std::istringstream iss(samLine); iss >> s1 >> s2 >> s3 >> s4 >> s5 >> s6 >> s7 >> s8 >> s9 >> seq >> s11; if (opt::gap == 0) { ntRead(seq, kList, t_Counter, totKmer); } else { stRead(seq, kList, t_Counter, totKmer); } } while (getline(in, samLine)); } void compEst(const uint16_t* t_Counter, double& F0Mean, double fMean[]) { unsigned p[opt::nSamp][65536]; for (size_t i = 0; i < opt::nSamp; i++) for (size_t j = 0; j < 65536; j++) p[i][j] = 0; for (size_t i = 0; i < opt::nSamp; i++) for (size_t j = 0; j < opt::rBuck; j++) ++p[i][t_Counter[i * opt::rBuck + j]]; double pMean[65536]; for (size_t i = 0; i < 65536; i++) pMean[i] = 0.0; for (size_t i = 0; i < 65536; i++) { for (size_t j = 0; j < opt::nSamp; j++) pMean[i] += p[j][i]; pMean[i] /= 1.0 * opt::nSamp; } F0Mean = (ssize_t)( (opt::rBits * log(2) - log(pMean[0])) * 1.0 * ((size_t)1 << (opt::sBits + opt::rBits))); for (size_t i = 0; i < 65536; i++) fMean[i] = 0; if (pMean[0] == 0) { return; } fMean[1] = -1.0 * pMean[1] / (pMean[0] * (log(pMean[0]) - opt::rBits * log(2))); for (size_t i = 2; i < 65536; i++) { double sum = 0.0; for (size_t j = 1; j < i; j++) sum += j * pMean[i - j] * fMean[j]; fMean[i] = -1.0 * pMean[i] / (pMean[0] * (log(pMean[0]) - opt::rBits * log(2))) - sum / (i * pMean[0]); } for (size_t i = 1; i < 65536; i++) fMean[i] = abs((ssize_t)(fMean[i] * F0Mean)); } void outDefault(const std::vector& kList, const size_t totalKmers[], const uint16_t* t_Counter) { std::ofstream histFiles[opt::nK]; for (unsigned k = 0; k < opt::nK; k++) { std::stringstream hstm; hstm << opt::prefix << "_k" << kList[k] << ".hist"; histFiles[k].open((hstm.str()).c_str()); } #pragma omp parallel for schedule(dynamic) for (unsigned k = 0; k < kList.size(); k++) { double F0Mean = 0.0; double fMean[65536]; compEst(t_Counter + k * opt::nSamp * opt::rBuck, F0Mean, fMean); histFiles[k] << "F1\t" << totalKmers[k] << "\n"; histFiles[k] << "F0\t" << (size_t)F0Mean << "\n"; for (size_t i = 1; i <= opt::covMax; i++) histFiles[k] << i << "\t" << (size_t)fMean[i] << "\n"; } for (unsigned k = 0; k < opt::nK; k++) histFiles[k].close(); } void outCompact(const std::vector& kList, const size_t totalKmers[], const uint16_t* t_Counter) { ofstream histFile(opt::output.c_str()); histFile << "k\tf\tn\n"; for (unsigned k = 0; k < kList.size(); k++) { double F0Mean = 0.0; double fMean[65536]; compEst(t_Counter + k * opt::nSamp * opt::rBuck, F0Mean, fMean); std::cerr << "k=" << kList[k] << "\tF1\t" << totalKmers[k] << "\n"; std::cerr << "k=" << kList[k] << "\tF0\t" << (size_t)F0Mean << "\n"; for (size_t i = 1; i <= opt::covMax; i++) histFile << kList[k] << "\t" << i << "\t" << (size_t)fMean[i] << "\n"; } histFile.close(); } int main(int argc, char** argv) { double sTime = omp_get_wtime(); vector kList; bool die = false; for (int c; (c = getopt_long(argc, argv, shortopts, longopts, NULL)) != -1;) { std::istringstream arg(optarg != NULL ? optarg : ""); switch (c) { case '?': die = true; break; case 't': arg >> opt::nThrd; break; case 's': arg >> opt::sBits; break; case 'r': arg >> opt::rBits; break; case 'c': arg >> opt::covMax; if (opt::covMax > 65535) opt::covMax = 65535; break; case 'p': arg >> opt::prefix; break; case 'o': arg >> opt::output; break; case 'g': arg >> opt::gap; break; case 'k': { std::string token; while (getline(arg, token, ',')) { unsigned myK; std::stringstream ss(token); ss >> myK; kList.push_back(myK); ++opt::nK; } break; } case OPT_HELP: std::cerr << USAGE_MESSAGE; exit(EXIT_SUCCESS); case OPT_VERSION: std::cerr << VERSION_MESSAGE; exit(EXIT_SUCCESS); } if (optarg != NULL && !arg.eof()) { std::cerr << PROGRAM ": invalid option: `-" << (char)c << optarg << "'\n"; exit(EXIT_FAILURE); } } if (argc - optind < 1) { std::cerr << PROGRAM ": missing arguments\n"; die = true; } if (opt::gap != 0 && (opt::gap % 2 != kList[0] % 2)) { std::cerr << PROGRAM "Gap size and kmer must have the same modulus\n"; die = true; } if (opt::nK == 0) { std::cerr << PROGRAM ": missing argument -k ... \n"; die = true; } if (opt::prefix.empty() && opt::output.empty()) { std::cerr << PROGRAM ": missing argument -p/-o ... \n"; die = true; } if (opt::gap != 0 && kList.size() != 1) { std::cerr << PROGRAM ": -g does not support multiple k currently.\n"; die = true; } if (die) { std::cerr << "Try `" << PROGRAM << " --help' for more information.\n"; exit(EXIT_FAILURE); } if (opt::gap != 0) { std::string gap(opt::gap, '0'); std::string nonGap((kList[0] - opt::gap) / 2, '1'); std::vector seedString; seedString.push_back(nonGap + gap + nonGap); opt::seedSet = stHashIterator::parseSeed(seedString); } vector inFiles; for (int i = optind; i < argc; ++i) { string file(argv[i]); if (file[0] == '@') { string inName; ifstream inList(file.substr(1, file.length()).c_str()); while (getline(inList, inName)) inFiles.push_back(inName); } else inFiles.push_back(file); } size_t totalSize = 0; for (unsigned file_i = 0; file_i < inFiles.size(); ++file_i) totalSize += getInf(inFiles[file_i].c_str()); if (totalSize < 50000000000) opt::sBits = 7; size_t totalKmers[kList.size()]; for (unsigned k = 0; k < kList.size(); k++) totalKmers[k] = 0; opt::rBuck = ((size_t)1) << opt::rBits; opt::sMask = (((size_t)1) << (opt::sBits - 1)) - 1; uint16_t* t_Counter = new uint16_t[opt::nK * opt::nSamp * opt::rBuck](); #ifdef _OPENMP omp_set_num_threads(opt::nThrd); #endif #pragma omp parallel for schedule(dynamic) for (unsigned file_i = 0; file_i < inFiles.size(); ++file_i) { size_t totKmer[kList.size()]; for (unsigned k = 0; k < kList.size(); k++) totKmer[k] = 0; std::ifstream in(inFiles[file_i].c_str()); std::string samSeq; unsigned ftype = getftype(in, samSeq); if (ftype == 0) getEfq(in, kList, t_Counter, totKmer); else if (ftype == 1) getEfa(in, kList, t_Counter, totKmer); else if (ftype == 2) getEsm(in, kList, samSeq, t_Counter, totKmer); else { std::cerr << "Error in reading file: " << inFiles[file_i] << std::endl; exit(EXIT_FAILURE); } in.close(); for (unsigned k = 0; k < kList.size(); k++) #pragma omp atomic totalKmers[k] += totKmer[k]; } if (opt::output.empty()) outDefault(kList, totalKmers, t_Counter); else outCompact(kList, totalKmers, t_Counter); delete[] t_Counter; std::cerr << "Runtime(sec): " << setprecision(4) << fixed << omp_get_wtime() - sTime << "\n"; return 0; } ntCard-1.2.2/nthll.cpp000066400000000000000000000163621373350065000145660ustar00rootroot00000000000000#include #include #include #include #include #include #include #include #include #include "vendor/ntHash/ntHashIterator.hpp" #include "Uncompress.h" #ifdef _OPENMP # include #endif #define PROGRAM "nthll" static const char VERSION_MESSAGE[] = PROGRAM " 1.2.2 \n" "Written by Hamid Mohamadi.\n" "Copyright 2018 Hamid Mohamadi, Licensed under MIT License\n"; static const char USAGE_MESSAGE[] = "Usage: " PROGRAM " [OPTION]... FILE(S)...\n" "Estimates distinct number of k-mers in FILE(S).\n\n" "Acceptable file formats: fastq, fasta, sam, bam and in compressed formats gz, bz, zip, xz.\n" "Accepts a list of files by adding @ at the beginning of the list name.\n" "\n" " Options:\n" "\n" " -t, --threads=N use N parallel threads [1] (N>=2 should be used when input files are >=2)\n" " -k, --kmer=N the length of kmer [64]\n" " --help display this help and exit\n" " --version output version information and exit\n" "\n" "Report bugs to https://github.com/bcgsc/ntCard/issues\n"; using namespace std; namespace opt { unsigned nThrd=1; unsigned nHash=7; unsigned kmLen=64; unsigned nBuck=65536; unsigned nBits=16; unsigned sBuck=4194304; unsigned sBits=22; size_t totKmer=0; bool canon=true; bool samH=true; } static const char shortopts[] = "t:k:b:s:hc"; enum { OPT_HELP = 1, OPT_VERSION }; static const struct option longopts[] = { { "threads", required_argument, NULL, 't' }, { "kmer", required_argument, NULL, 'k' }, { "bit", required_argument, NULL, 'b' }, { "sit", required_argument, NULL, 's' }, { "hash", required_argument, NULL, 'h' }, { "help", no_argument, NULL, OPT_HELP }, { "version", no_argument, NULL, OPT_VERSION }, { NULL, 0, NULL, 0 } }; unsigned getftype(std::ifstream &in, std::string &samSeq) { std::string hseq; getline(in,hseq); if(hseq[0]=='>') { return 1; } if(hseq[0]=='@') { if( (hseq[1]=='H'&& hseq[2]=='D') || (hseq[1]=='S'&& hseq[2]=='Q') || (hseq[1]=='R'&& hseq[2]=='G') || (hseq[1]=='P'&& hseq[2]=='G') || (hseq[1]=='C'&& hseq[2]=='O') ) { return 2; } else return 0; } opt::samH=false; samSeq=hseq; return 2; } inline void ntComp(const uint64_t hVal, uint8_t *mVec) { if(hVal&(~((uint64_t)opt::nBuck-1))) { uint8_t run0 = __builtin_clzll(hVal&(~((uint64_t)opt::nBuck-1))); if(run0 > mVec[hVal&(opt::nBuck-1)]) mVec[hVal&(opt::nBuck-1)]=run0; } } inline void ntRead(const string &seq, uint8_t *mVec) { ntHashIterator itr(seq, 1, opt::kmLen); while (itr != itr.end()) { ntComp((*itr)[0], mVec); ++itr; } } void getEfq(uint8_t *mVec, std::ifstream &in) { bool good = true; for(string seq, hseq; good;) { good = static_cast(getline(in, seq)); good = static_cast(getline(in, hseq)); good = static_cast(getline(in, hseq)); if(good && seq.length()>=opt::kmLen) ntRead(seq, mVec); good = static_cast(getline(in, hseq)); } } void getEfa(uint8_t *mVec, std::ifstream &in) { bool good = true; for(string seq, hseq; good;) { string line; good = static_cast(getline(in, seq)); while(good&&seq[0]!='>') { line+=seq; good = static_cast(getline(in, seq)); } if(line.length()>=opt::kmLen) ntRead(line, mVec); } } void getEsm(uint8_t *mVec, std::ifstream &in, const std::string &samSeq) { std::string samLine,seq; std::string s1,s2,s3,s4,s5,s6,s7,s8,s9,s11; if(opt::samH) { while(getline(in,samLine)) if (samLine[0]!='@') break; } else samLine=samSeq; do { std::istringstream iss(samLine); iss>>s1>>s2>>s3>>s4>>s5>>s6>>s7>>s8>>s9>>seq>>s11; if(seq.length()>=opt::kmLen) ntRead(seq, mVec); } while(getline(in,samLine)); } int main(int argc, char** argv) { bool die = false; for (int c; (c = getopt_long(argc, argv, shortopts, longopts, NULL)) != -1;) { std::istringstream arg(optarg != NULL ? optarg : ""); switch (c) { case '?': die = true; break; case 't': arg >> opt::nThrd; break; case 'b': arg >> opt::nBits; break; case 's': arg >> opt::sBits; break; case 'k': arg >> opt::kmLen; break; case 'c': opt::canon=true; break; case OPT_HELP: std::cerr << USAGE_MESSAGE; exit(EXIT_SUCCESS); case OPT_VERSION: std::cerr << VERSION_MESSAGE; exit(EXIT_SUCCESS); } if (optarg != NULL && !arg.eof()) { std::cerr << PROGRAM ": invalid option: `-" << (char)c << optarg << "'\n"; exit(EXIT_FAILURE); } } if (argc - optind < 1) { std::cerr << PROGRAM ": missing arguments\n"; die = true; } if (die) { std::cerr << "Try `" << PROGRAM << " --help' for more information.\n"; exit(EXIT_FAILURE); } vector inFiles; for (int i = optind; i < argc; ++i) { string file(argv[i]); if(file[0]=='@') { string inName; ifstream inList(file.substr(1,file.length()).c_str()); while(getline(inList,inName)) inFiles.push_back(inName); } else inFiles.push_back(file); } opt::nBuck = ((unsigned)1) << opt::nBits; opt::sBuck = ((unsigned)1) << opt::sBits; uint8_t *tVec = new uint8_t [opt::nBuck]; for (unsigned j=0; j