Skip to content
Commits on Source (4)
......@@ -16,7 +16,17 @@ We have implemented a tool called VSEARCH which supports *de novo* and reference
VSEARCH stands for vectorized search, as the tool takes advantage of parallelism in the form of SIMD vectorization as well as multiple threads to perform accurate alignments at high speed. VSEARCH uses an optimal global aligner (full dynamic programming Needleman-Wunsch), in contrast to USEARCH which by default uses a heuristic seed and extend aligner. This usually results in more accurate alignments and overall improved sensitivity (recall) with VSEARCH, especially for alignments with gaps.
VSEARCH binaries are provided for x86-64 systems running GNU/Linux, macOS (version 10.7 or higher) and Windows (64-bit, version 7 or higher), as well as for 64-bit little-endian POWER8 (ppc64le) and 64-bit ARMv8 systems (aarch64) running GNU/Linux. VSEARCH contains dedicated SIMD code for these three processors architectures (SSE2, AltiVec/VMX/VSX, Neon).
[VSEARCH binaries](https://github.com/torognes/vsearch/releases/latest) are provided for GNU/Linux on three processor architectures: x86-64, 64-bit little-endian POWER8 (ppc64le) and 64-bit ARMv8 (aarch64). VSEARCH contains dedicated SIMD code for these three processors architectures (SSE2/SSSE3, AltiVec/VMX/VSX, Neon). Binaries are also provided for MacOS (version 10.9 Mavericks or later) and Windows (64-bit, version 7 or higher).
| CPU \ OS | GNU/Linux | MacOS | Windows |
| ------------- | :-----------: | :----: | :-------: |
| x86_64 | ✔ | ✔ | ✔ |
| ARMv8 | ✔ | | |
| POWER8 | ✔ | | |
Various packages, plugins and wrappers are also available from other sources - see [below](https://github.com/torognes/vsearch#packages-plugins-and-wrappers).
The source code compiles correctly with gcc (versions 4.8 to 9.1) and llvm-clang (3.8 to 9.0). The source code should also compile on [FreeBSD](https://www.freebsd.org/) and [NetBSD](https://www.netbsd.org/) systems.
VSEARCH can directly read input query and database files that are compressed using gzip and bzip2 (.gz and .bz2) if the zlib and bzip2 libraries are available.
......@@ -24,7 +34,7 @@ Most of the nucleotide based commands and options in USEARCH version 7 are suppo
## Getting Help
If you can't find an answer in the [VSEARCH documentation](https://github.com/torognes/vsearch/releases/download/v2.10.4/vsearch_manual.pdf), please visit the [VSEARCH Web Forum](https://groups.google.com/forum/#!forum/vsearch-forum) to post a question or start a discussion.
If you can't find an answer in the [VSEARCH documentation](https://github.com/torognes/vsearch/releases/download/v2.13.5/vsearch_manual.pdf), please visit the [VSEARCH Web Forum](https://groups.google.com/forum/#!forum/vsearch-forum) to post a question or start a discussion.
## Example
......@@ -37,9 +47,9 @@ In the example below, VSEARCH will identify sequences in the file database.fsa t
**Source distribution** To download the source distribution from a [release](https://github.com/torognes/vsearch/releases) and build the executable and the documentation, use the following commands:
```
wget https://github.com/torognes/vsearch/archive/v2.10.4.tar.gz
tar xzf v2.10.4.tar.gz
cd vsearch-2.10.4
wget https://github.com/torognes/vsearch/archive/v2.13.5.tar.gz
tar xzf v2.13.5.tar.gz
cd vsearch-2.13.5
./autogen.sh
./configure
make
......@@ -68,57 +78,61 @@ Binary distributions are provided for x86-64 systems running GNU/Linux, macOS (v
Download the appropriate executable for your system using the following commands if you are using a Linux x86_64 system:
```sh
wget https://github.com/torognes/vsearch/releases/download/v2.10.4/vsearch-2.10.4-linux-x86_64.tar.gz
tar xzf vsearch-2.10.4-linux-x86_64.tar.gz
wget https://github.com/torognes/vsearch/releases/download/v2.13.5/vsearch-2.13.5-linux-x86_64.tar.gz
tar xzf vsearch-2.13.5-linux-x86_64.tar.gz
```
Or these commands if you are using a Linux ppc64le system:
```sh
wget https://github.com/torognes/vsearch/releases/download/v2.10.4/vsearch-2.10.4-linux-ppc64le.tar.gz
tar xzf vsearch-2.10.4-linux-ppc64le.tar.gz
wget https://github.com/torognes/vsearch/releases/download/v2.13.5/vsearch-2.13.5-linux-ppc64le.tar.gz
tar xzf vsearch-2.13.5-linux-ppc64le.tar.gz
```
Or these commands if you are using a Linux aarch64 system:
```sh
wget https://github.com/torognes/vsearch/releases/download/v2.10.4/vsearch-2.10.4-linux-aarch64.tar.gz
tar xzf vsearch-2.10.4-linux-aarch64.tar.gz
wget https://github.com/torognes/vsearch/releases/download/v2.13.5/vsearch-2.13.5-linux-aarch64.tar.gz
tar xzf vsearch-2.13.5-linux-aarch64.tar.gz
```
Or these commands if you are using a Mac:
```sh
wget https://github.com/torognes/vsearch/releases/download/v2.10.4/vsearch-2.10.4-macos-x86_64.tar.gz
tar xzf vsearch-2.10.4-macos-x86_64.tar.gz
wget https://github.com/torognes/vsearch/releases/download/v2.13.5/vsearch-2.13.5-macos-x86_64.tar.gz
tar xzf vsearch-2.13.5-macos-x86_64.tar.gz
```
Or if you are using Windows, download and extract (unzip) the contents of this file:
```
https://github.com/torognes/vsearch/releases/download/v2.10.4/vsearch-2.10.4-win-x86_64.zip
https://github.com/torognes/vsearch/releases/download/v2.13.5/vsearch-2.13.5-win-x86_64.zip
```
Linux and Mac: You will now have the binary distribution in a folder called `vsearch-2.10.4-linux-x86_64` or `vsearch-2.10.4-macos-x86_64` in which you will find three subfolders `bin`, `man` and `doc`. We recommend making a copy or a symbolic link to the vsearch binary `bin/vsearch` in a folder included in your `$PATH`, and a copy or a symbolic link to the vsearch man page `man/vsearch.1` in a folder included in your `$MANPATH`. The PDF version of the manual is available in `doc/vsearch_manual.pdf`.
Linux and Mac: You will now have the binary distribution in a folder called `vsearch-2.13.5-linux-x86_64` or `vsearch-2.13.5-macos-x86_64` in which you will find three subfolders `bin`, `man` and `doc`. We recommend making a copy or a symbolic link to the vsearch binary `bin/vsearch` in a folder included in your `$PATH`, and a copy or a symbolic link to the vsearch man page `man/vsearch.1` in a folder included in your `$MANPATH`. The PDF version of the manual is available in `doc/vsearch_manual.pdf`.
Windows: You will now have the binary distribution in a folder called `vsearch-2.10.4-win-x86_64`. The vsearch executable is called `vsearch.exe`. The manual in PDF format is called `vsearch_manual.pdf`.
Windows: You will now have the binary distribution in a folder called `vsearch-2.13.5-win-x86_64`. The vsearch executable is called `vsearch.exe`. The manual in PDF format is called `vsearch_manual.pdf`.
**Documentation** The VSEARCH user's manual is available in the `man` folder in the form of a [man page](https://github.com/torognes/vsearch/blob/master/man/vsearch.1). A pdf version ([vsearch_manual.pdf](https://github.com/torognes/vsearch/releases/download/v2.10.4/vsearch_manual.pdf)) will be generated by `make`. To install the manpage manually, copy the `vsearch.1` file or a create a symbolic link to `vsearch.1` in a folder included in your `$MANPATH`. The manual in both formats is also available with the binary distribution. The manual in PDF form ([vsearch_manual.pdf](https://github.com/torognes/vsearch/releases/download/v2.10.4/vsearch_manual.pdf)) is also attached to the latest [release](https://github.com/torognes/vsearch/releases).
**Documentation** The VSEARCH user's manual is available in the `man` folder in the form of a [man page](https://github.com/torognes/vsearch/blob/master/man/vsearch.1). A pdf version ([vsearch_manual.pdf](https://github.com/torognes/vsearch/releases/download/v2.13.5/vsearch_manual.pdf)) will be generated by `make`. To install the manpage manually, copy the `vsearch.1` file or a create a symbolic link to `vsearch.1` in a folder included in your `$MANPATH`. The manual in both formats is also available with the binary distribution. The manual in PDF form ([vsearch_manual.pdf](https://github.com/torognes/vsearch/releases/download/v2.13.5/vsearch_manual.pdf)) is also attached to the latest [release](https://github.com/torognes/vsearch/releases).
## Plugins, packages, and wrappers
**QIIME 2 plugin** Thanks to the [QIIME 2](https://github.com/qiime2) team, there is now a plugin called [q2-vsearch](https://github.com/qiime2/q2-vsearch) for [QIIME 2](https://qiime2.org).
## Packages, plugins, and wrappers
**Conda package** Thanks to the [BioConda](https://bioconda.github.io/) team, there is now a [vsearch package](https://anaconda.org/bioconda/vsearch) in [Conda](https://conda.io/).
**Homebrew package** Thanks to [Torsten Seeman](https://github.com/tseemann), a [vsearch package](https://github.com/Homebrew/homebrew-science/pull/2409) for [Homebrew](http://brew.sh/) has been made.
**Debian package** Thanks to the [Debian Med](https://www.debian.org/devel/debian-med/) team, there is now a [vsearch](https://packages.debian.org/sid/vsearch) package in [Debian](https://www.debian.org/).
**FreeBSD ports package** Thanks to [Jason Bacon](https://github.com/outpaddling), a [vsearch](https://www.freebsd.org/cgi/ports.cgi?query=vsearch&stype=all) [FreeBSD ports](https://www.freebsd.org/ports/) package is available. Install the binary package with `pkg install vsearch`, or build from source with additional optimizations.
**Galaxy wrapper** Thanks to the work of the [Intergalactic Utilities Commission](https://wiki.galaxyproject.org/IUC) members, vsearch is now part of the [Galaxy ToolShed](https://toolshed.g2.bx.psu.edu/view/iuc/vsearch/).
**Homebrew package** Thanks to [Torsten Seeman](https://github.com/tseemann), a [vsearch package](https://github.com/Homebrew/homebrew-science/pull/2409) for [Homebrew](http://brew.sh/) has been made.
**Pkgsrc package** Thanks to [Jason Bacon](https://github.com/outpaddling), a vsearch [pkgsrc](https://www.pkgsrc.org) package is available for NetBSD and other UNIX-like systems. Install the binary package with `pkgin install vsearch`, or build from source with additional optimizations.
**QIIME 2 plugin** Thanks to the [QIIME 2](https://github.com/qiime2) team, there is now a plugin called [q2-vsearch](https://github.com/qiime2/q2-vsearch) for [QIIME 2](https://qiime2.org).
## Converting output to a biom file for use in QIIME and other software
......@@ -176,11 +190,11 @@ The code is written in C++ but most of it is actually mostly C with some C++ syn
File | Description
---|---
**abundance.cc** | Code for extracting and printing abundance information from FASTA headers
**align.cc** | New Needleman-Wunsch global alignment, serial. Only for testing.
**align_simd.cc** | SIMD parallel global alignment of 1 query with 8 database sequences
**allpairs.cc** | All-vs-all optimal global pairwise alignment (no heuristics)
**arch.cc** | Architecture specific code (Mac/Linux)
**attributes.cc** | Extraction and printing of attributes in FASTA headers
**bitmap.cc** | Implementation of bitmaps
**chimera.cc** | Chimera detection
**city.cc** | CityHash code
......@@ -197,6 +211,8 @@ File | Description
**fastqjoin.cc** | FASTQ paired-end reads joining
**fastqops.cc** | FASTQ file statistics etc
**fastx.cc** | Detection of FASTA and FASTQ files, wrapper for FASTA and FASTQ parsers
**filter.cc** | Trimming and filtering of sequences in FASTA and FASTQ files
**getseq.cc** | Extraction of sequences based on header labels
**kmerhash.cc** | Hash for kmers used by paired-end read merger
**linmemalign.cc** | Linear memory global sequence aligner
**maps.cc** | Various character mapping arrays
......
......@@ -2,7 +2,7 @@
# Process this file with autoconf to produce a configure script.
AC_PREREQ([2.63])
AC_INIT([vsearch], [2.10.4], [torognes@ifi.uio.no])
AC_INIT([vsearch], [2.13.5], [torognes@ifi.uio.no])
AC_CANONICAL_TARGET
AM_INIT_AUTOMAKE([subdir-objects])
AC_LANG([C++])
......@@ -10,7 +10,7 @@ AC_CONFIG_SRCDIR([src/vsearch.cc])
AC_CONFIG_HEADERS([config.h])
AC_SUBST(MACOSX_DEPLOYMENT_TARGET)
MACOSX_DEPLOYMENT_TARGET="10.7"
MACOSX_DEPLOYMENT_TARGET="10.9"
# Set default gcc and g++ options
......
vsearch (2.13.5-1) unstable; urgency=medium
* New upstream version
-- Andreas Tille <tille@debian.org> Tue, 02 Jul 2019 15:47:11 +0200
vsearch (2.10.4-1) unstable; urgency=medium
* New upstream version
......
This diff is collapsed.
......@@ -12,20 +12,21 @@ endif
AM_CFLAGS=$(AM_CXXFLAGS)
export MACOSX_DEPLOYMENT_TARGET
export MACOSX_DEPLOYMENT_TARGET=10.9
VSEARCHHEADERS=\
abundance.h \
align.h \
align_simd.h \
allpairs.h \
arch.h \
attributes.h \
bitmap.h \
chimera.h \
city.h \
citycrc.h \
cluster.h \
cpu.h \
cut.h \
db.h \
dbhash.h \
dbindex.h \
......@@ -37,6 +38,8 @@ fastq.h \
fastqjoin.h \
fastqops.h \
fastx.h \
filter.h \
getseq.h \
kmerhash.h \
linmemalign.h \
maps.h \
......@@ -107,14 +110,15 @@ endif
endif
__top_builddir__bin_vsearch_SOURCES = $(VSEARCHHEADERS) \
abundance.cc \
align.cc \
align_simd.cc \
allpairs.cc \
arch.cc \
attributes.cc \
bitmap.cc \
chimera.cc \
cluster.cc \
cut.cc \
db.cc \
dbhash.cc \
dbindex.cc \
......@@ -126,6 +130,8 @@ fastq.cc \
fastqjoin.cc \
fastqops.cc \
fastx.cc \
filter.cc \
getseq.cc \
kmerhash.cc \
linmemalign.cc \
maps.cc \
......
......@@ -2,7 +2,7 @@
VSEARCH: a versatile open source tool for metagenomics
Copyright (C) 2014-2018, Torbjorn Rognes, Frederic Mahe and Tomas Flouri
Copyright (C) 2014-2019, Torbjorn Rognes, Frederic Mahe and Tomas Flouri
All rights reserved.
Contact: Torbjorn Rognes <torognes@ifi.uio.no>,
......@@ -169,14 +169,6 @@ void nw_exit(struct nwinfo_s * nw)
xfree(nw);
}
inline int nt_identical(char a, char b)
{
if (chrmap_4bit[(int)a] == chrmap_4bit[(int)b])
return 1;
else
return 0;
}
inline int64_t getscore(int64_t * score_matrix, char a, char b)
{
return score_matrix[(chrmap_4bit[(int)a]<<4) + chrmap_4bit[(int)b]];
......@@ -394,7 +386,7 @@ void nw_align(char * dseq,
else
{
score += getscore(score_matrix, dseq[j-1], qseq[i-1]);
if (nt_identical(dseq[j-1], qseq[i-1]))
if (chrmap_4bit[(int)(dseq[j-1])] & chrmap_4bit[(int)(qseq[i-1])])
matches++;
i--;
j--;
......
......@@ -2,7 +2,7 @@
VSEARCH: a versatile open source tool for metagenomics
Copyright (C) 2014-2018, Torbjorn Rognes, Frederic Mahe and Tomas Flouri
Copyright (C) 2014-2019, Torbjorn Rognes, Frederic Mahe and Tomas Flouri
All rights reserved.
Contact: Torbjorn Rognes <torognes@ifi.uio.no>,
......
......@@ -920,7 +920,7 @@ void backtrack16(s16info_s * s,
}
else
{
if (chrmap_4bit[(int)(qseq[i])] == chrmap_4bit[(int)(dseq[j])])
if (chrmap_4bit[(int)(qseq[i])] & chrmap_4bit[(int)(dseq[j])])
matches++;
else
mismatches++;
......@@ -995,28 +995,17 @@ struct s16info_s * search16_init(CELL score_match,
for(int j=0; j<16; j++)
{
CELL value;
if (i==j)
value = opt_match;
else if ((i==0) || (j==0) || (i>4) || (j>4))
value = 0;
else
value = opt_mismatch;
((CELL*)(&s->matrix))[16*i+j] = value;
}
for(int i=0; i<16; i++)
for(int j=0; j<16; j++)
{
CELL value;
if ((i==0) || (j==0) || (i>4) || (j>4))
if (ambiguous_4bit[i] || ambiguous_4bit[j])
value = 0;
else if (i == j)
value = opt_match;
else
value = opt_mismatch;
((CELL*)(&s->matrix))[16*i+j] = value;
scorematrix[i][j] = value;
}
s->penalty_gap_open_query_left = penalty_gap_open_query_left;
s->penalty_gap_open_query_interior = penalty_gap_open_query_interior;
s->penalty_gap_open_query_right = penalty_gap_open_query_right;
......
......@@ -2,7 +2,7 @@
VSEARCH: a versatile open source tool for metagenomics
Copyright (C) 2014-2018, Torbjorn Rognes, Frederic Mahe and Tomas Flouri
Copyright (C) 2014-2019, Torbjorn Rognes, Frederic Mahe and Tomas Flouri
All rights reserved.
Contact: Torbjorn Rognes <torognes@ifi.uio.no>,
......
......@@ -2,7 +2,7 @@
VSEARCH: a versatile open source tool for metagenomics
Copyright (C) 2014-2018, Torbjorn Rognes, Frederic Mahe and Tomas Flouri
Copyright (C) 2014-2019, Torbjorn Rognes, Frederic Mahe and Tomas Flouri
All rights reserved.
Contact: Torbjorn Rognes <torognes@ifi.uio.no>,
......@@ -226,6 +226,7 @@ void allpairs_output_results(int hit_count,
strlen(query_head),
0,
count_matched,
-1.0,
-1, -1, 0, 0.0);
}
else
......@@ -240,6 +241,7 @@ void allpairs_output_results(int hit_count,
strlen(query_head),
0,
count_notmatched,
-1.0,
-1, -1, 0, 0.0);
}
}
......
......@@ -2,7 +2,7 @@
VSEARCH: a versatile open source tool for metagenomics
Copyright (C) 2014-2018, Torbjorn Rognes, Frederic Mahe and Tomas Flouri
Copyright (C) 2014-2019, Torbjorn Rognes, Frederic Mahe and Tomas Flouri
All rights reserved.
Contact: Torbjorn Rognes <torognes@ifi.uio.no>,
......
......@@ -2,7 +2,7 @@
VSEARCH: a versatile open source tool for metagenomics
Copyright (C) 2014-2018, Torbjorn Rognes, Frederic Mahe and Tomas Flouri
Copyright (C) 2014-2019, Torbjorn Rognes, Frederic Mahe and Tomas Flouri
All rights reserved.
Contact: Torbjorn Rognes <torognes@ifi.uio.no>,
......@@ -298,3 +298,12 @@ int xopen_write(const char * path)
S_IRUSR | S_IWUSR);
#endif
}
const char * xstrcasestr(const char * haystack, const char * needle)
{
#ifdef _WIN32
return StrStrIA(haystack, needle);
#else
return strcasestr(haystack, needle);
#endif
}
......@@ -2,7 +2,7 @@
VSEARCH: a versatile open source tool for metagenomics
Copyright (C) 2014-2018, Torbjorn Rognes, Frederic Mahe and Tomas Flouri
Copyright (C) 2014-2019, Torbjorn Rognes, Frederic Mahe and Tomas Flouri
All rights reserved.
Contact: Torbjorn Rognes <torognes@ifi.uio.no>,
......@@ -81,3 +81,5 @@ uint64_t xftello(FILE * stream);
int xopen_read(const char * path);
int xopen_write(const char * path);
const char * xstrcasestr(const char * haystack, const char * needle);
......@@ -2,7 +2,7 @@
VSEARCH: a versatile open source tool for metagenomics
Copyright (C) 2014-2018, Torbjorn Rognes, Frederic Mahe and Tomas Flouri
Copyright (C) 2014-2019, Torbjorn Rognes, Frederic Mahe and Tomas Flouri
All rights reserved.
Contact: Torbjorn Rognes <torognes@ifi.uio.no>,
......@@ -64,14 +64,17 @@ bool header_find_attribute(const char * header,
int header_length,
const char * attribute,
int * start,
int * end)
int * end,
bool allow_decimal)
{
/*
Identify the first occurence of the pattern (^|;)size=([0-9]+)(;|$)
in the header string, where "size=" is the specified attribute.
If allow_decimal is true, a dot (.) is allowed within the digits.
*/
const char * digit_chars = "0123456789";
const char * digit_chars_decimal = "0123456789.";
if ((! header) || (! attribute))
return false;
......@@ -98,7 +101,9 @@ bool header_find_attribute(const char * header,
continue;
}
int digits = (int) strspn(header + i + alen, digit_chars);
int digits
= (int) strspn(header + i + alen,
(allow_decimal ? digit_chars_decimal : digit_chars));
/* check for at least one digit */
if (digits == 0)
......@@ -122,13 +127,18 @@ bool header_find_attribute(const char * header,
return false;
}
int64_t abundance_get(char * header, int header_length)
int64_t header_get_size(char * header, int header_length)
{
/* read size/abundance annotation */
int64_t abundance = 1;
int64_t abundance = 0;
int start = 0;
int end = 0;
if (header_find_attribute(header, header_length, "size=", & start, & end))
if (header_find_attribute(header,
header_length,
"size=",
& start,
& end,
false))
{
int64_t number = atol(header + start + 5);
if (number > 0)
......@@ -139,29 +149,109 @@ int64_t abundance_get(char * header, int header_length)
return abundance;
}
void abundance_fprint_header_strip_size(FILE * fp,
void header_fprint_strip_size_ee(FILE * fp,
char * header,
int header_length)
int header_length,
bool strip_size,
bool strip_ee)
{
int start = 0;
int end = 0;
if (header_find_attribute(header, header_length, "size=", & start, & end))
int attributes = 0;
int attribute_start[2];
int attribute_end[2];
/* look for size attribute */
int size_start = 0;
int size_end = 0;
bool size_found = false;
if (strip_size)
size_found = header_find_attribute(header,
header_length,
"size=",
& size_start,
& size_end,
false);
if (size_found)
{
if (start <= 1)
attribute_start[attributes] = size_start;
attribute_end[attributes] = size_end;
attributes++;
}
/* look for ee attribute */
int ee_start = 0;
int ee_end = 0;
bool ee_found = false;
if (strip_ee)
ee_found = header_find_attribute(header,
header_length,
"ee=",
& ee_start,
& ee_end,
true);
if (ee_found)
{
if (end < header_length - 1)
fprintf(fp, "%s", header + end + 1);
attribute_start[attributes] = ee_start;
attribute_end[attributes] = ee_end;
attributes++;
}
else
/* sort */
if (attributes > 1)
{
if (end >= header_length - 1)
fprintf(fp, "%.*s", start - 1, header);
else
fprintf(fp, "%.*s;%.*s",
start - 1, header,
header_length - end - 1, header + end + 1);
if (attribute_start[0] > attribute_start[1])
{
/* swap */
int s = attribute_start[0];
int e = attribute_end[0];
attribute_start[0] = attribute_start[1];
attribute_end[0] = attribute_end[1];
attribute_start[1] = s;
attribute_end[1] = e;
}
}
/* print */
if (attributes == 0)
{
fprintf(fp, "%.*s", header_length, header);
}
else
fprintf(fp, "%s", header);
{
int prev_end = 0;
for (int i = 0; i < attributes; i++)
{
/* print part of header in front of this attribute */
if (attribute_start[i] > prev_end + 1)
{
fprintf(fp, "%.*s",
attribute_start[i] - prev_end - 1,
header + prev_end);
}
prev_end = attribute_end[i];
}
/* print the rest, if any */
if (header_length > prev_end + 1)
{
fprintf(fp, "%.*s",
header_length - prev_end,
header + prev_end);
}
}
}
void header_fprint_strip_size(FILE * fp,
char * header,
int header_length)
{
header_fprint_strip_size_ee(fp,
header,
header_length,
true,
false);
}
......@@ -2,7 +2,7 @@
VSEARCH: a versatile open source tool for metagenomics
Copyright (C) 2014-2018, Torbjorn Rognes, Frederic Mahe and Tomas Flouri
Copyright (C) 2014-2019, Torbjorn Rognes, Frederic Mahe and Tomas Flouri
All rights reserved.
Contact: Torbjorn Rognes <torognes@ifi.uio.no>,
......@@ -58,16 +58,14 @@
*/
int64_t abundance_get(char * header, int header_length);
int64_t header_get_size(char * header, int header_length);
void abundance_fprint_header_with_size(FILE * fp,
char * header,
int header_length,
uint64_t size);
void abundance_fprint_header_strip_size(FILE * fp,
void header_fprint_strip_size(FILE * fp,
char * header,
int header_length);
char * abundance_strip_size(char * header,
int header_length);
void header_fprint_strip_size_ee(FILE * fp,
char * header,
int header_length,
bool strip_size,
bool strip_ee);
......@@ -2,7 +2,7 @@
VSEARCH: a versatile open source tool for metagenomics
Copyright (C) 2014-2018, Torbjorn Rognes, Frederic Mahe and Tomas Flouri
Copyright (C) 2014-2019, Torbjorn Rognes, Frederic Mahe and Tomas Flouri
All rights reserved.
Contact: Torbjorn Rognes <torognes@ifi.uio.no>,
......
......@@ -2,7 +2,7 @@
VSEARCH: a versatile open source tool for metagenomics
Copyright (C) 2014-2018, Torbjorn Rognes, Frederic Mahe and Tomas Flouri
Copyright (C) 2014-2019, Torbjorn Rognes, Frederic Mahe and Tomas Flouri
All rights reserved.
Contact: Torbjorn Rognes <torognes@ifi.uio.no>,
......
......@@ -2,7 +2,7 @@
VSEARCH: a versatile open source tool for metagenomics
Copyright (C) 2014-2018, Torbjorn Rognes, Frederic Mahe and Tomas Flouri
Copyright (C) 2014-2019, Torbjorn Rognes, Frederic Mahe and Tomas Flouri
All rights reserved.
Contact: Torbjorn Rognes <torognes@ifi.uio.no>,
......@@ -232,7 +232,7 @@ int find_best_parents(struct chimera_info_s * ci)
case 'M':
for(int k=0; k<run; k++)
{
if (chrmap_4bit[(int)(qseq[qpos])] ==
if (chrmap_4bit[(int)(qseq[qpos])] &
chrmap_4bit[(int)(tseq[tpos])])
ci->match[i * ci->query_len + qpos] = 1;
qpos++;
......@@ -510,9 +510,9 @@ int eval_parents(struct chimera_info_s * ci)
for(int i = 0; i < alnlen; i++)
{
char qsym = chrmap_4bit[(int)(ci->qaln [i])];
char p1sym = chrmap_4bit[(int)(ci->paln[0][i])];
char p2sym = chrmap_4bit[(int)(ci->paln[1][i])];
unsigned int qsym = chrmap_4bit[(int)(ci->qaln [i])];
unsigned int p1sym = chrmap_4bit[(int)(ci->paln[0][i])];
unsigned int p2sym = chrmap_4bit[(int)(ci->paln[1][i])];
/* mark positions to ignore in voting */
......@@ -526,8 +526,10 @@ int eval_parents(struct chimera_info_s * ci)
ci->ignore[i+1] = 1;
}
/* ignore ambigous symbols */
if ((qsym>4) || (p1sym>4) || (p2sym>4))
/* ignore ambiguous symbols */
if ((ambiguous_4bit[qsym]) ||
(ambiguous_4bit[p1sym]) ||
(ambiguous_4bit[p2sym]))
ci->ignore[i] = 1;
/* lower case parent symbols that differ from query */
......@@ -812,7 +814,7 @@ int eval_parents(struct chimera_info_s * ci)
fprintf(fp_uchimealns, "Query (%5d nt) ",
ci->query_len);
if (opt_xsize)
abundance_fprint_header_strip_size(fp_uchimealns,
header_fprint_strip_size(fp_uchimealns,
ci->query_head,
ci->query_head_len);
else
......@@ -821,7 +823,7 @@ int eval_parents(struct chimera_info_s * ci)
fprintf(fp_uchimealns, "\nParentA (%5" PRIu64 " nt) ",
db_getsequencelen(seqno_a));
if (opt_xsize)
abundance_fprint_header_strip_size(fp_uchimealns,
header_fprint_strip_size(fp_uchimealns,
db_getheader(seqno_a),
db_getheaderlen(seqno_a));
else
......@@ -830,7 +832,7 @@ int eval_parents(struct chimera_info_s * ci)
fprintf(fp_uchimealns, "\nParentB (%5" PRIu64 " nt) ",
db_getsequencelen(seqno_b));
if (opt_xsize)
abundance_fprint_header_strip_size(fp_uchimealns,
header_fprint_strip_size(fp_uchimealns,
db_getheader(seqno_b),
db_getheaderlen(seqno_b));
else
......@@ -911,15 +913,15 @@ int eval_parents(struct chimera_info_s * ci)
if (opt_xsize)
{
abundance_fprint_header_strip_size(fp_uchimeout,
header_fprint_strip_size(fp_uchimeout,
ci->query_head,
ci->query_head_len);
fprintf(fp_uchimeout, "\t");
abundance_fprint_header_strip_size(fp_uchimeout,
header_fprint_strip_size(fp_uchimeout,
db_getheader(seqno_a),
db_getheaderlen(seqno_a));
fprintf(fp_uchimeout, "\t");
abundance_fprint_header_strip_size(fp_uchimeout,
header_fprint_strip_size(fp_uchimeout,
db_getheader(seqno_b),
db_getheaderlen(seqno_b));
fprintf(fp_uchimeout, "\t");
......@@ -938,11 +940,11 @@ int eval_parents(struct chimera_info_s * ci)
if (opt_xsize)
{
if (QA >= QB)
abundance_fprint_header_strip_size(fp_uchimeout,
header_fprint_strip_size(fp_uchimeout,
db_getheader(seqno_a),
db_getheaderlen(seqno_a));
else
abundance_fprint_header_strip_size(fp_uchimeout,
header_fprint_strip_size(fp_uchimeout,
db_getheader(seqno_b),
db_getheaderlen(seqno_b));
fprintf(fp_uchimeout, "\t");
......@@ -1343,6 +1345,7 @@ uint64_t chimera_thread_core(struct chimera_info_s * ci)
ci->query_head_len,
ci->query_size,
chimera_count,
-1.0,
-1,
-1,
opt_fasta_score ?
......@@ -1365,6 +1368,7 @@ uint64_t chimera_thread_core(struct chimera_info_s * ci)
ci->query_head_len,
ci->query_size,
borderline_count,
-1.0,
-1,
-1,
opt_fasta_score ?
......@@ -1384,7 +1388,7 @@ uint64_t chimera_thread_core(struct chimera_info_s * ci)
fprintf(fp_uchimeout, "0.0000\t");
if (opt_xsize)
abundance_fprint_header_strip_size(fp_uchimeout,
header_fprint_strip_size(fp_uchimeout,
ci->query_head,
ci->query_head_len);
else
......@@ -1411,6 +1415,7 @@ uint64_t chimera_thread_core(struct chimera_info_s * ci)
ci->query_head_len,
ci->query_size,
nonchimera_count,
-1.0,
-1,
-1,
opt_fasta_score ?
......@@ -1505,15 +1510,17 @@ void chimera()
opt_maxaccepts = few;
opt_maxrejects = rejects;
opt_id = chimera_id;
opt_strand = 1;
opt_self = 1;
opt_selfid = 1;
if (opt_uchime_denovo || opt_uchime2_denovo || opt_uchime3_denovo)
opt_threads = 1;
if (opt_strand != 1)
fatal("Only --strand plus is allowed with uchime_ref.");
if (opt_uchime_denovo || opt_uchime2_denovo || opt_uchime3_denovo)
{
opt_self = 1;
opt_selfid = 1;
opt_threads = 1;
opt_maxsizeratio = 1.0 / opt_abskew;
}
tophits = opt_maxaccepts + opt_maxrejects;
......
......@@ -2,7 +2,7 @@
VSEARCH: a versatile open source tool for metagenomics
Copyright (C) 2014-2018, Torbjorn Rognes, Frederic Mahe and Tomas Flouri
Copyright (C) 2014-2019, Torbjorn Rognes, Frederic Mahe and Tomas Flouri
All rights reserved.
Contact: Torbjorn Rognes <torognes@ifi.uio.no>,
......
......@@ -60,6 +60,12 @@ static uint32 UNALIGNED_LOAD32(const char *p) {
#define bswap_32(x) OSSwapInt32(x)
#define bswap_64(x) OSSwapInt64(x)
#elif defined(__FreeBSD__)
#include <sys/endian.h>
#define bswap_32(x) bswap32(x)
#define bswap_64(x) bswap64(x)
#elif defined(__NetBSD__)
#include <sys/types.h>
......