Skip to content

Commit

Permalink
Swarm 2.1.6: Fix bug in seed output and problems with old compilers
Browse files Browse the repository at this point in the history
  • Loading branch information
torognes committed Dec 14, 2015
1 parent eec5b60 commit 26c5d25
Show file tree
Hide file tree
Showing 5 changed files with 40 additions and 17 deletions.
20 changes: 14 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ Table of Content
* [Third-party pipelines](#pipelines)
* [Alternatives](#alternatives)
* [New features](#features)
* [version 2.1.6](#version216)
* [version 2.1.5](#version215)
* [version 2.1.4](#version214)
* [version 2.1.3](#version213)
Expand Down Expand Up @@ -383,13 +384,13 @@ released since 2004.

To cite **swarm**, please refer to:

Mahé F, Rognes T, Quince C, de Vargas C, Dunthorn M. (2014) Swarm:
robust and fast clustering method for amplicon-based studies. PeerJ
2:e593 http://dx.doi.org/10.7717/peerj.593
Mahé F, Rognes T, Quince C, de Vargas C, Dunthorn M. (2014)
Swarm: robust and fast clustering method for amplicon-based studies.
PeerJ 2:e593 doi: [10.7717/peerj.593](http://dx.doi.org/10.7717/peerj.593)

Mahé F, Rognes T, Quince C, de Vargas C, Dunthorn M. (in preparation)
Swarm v2: highly-scalable and high-resolution amplicon
clustering. https://dx.doi.org/10.7287/peerj.preprints.1222v2
Mahé F, Rognes T, Quince C, de Vargas C, Dunthorn M. (2015)
Swarm v2: highly-scalable and high-resolution amplicon clustering.
PeerJ 3:e1420 doi: [10.7717/peerj.1420](http://dx.doi.org/10.7717/peerj.1420)


<a name="contact"/>
Expand Down Expand Up @@ -433,6 +434,13 @@ methods, here are some links:
<a name="features"/>
## New features##

<a name="version216"/>
### version 2.1.6 ###

**swarm** 2.1.6 fixes problems with older compilers that do not have
the x86intrin.h header file. It also fixes a bug in the output of seeds
with the `-w` option when d>1.

<a name="version215"/>
### version 2.1.5 ###

Expand Down
19 changes: 12 additions & 7 deletions man/swarm.1
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
.\" ============================================================================
.TH swarm 1 "September 8, 2015" "version 2.1.5" "USER COMMANDS"
.TH swarm 1 "December 14, 2015" "version 2.1.6" "USER COMMANDS"
.\" ============================================================================
.SH NAME
swarm \(em find clusters of nearly-identical nucleotide amplicons
Expand Down Expand Up @@ -277,13 +277,13 @@ option) using 4 computation threads. OTUs are written to the file
Concept by Frédéric Mahé, implementation by Torbjørn Rognes.
.\" ============================================================================
.SH CITATION
Mahé F, Rognes T, Quince C, de Vargas C, Dunthorn M. (2014) Swarm:
robust and fast clustering method for amplicon-based
studies. \fIPeerJ\fR 2:e593 <http://dx.doi.org/10.7717/peerj.593>
Mahé F, Rognes T, Quince C, de Vargas C, Dunthorn M. (2014)
Swarm: robust and fast clustering method for amplicon-based studies.
\fIPeerJ\fR 2:e593 <http://dx.doi.org/10.7717/peerj.593>
.PP
Mahé F, Rognes T, Quince C, de Vargas C, Dunthorn M. (2015) Swarm v2:
highly-scalable and high-resolution amplicon clustering. \fIPeerJ
PrePrints\fR 3:e1503 <http://dx.doi.org/10.7287/peerj.preprints.1222v2>
Mahé F, Rognes T, Quince C, de Vargas C, Dunthorn M. (2015)
Swarm v2: highly-scalable and high-resolution amplicon clustering.
\fIPeerJ\fR 3:e1420 <http://dx.doi.org/10.7717/peerj.1420>
.\" ============================================================================
.SH REPORTING BUGS
Submit suggestions and bug-reports at
Expand Down Expand Up @@ -329,6 +329,11 @@ New features and important modifications of \fBswarm\fR (short lived
or minor bug releases are not mentioned):
.RS
.TP
.BR v2.1.6\~ "released December 14, 2015"
Version 2.1.6 fixes problems with older compilers that do not have
the x86intrin.h header file. It also fixes a bug in the output of seeds
with the `-w` option when d>1.
.TP
.BR v2.1.5\~ "released September 8, 2015"
Version 2.1.5 fixes minor bugs.
.TP
Expand Down
Binary file modified man/swarm_manual.pdf
Binary file not shown.
6 changes: 4 additions & 2 deletions src/algo.cc
Original file line number Diff line number Diff line change
Expand Up @@ -516,6 +516,7 @@ void algo_run()
unsigned long mass = 0;
unsigned previd = amps[0].swarmid;
unsigned prevamp = amps[0].ampliconid;
unsigned seed = prevamp;
mass += db_getabundance(prevamp);

for (unsigned long i=1; i<amplicons; i++)
Expand All @@ -525,10 +526,11 @@ void algo_run()
if (id != previd)
{
fprintf(fp_seeds, ">");
fprint_id_with_new_abundance(fp_seeds, prevamp, mass);
fprint_id_with_new_abundance(fp_seeds, seed, mass);
fprintf(fp_seeds, "\n");
db_fprintseq(fp_seeds, prevamp, 0);
mass = 0;
seed = amps[i].ampliconid;
}

previd = id;
Expand All @@ -538,7 +540,7 @@ void algo_run()
}

fprintf(fp_seeds, ">");
fprint_id_with_new_abundance(fp_seeds, prevamp, mass);
fprint_id_with_new_abundance(fp_seeds, seed, mass);
fprintf(fp_seeds, "\n");
db_fprintseq(fp_seeds, prevamp, 0);

Expand Down
12 changes: 10 additions & 2 deletions src/swarm.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,26 +25,34 @@
#include <string.h>
#include <pthread.h>
#include <getopt.h>
#include <x86intrin.h>
#include <stdlib.h>
#include <regex.h>
#include <limits.h>
#include <city.h>
#include <sys/types.h>
#include <sys/resource.h>

#ifdef __APPLE__
#include <sys/sysctl.h>
#else
#include <sys/sysinfo.h>
#endif

#ifdef __SSE2__
#include <emmintrin.h>
#endif

#ifdef __SSSE3__
#include <tmmintrin.h>
#endif

/* constants */

#ifndef LINE_MAX
#define LINE_MAX 2048
#endif

#define SWARM_VERSION "2.1.5"
#define SWARM_VERSION "2.1.6"
#define WIDTH 32
#define WIDTH_SHIFT 5
#define BLOCKWIDTH 32
Expand Down

0 comments on commit 26c5d25

Please sign in to comment.