Skip to content

Commit

Permalink
VSEARCH 1.0.13: Fix for memory bug with multiple alignments and clust…
Browse files Browse the repository at this point in the history
…ering
  • Loading branch information
torognes committed Feb 17, 2015
1 parent 0bb8fb1 commit 9c0f3a1
Show file tree
Hide file tree
Showing 8 changed files with 16 additions and 17 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,22 +32,22 @@ If you can't find an answer in the VSEARCH documentation, please visit the [VSEA

In the example below, VSEARCH will identify sequences in the file database.fsa that are at least 90% identical on the plus strand to the query sequences in the file queries.fsa and write the results to the file alnout.txt.

`./vsearch-1.0.11-linux-x86_64 --usearch_global queries.fsa --db database.fsa --id 0.9 --alnout alnout.txt`
`./vsearch-1.0.13-linux-x86_64 --usearch_global queries.fsa --db database.fsa --id 0.9 --alnout alnout.txt`

## Download and install

The latest releases of VSEARCH are available [here](https://github.com/torognes/vsearch/releases).

Binary executables of VSEARCH are available in the `bin` folder for [GNU/Linux on x86-64 systems](https://github.com/torognes/vsearch/blob/master/bin/vsearch-1.0.11-linux-x86_64) and [Apple Mac OS X on x86-64 systems](https://github.com/torognes/vsearch/blob/master/bin/vsearch-1.0.11-osx-x86_64). These executables include support for input files compressed by zlib and bzip2 (with files usually ending in .gz or .bz2).
Binary executables of VSEARCH are available in the `bin` folder for [GNU/Linux on x86-64 systems](https://github.com/torognes/vsearch/blob/master/bin/vsearch-1.0.13-linux-x86_64) and [Apple Mac OS X on x86-64 systems](https://github.com/torognes/vsearch/blob/master/bin/vsearch-1.0.13-osx-x86_64). These executables include support for input files compressed by zlib and bzip2 (with files usually ending in .gz or .bz2).

Download the appropriate executable and make a symbolic link in a folder included in your `$PATH` from `vsearch` to the appropriate binary. You may use the following commands (assuming `~/bin` is in your `$PATH`):

```sh
cd ~
mkdir -p bin
cd bin
wget https://github.com/torognes/vsearch/releases/download/v1.0.11/vsearch-1.0.11-linux-x86_64
ln -s vsearch-1.0.11-linux-x86_64 vsearch
wget https://github.com/torognes/vsearch/releases/download/v1.0.13/vsearch-1.0.13-linux-x86_64
ln -s vsearch-1.0.13-linux-x86_64 vsearch
```

Substitute `linux` with `osx` in those lines if you're on a Mac.
Expand Down
7 changes: 6 additions & 1 deletion doc/vsearch.1
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
.\" ============================================================================
.TH vsearch 1 "February 6, 2015" "version 1.0.12" "USER COMMANDS"
.TH vsearch 1 "February 17, 2015" "version 1.0.13" "USER COMMANDS"
.\" ============================================================================
.SH NAME
vsearch \(em chimera detection, clustering, dereplication, masking, pairwise alignment, searching, shuffling and sorting of amplicons from metagenomic projects.
Expand Down Expand Up @@ -1523,6 +1523,11 @@ clustering, pairwise alignment and searching).
.TP
.BR v1.0.12\~ "released February 6th, 2015"
Temporarily fixes a problem with long headers in FASTA files.
.TP
.BR v1.0.13\~ "released February 6th, 2015"
Fix a memory allocation problem when computing multiple sequence alignments
with the --msaout and --consout options, as well as a memory leak.
Also increased line buffer for reading FASTA files to 4MB.
.LP
.\" ============================================================================
.\" TODO:
Expand Down
Binary file modified doc/vsearch_manual.pdf
Binary file not shown.
6 changes: 2 additions & 4 deletions src/cluster.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1110,8 +1110,6 @@ void cluster(char * dbname,
int msa_target_count = 0;
struct msa_target_s * msa_target_list =
(struct msa_target_s *) xmalloc(sizeof(struct msa_target_s) * size_max);
//memset(msa_target_list, 0, sizeof(struct msa_target_s)*size_max);

progress_init("Multiple alignments", seqcount);

FILE * fp_msaout = 0;
Expand Down Expand Up @@ -1168,11 +1166,11 @@ void cluster(char * dbname,
}

/* free cigar strings for all aligned sequences */
/*

for(int i=0; i<seqcount; i++)
if (clusterinfo[i].cigar)
free(clusterinfo[i].cigar);
*/

free(clusterinfo);

if (opt_matched)
Expand Down
2 changes: 1 addition & 1 deletion src/db.cc
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ seqinfo_t * seqindex = 0;
static char * datap = 0;

#define MEMCHUNK 10485760
#define LINEALLOC 1048576
#define LINEALLOC 4194304

regex_t db_regexp;

Expand Down
6 changes: 1 addition & 5 deletions src/msa.cc
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
Copyright (C) 2014 Torbjorn Rognes
Copyright (C) 2014-2015 Torbjorn Rognes
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as
Expand Down Expand Up @@ -233,10 +233,6 @@ void msa(FILE * fp_msaout, FILE * fp_consout,
db_getheader(target_seqno));
fprint_fasta_seq_only(fp_msaout, aln, alnlen, opt_fasta_width);
}

/* free cigar */
if (target_list[j].cigar)
free(target_list[j].cigar);
}


Expand Down
2 changes: 1 addition & 1 deletion src/query.cc
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
be overwritten on the next call of query_getnext. */

#define MEMCHUNK 4096
#define LINEALLOC 1048576
#define LINEALLOC 4194304

extern unsigned int chrstatus[256];

Expand Down
2 changes: 1 addition & 1 deletion src/vsearch.h
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@
#include "allpairs.h"

#define PROG_NAME "vsearch"
#define PROG_VERSION "v1.0.12"
#define PROG_VERSION "v1.0.13"

#ifdef __APPLE__
#define PROG_ARCH "osx_x86_64"
Expand Down

0 comments on commit 9c0f3a1

Please sign in to comment.