Skip to content

Commit

Permalink
VSEARCH 1.0.12: Temporary fix for long FASTA headers
Browse files Browse the repository at this point in the history
  • Loading branch information
torognes committed Feb 6, 2015
1 parent e0cc843 commit 3d7ad4d
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 13 deletions.
5 changes: 4 additions & 1 deletion doc/vsearch.1
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
.\" ============================================================================
.TH vsearch 1 "February 5, 2015" "version 1.0.11" "USER COMMANDS"
.TH vsearch 1 "February 6, 2015" "version 1.0.12" "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 @@ -1519,6 +1519,9 @@ affecting clustering and dereplication commands.
.TP
.BR v1.0.11\~ "released February 5th, 2015"
Introduces the possibility to output results in SAM format.
.TP
.BR v1.0.12\~ "released February 6th, 2015"
Temporarily fixes a problem with long headers in FASTA files.
.LP
.\" ============================================================================
.\" TODO:
Expand Down
Binary file modified doc/vsearch_manual.pdf
Binary file not shown.
2 changes: 1 addition & 1 deletion src/align.cc
Original file line number Diff line number Diff line change
Expand Up @@ -409,7 +409,7 @@ void nw_align(char * dseq,
#if 1
if (score != dist)
{
fprintf(stderr, "Warning: Error with query no %lu and db sequence no %lu:\n", queryno, dbseqno);
fprintf(stderr, "WARNING: Error with query no %lu and db sequence no %lu:\n", queryno, dbseqno);
fprintf(stderr, "Initial and recomputed alignment score disagreement: %lu %lu\n", dist, score);
fprintf(stderr, "Alignment: %s\n", cigar);
}
Expand Down
7 changes: 5 additions & 2 deletions src/db.cc
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,10 @@ void db_read(const char * filename, int upcase)
unsigned long hdrbegin = datalen;

if (line[0] != '>')
fatal("Illegal header line in fasta file.");
fatal("Illegal header line in fasta file (not starting with '>' character).");

if (strlen(line) + 1 == LINEALLOC)
fatal("FASTA header line in database too long");

/* terminate header at first space or end of line */

Expand Down Expand Up @@ -407,7 +410,7 @@ void db_read(const char * filename, int upcase)

if (stripped_count)
{
fprintf(stderr, "Warning: invalid characters stripped from sequence:");
fprintf(stderr, "WARNING: invalid characters stripped from sequence:");
for (int i=0; i<256;i++)
if (stripped[i])
fprintf(stderr, " %c(%d)", i, stripped[i]);
Expand Down
15 changes: 7 additions & 8 deletions src/query.cc
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
Copyright (C) 2014 Torbjorn Rognes & Tomas Flouri
Copyright (C) 2014-2015 Torbjorn Rognes & Tomas Flouri
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 All @@ -25,12 +25,8 @@
allocated here for the query header and sequence. This buffers will
be overwritten on the next call of query_getnext. */

#ifndef LINE_MAX
#define LINE_MAX 2048
#endif

#define MEMCHUNK 4096
#define LINEALLOC LINE_MAX
#define LINEALLOC 1048576

extern unsigned int chrstatus[256];

Expand Down Expand Up @@ -184,7 +180,7 @@ void query_close()

if (query_stripped_count)
{
fprintf(stderr, "Warning: invalid characters stripped from query:");
fprintf(stderr, "WARNING: invalid characters stripped from query:");
for (int i=0; i<256;i++)
if (query_stripped[i])
fprintf(stderr, " %c(%d)", i, query_stripped[i]);
Expand Down Expand Up @@ -222,8 +218,11 @@ int query_getnext(char ** head, int * head_len,
/* read header */

if (query_line[0] != '>')
fatal("Illegal header line in query fasta file");
fatal("Illegal header line in query fasta file (not starting with '>' character).");

if (strlen(query_line) + 1 == LINEALLOC)
fatal("FASTA header line in query too long");

/* terminate header at first space or end of line */

char * z0 = query_line + 1;
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.11"
#define PROG_VERSION "v1.0.12"

#ifdef __APPLE__
#define PROG_ARCH "osx_x86_64"
Expand Down

0 comments on commit 3d7ad4d

Please sign in to comment.