Skip to content

Commit

Permalink
SWIPE 2.1.1: Fix for very long header strings in databases
Browse files Browse the repository at this point in the history
  • Loading branch information
torognes committed Jun 29, 2021
1 parent 5f894bf commit 314123b
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 6 deletions.
4 changes: 4 additions & 0 deletions CHANGES
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
2021-06-28 Torbjorn Rognes <[email protected]>
* Version 2.1.1
* Fix for very long header strings in NCBI database files

2018-05-04 Torbjorn Rognes <[email protected]>
* Version 2.1.0
* Fix for changes to NCBI database format
Expand Down
5 changes: 3 additions & 2 deletions README
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
SWIPE
Smith-Waterman database searches with Inter-sequence Parallel Execution

Copyright (C) 2008-2014 Torbjorn Rognes, University of Oslo,
Copyright (C) 2008-2021 Torbjorn Rognes, University of Oslo,
Oslo University Hospital and Sencel Bioinformatics AS

This program is free software: you can redistribute it and/or modify
Expand Down Expand Up @@ -105,7 +105,8 @@ specified organisms.
SWIPE accepts only databases prepared using the formatdb or makeblastdb
tools that are distributed together with NCBI BLAST and BLAST+. They
can be downloaded at ftp://ftp.ncbi.nlm.nih.gov/blast/executables/
from NCBI.
from NCBI. For makeblastdb, please use the "-blastdb_version 4" option
to make databases that are compatible with SWIPE.

The SWIPE distribution includes executable binaries for 64-bit Linux and
Mac. SWIPE may be compiled from sources using either the GNU g++ compiler,
Expand Down
24 changes: 22 additions & 2 deletions asnparse.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
SWIPE
Smith-Waterman database searches with Inter-sequence Parallel Execution
Copyright (C) 2008-2013 Torbjorn Rognes, University of Oslo,
Copyright (C) 2008-2021 Torbjorn Rognes, University of Oslo,
Oslo University Hospital and Sencel Bioinformatics AS
This program is free software: you can redistribute it and/or modify
Expand Down Expand Up @@ -194,7 +194,27 @@ void parse_visiblestring(apt p)
length = (length << 8) | p->ch;
nextch(p);
}
else if (p->len > 0x82)
else if (p->len == 0x83)
{
length = p->ch;
nextch(p);
length = (length << 8) | p->ch;
nextch(p);
length = (length << 8) | p->ch;
nextch(p);
}
else if (p->len == 0x84)
{
length = p->ch;
nextch(p);
length = (length << 8) | p->ch;
nextch(p);
length = (length << 8) | p->ch;
nextch(p);
length = (length << 8) | p->ch;
nextch(p);
}
else if (p->len > 0x84)
{
fprintf(stderr, "Error: illegal string length (%02x).\n", p->len);
fatal("Error parsing binary ASN.1 in database sequence definition.");
Expand Down
4 changes: 2 additions & 2 deletions swipe.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
SWIPE
Smith-Waterman database searches with Inter-sequence Parallel Execution
Copyright (C) 2008-2014 Torbjorn Rognes, University of Oslo,
Copyright (C) 2008-2021 Torbjorn Rognes, University of Oslo,
Oslo University Hospital and Sencel Bioinformatics AS
This program is free software: you can redistribute it and/or modify
Expand Down Expand Up @@ -55,7 +55,7 @@
#define LINE_MAX 2048
#endif

#define SWIPE_VERSION "2.1.0"
#define SWIPE_VERSION "2.1.1"

// Should be 32bits integer
typedef unsigned int UINT32;
Expand Down

0 comments on commit 314123b

Please sign in to comment.