-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Swarm 1.2.7: Fix seed output, ignore some CR in FASTA files, etc
- Loading branch information
Showing
21 changed files
with
140 additions
and
114 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
.\" ============================================================================ | ||
.TH swarm 1 "February 24, 2016" "version 2.1.6" "USER COMMANDS" | ||
.TH swarm 1 "February 24, 2016" "version 2.1.7" "USER COMMANDS" | ||
.\" ============================================================================ | ||
.SH NAME | ||
swarm \(em find clusters of nearly-identical nucleotide amplicons | ||
|
@@ -279,11 +279,11 @@ 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> | ||
\fIPeerJ\fR 2:e593 <https://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\fR 3:e1420 <http://dx.doi.org/10.7717/peerj.1420> | ||
\fIPeerJ\fR 3:e1420 <https://doi.org/10.7717/peerj.1420> | ||
.\" ============================================================================ | ||
.SH REPORTING BUGS | ||
Submit suggestions and bug-reports at | ||
|
@@ -296,7 +296,7 @@ Torbjørn Rognes <[email protected]>. | |
The software is available from <https://github.com/torognes/swarm> | ||
.\" ============================================================================ | ||
.SH COPYRIGHT | ||
Copyright (C) 2012, 2013, 2014, 2015, 2016 Frédéric Mahé & Torbjørn Rognes | ||
Copyright (C) 2012-2016 Frédéric Mahé & Torbjørn Rognes | ||
.PP | ||
This program is free software: you can redistribute it and/or modify | ||
it under the terms of the GNU Affero General Public License as | ||
|
@@ -329,10 +329,17 @@ New features and important modifications of \fBswarm\fR (short lived | |
or minor bug releases are not mentioned): | ||
.RS | ||
.TP | ||
.BR v2.1.7\~ "released February 24, 2016" | ||
Version 2.1.7 fixes a bug in the output of seeds with the \-w option | ||
when \fId\fR > 1 that was not properly fixed in version 2.1.6. It also | ||
handles ascii character no 13 (CR) in FASTA files better. Swarm will | ||
now exit with status 0 if the \-h or the \-v option is specified. The | ||
help text and some error messages have been improved. | ||
.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 \fId\fR > 1. | ||
with the \-w option when \fId\fR > 1. | ||
.TP | ||
.BR v2.1.5\~ "released September 8, 2015" | ||
Version 2.1.5 fixes minor bugs. | ||
|
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,24 @@ | ||
/* | ||
SWARM | ||
SWARM | ||
Copyright (C) 2012-2015 Torbjorn Rognes and Frederic Mahe | ||
Copyright (C) 2012-2016 Torbjorn Rognes and Frederic Mahe | ||
This program is free software: you can redistribute it and/or modify | ||
it under the terms of the GNU Affero General Public License as | ||
published by the Free Software Foundation, either version 3 of the | ||
License, or (at your option) any later version. | ||
This program is free software: you can redistribute it and/or modify | ||
it under the terms of the GNU Affero General Public License as | ||
published by the Free Software Foundation, either version 3 of the | ||
License, or (at your option) any later version. | ||
This program is distributed in the hope that it will be useful, | ||
but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
GNU Affero General Public License for more details. | ||
This program is distributed in the hope that it will be useful, | ||
but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
GNU Affero General Public License for more details. | ||
You should have received a copy of the GNU Affero General Public License | ||
along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
You should have received a copy of the GNU Affero General Public License | ||
along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
Contact: Torbjorn Rognes <[email protected]>, | ||
Department of Informatics, University of Oslo, | ||
PO Box 1080 Blindern, NO-0316 Oslo, Norway | ||
Contact: Torbjorn Rognes <[email protected]>, | ||
Department of Informatics, University of Oslo, | ||
PO Box 1080 Blindern, NO-0316 Oslo, Norway | ||
*/ | ||
|
||
#include "swarm.h" | ||
|
@@ -515,9 +515,8 @@ void algo_run() | |
|
||
unsigned long mass = 0; | ||
unsigned previd = amps[0].swarmid; | ||
unsigned prevamp = amps[0].ampliconid; | ||
unsigned seed = prevamp; | ||
mass += db_getabundance(prevamp); | ||
unsigned seed = amps[0].ampliconid; | ||
mass += db_getabundance(seed); | ||
|
||
for (unsigned long i=1; i<amplicons; i++) | ||
{ | ||
|
@@ -528,21 +527,21 @@ void algo_run() | |
fprintf(fp_seeds, ">"); | ||
fprint_id_with_new_abundance(fp_seeds, seed, mass); | ||
fprintf(fp_seeds, "\n"); | ||
db_fprintseq(fp_seeds, prevamp, 0); | ||
db_fprintseq(fp_seeds, seed, 0); | ||
|
||
mass = 0; | ||
seed = amps[i].ampliconid; | ||
} | ||
|
||
mass += db_getabundance(amps[i].ampliconid); | ||
previd = id; | ||
prevamp = amps[i].ampliconid; | ||
mass += db_getabundance(prevamp); | ||
progress_update(i); | ||
} | ||
|
||
fprintf(fp_seeds, ">"); | ||
fprint_id_with_new_abundance(fp_seeds, seed, mass); | ||
fprintf(fp_seeds, "\n"); | ||
db_fprintseq(fp_seeds, prevamp, 0); | ||
db_fprintseq(fp_seeds, seed, 0); | ||
|
||
progress_done(); | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,30 +1,30 @@ | ||
/* | ||
SWARM | ||
SWARM | ||
Copyright (C) 2012-2015 Torbjorn Rognes and Frederic Mahe | ||
Copyright (C) 2012-2016 Torbjorn Rognes and Frederic Mahe | ||
This program is free software: you can redistribute it and/or modify | ||
it under the terms of the GNU Affero General Public License as | ||
published by the Free Software Foundation, either version 3 of the | ||
License, or (at your option) any later version. | ||
This program is free software: you can redistribute it and/or modify | ||
it under the terms of the GNU Affero General Public License as | ||
published by the Free Software Foundation, either version 3 of the | ||
License, or (at your option) any later version. | ||
This program is distributed in the hope that it will be useful, | ||
but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
GNU Affero General Public License for more details. | ||
This program is distributed in the hope that it will be useful, | ||
but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
GNU Affero General Public License for more details. | ||
You should have received a copy of the GNU Affero General Public License | ||
along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
You should have received a copy of the GNU Affero General Public License | ||
along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
Contact: Torbjorn Rognes <[email protected]>, | ||
Department of Informatics, University of Oslo, | ||
PO Box 1080 Blindern, NO-0316 Oslo, Norway | ||
Contact: Torbjorn Rognes <[email protected]>, | ||
Department of Informatics, University of Oslo, | ||
PO Box 1080 Blindern, NO-0316 Oslo, Norway | ||
*/ | ||
|
||
/* | ||
This version of the swarm algorithm uses Frederic's idea for d=1 to | ||
enumerate all of the maximum 7L+4 possible variants of a sequence with only | ||
one difference, where L is the length of the sequence. | ||
enumerate all of the maximum 7L+4 possible variants of a sequence | ||
with only one difference, where L is the length of the sequence. | ||
*/ | ||
|
||
#include "swarm.h" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,24 @@ | ||
/* | ||
SWARM | ||
SWARM | ||
Copyright (C) 2012-2015 Torbjorn Rognes and Frederic Mahe | ||
Copyright (C) 2012-2016 Torbjorn Rognes and Frederic Mahe | ||
This program is free software: you can redistribute it and/or modify | ||
it under the terms of the GNU Affero General Public License as | ||
published by the Free Software Foundation, either version 3 of the | ||
License, or (at your option) any later version. | ||
This program is free software: you can redistribute it and/or modify | ||
it under the terms of the GNU Affero General Public License as | ||
published by the Free Software Foundation, either version 3 of the | ||
License, or (at your option) any later version. | ||
This program is distributed in the hope that it will be useful, | ||
but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
GNU Affero General Public License for more details. | ||
This program is distributed in the hope that it will be useful, | ||
but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
GNU Affero General Public License for more details. | ||
You should have received a copy of the GNU Affero General Public License | ||
along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
You should have received a copy of the GNU Affero General Public License | ||
along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
Contact: Torbjorn Rognes <[email protected]>, | ||
Department of Informatics, University of Oslo, | ||
PO Box 1080 Blindern, NO-0316 Oslo, Norway | ||
Contact: Torbjorn Rognes <[email protected]>, | ||
Department of Informatics, University of Oslo, | ||
PO Box 1080 Blindern, NO-0316 Oslo, Norway | ||
*/ | ||
|
||
#include "swarm.h" | ||
|
@@ -215,7 +215,7 @@ void db_read(const char * filename) | |
fatal("Illegal header line in fasta file."); | ||
|
||
long headerlen = 0; | ||
if (char * stop = strpbrk(line+1, " \n")) | ||
if (char * stop = strpbrk(line+1, " \r\n")) | ||
headerlen = stop - (line+1); | ||
else | ||
headerlen = strlen(line+1); | ||
|
@@ -278,10 +278,13 @@ void db_read(const char * filename) | |
*(datap+datalen) = m; | ||
datalen++; | ||
} | ||
else if (c != '\n') | ||
else if ((c != 10) && (c != 13)) | ||
{ | ||
char msg[100]; | ||
snprintf(msg, 100, "Illegal character '%c' in sequence on line %u", c, lineno); | ||
if ((c >= 32) && (c <= 126)) | ||
snprintf(msg, 100, "Illegal character '%c' in sequence on line %u", c, lineno); | ||
else | ||
snprintf(msg, 100, "Illegal character (ascii no %d) in sequence on line %u", c, lineno); | ||
fatal(msg); | ||
} | ||
line[0] = 0; | ||
|
@@ -434,12 +437,10 @@ void db_read(const char * filename) | |
{ | ||
char * msg; | ||
if (asprintf(&msg, | ||
"Abundance annotations not found for %d sequences, " | ||
"starting on line %u.\n" | ||
"Fasta headers must end with abundance annotations " | ||
"(_INT or ;size=INT)\n" | ||
"Abundance annotations can be produced by " | ||
"dereplicating the sequences\n", | ||
"Abundance annotations not found for %d sequences, starting on line %u.\n" | ||
"Fasta headers must end with abundance annotations (_INT or ;size=INT).\n" | ||
"The -z option must be used if the abundance annotation is in the latter format.\n" | ||
"Abundance annotations can be produced by dereplicating the sequences.\n", | ||
missingabundance, | ||
missingabundance_lineno) == -1) | ||
fatal("Out of memory"); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
adb033a
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is version 2.1.7, not 1.2.7 as indicated in the commit title.