Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
jwcodee committed Aug 12, 2019
2 parents bc4d932 + d6e07fc commit 6d9502b
Show file tree
Hide file tree
Showing 25 changed files with 844 additions and 79 deletions.
9 changes: 5 additions & 4 deletions Bloom/HashAgnosticCascadingBloom.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
class HashAgnosticCascadingBloom
{
public:
typedef uint64_t hash_t;
/** Default constructor */
HashAgnosticCascadingBloom()
: m_k(0)
Expand Down Expand Up @@ -91,7 +92,7 @@ class HashAgnosticCascadingBloom
* Return true if the element with the given hash values
* has count >= levels.
*/
bool contains(const std::vector<size_t>& hashes) const
bool contains(const std::vector<hash_t>& hashes) const
{
assert(m_data.back() != NULL);
return m_data.back()->contains(hashes);
Expand All @@ -101,14 +102,14 @@ class HashAgnosticCascadingBloom
* Return true if the element with the given hash values
* has count >= levels.
*/
bool contains(const size_t hashes[]) const
bool contains(const hash_t hashes[]) const
{
assert(m_data.back() != NULL);
return m_data.back()->contains(hashes);
}

/** Add the object with the specified index to this multiset. */
void insert(const std::vector<size_t>& hashes)
void insert(const std::vector<hash_t>& hashes)
{
for (unsigned i = 0; i < m_data.size(); ++i) {
assert(m_data.at(i) != NULL);
Expand All @@ -120,7 +121,7 @@ class HashAgnosticCascadingBloom
}

/** Add the object with the specified index to this multiset. */
void insert(const size_t hashes[])
void insert(const hash_t hashes[])
{
for (unsigned i = 0; i < m_data.size(); ++i) {
assert(m_data.at(i) != NULL);
Expand Down
3 changes: 2 additions & 1 deletion Bloom/RollingBloomDBGVisitor.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ class RollingBloomDBGVisitor : public DefaultBFSVisitor<GraphT>

typedef std::vector<std::pair<std::string, BloomFilter*>> BloomProperties;
typedef typename BloomProperties::const_iterator BloomPropertiesIt;
typedef uint64_t hash_t;

/** Constructor */
template<typename VertexSetT>
Expand Down Expand Up @@ -110,7 +111,7 @@ class RollingBloomDBGVisitor : public DefaultBFSVisitor<GraphT>
m_out << "," << it->first;
}

size_t hashes[MAX_HASHES];
hash_t hashes[MAX_HASHES];
v.rollingHash().getHashes(hashes);

for (BloomPropertiesIt it = m_bloomProperties.begin(); it != m_bloomProperties.end();
Expand Down
10 changes: 6 additions & 4 deletions BloomDBG/RollingBloomDBG.h
Original file line number Diff line number Diff line change
Expand Up @@ -205,9 +205,10 @@ struct graph_traits< RollingBloomDBG<BF> > {

/**
* Identifier for accessing a vertex in the graph.
* The second member of the pair (std::vector<size_t>) is
* The second member of the pair (std::vector<hash_t>) is
* a set of hash values associated with the k-mer.
*/
typedef uint64_t hash_t;
typedef RollingBloomDBGVertex vertex_descriptor;
typedef boost::directed_tag directed_category;
struct traversal_category
Expand All @@ -223,11 +224,11 @@ struct graph_traits< RollingBloomDBG<BF> > {
typedef unsigned degree_size_type;

// VertexListGraph
typedef size_t vertices_size_type;
typedef uint64_t vertices_size_type;
typedef void vertex_iterator;

// EdgeListGraph
typedef size_t edges_size_type;
typedef uint64_t edges_size_type;
typedef void edge_iterator;

// AdjacencyGraph
Expand Down Expand Up @@ -438,7 +439,8 @@ vertex_exists(
const typename graph_traits<RollingBloomDBG<BloomT> >::vertex_descriptor& u,
const RollingBloomDBG<BloomT>& g)
{
size_t hashes[MAX_HASHES];
typedef uint64_t hash_t;
hash_t hashes[MAX_HASHES];
u.rollingHash().getHashes(hashes);
return g.m_bloom.contains(hashes);
}
Expand Down
12 changes: 7 additions & 5 deletions BloomDBG/RollingHash.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,13 @@ class RollingHash
{
private:

typedef uint64_t hash_t;

/**
* Determine the canonical hash value, given hash values for
* forward and reverse-complement of the same k-mer.
*/
uint64_t canonicalHash(uint64_t hash, uint64_t rcHash) const
hash_t canonicalHash(hash_t hash, hash_t rcHash) const
{
return (rcHash < hash) ? rcHash : hash;
}
Expand Down Expand Up @@ -136,7 +138,7 @@ class RollingHash
*
* @param hashes array for returned hash values
*/
void getHashes(size_t hashes[]) const
void getHashes(hash_t hashes[]) const
{
for (unsigned i = 0; i < m_numHashes; ++i)
hashes[i] = NTE64(m_hash, m_k, i);
Expand Down Expand Up @@ -208,12 +210,12 @@ class RollingHash
/** k-mer length */
unsigned m_k;
/** value of first hash function for current k-mer */
uint64_t m_hash1;
hash_t m_hash1;
/** value of first hash function for current k-mer, after
* reverse-complementing */
uint64_t m_rcHash1;
hash_t m_rcHash1;
/** current canonical hash value */
uint64_t m_hash;
hash_t m_hash;
};

#endif
5 changes: 3 additions & 2 deletions BloomDBG/RollingHashIterator.h
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ class RollingHashIterator

public:

typedef uint64_t hash_t;
/**
* Default constructor. Creates an iterator pointing to
* the end of the iterator range.
Expand Down Expand Up @@ -142,7 +143,7 @@ class RollingHashIterator
}

/** get reference to hash values for current k-mer */
const size_t* operator*() const
const hash_t* operator*() const
{
assert(m_pos + m_k <= m_seq.length());
return m_hashes;
Expand Down Expand Up @@ -216,7 +217,7 @@ class RollingHashIterator
/** number of hash functions */
unsigned m_numHashes;
/** hash values */
size_t m_hashes[MAX_HASHES];
hash_t m_hashes[MAX_HASHES];
/** k-mer size */
unsigned m_k;
/** internal state for rolling hash */
Expand Down
5 changes: 5 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
2019-08-12 Johnathan Wong <[email protected]>

* Release version 2.2.1
* Fix abyss-bloom for macOS

2019-08-01 Johnathan Wong <[email protected]>

* Release version 2.2.0
Expand Down
2 changes: 1 addition & 1 deletion Misc/samtobreak.hs
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,7 @@ parseArgs = do
where
help = putStr (usageInfo usage options) >> exitSuccess
tryHelp = "Try 'abyss-samtobreak --help' for more information."
version = "abyss-samtobreak (ABySS) 2.2.0\n"
version = "abyss-samtobreak (ABySS) 2.2.1\n"
usage = "Usage: samtobreak [OPTION]... [FILE]...\n\
\Calculate contig and scaffold contiguity and correctness metrics.\n"

Expand Down
2 changes: 1 addition & 1 deletion Unittest/BloomDBG/HashAgnosticCascadingBloomTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ TEST(HashAgnosticCascadingBloom, base)
RollingHashIterator itB(b, numHashes, k);
RollingHashIterator itC(c, numHashes, k);
RollingHashIterator itD(d, numHashes, k);
size_t hash;
hash_t hash;

x.insert(*itA);
EXPECT_EQ(x.popcount(), 0U);
Expand Down
7 changes: 4 additions & 3 deletions Unittest/BloomDBG/RollingBloomDBGTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ using namespace boost;
typedef RollingBloomDBG<BloomFilter> Graph;
typedef graph_traits<Graph> GraphTraits;
typedef graph_traits<Graph>::vertex_descriptor V;
typedef uint64_t hash_t;

/** Test fixture for RollingBloomDBG tests. */
class RollingBloomDBGTest : public ::testing::Test
Expand Down Expand Up @@ -42,7 +43,7 @@ class RollingBloomDBGTest : public ::testing::Test
* complements of these k-mers.
*/

size_t hashes[MAX_HASHES];
hash_t hashes[MAX_HASHES];
RollingHash("CGACT", m_numHashes, m_k).getHashes(hashes);
m_bloom.insert(hashes);
RollingHash("TGACT", m_numHashes, m_k).getHashes(hashes);
Expand Down Expand Up @@ -156,7 +157,7 @@ TEST_F(RollingBloomDBGTest, pathTraversal)
const V GACTC("GACTC", RollingHash("GACTC", m_numHashes, m_k));
const V ACTCG("ACTCG", RollingHash("ACTCG", m_numHashes, m_k));

size_t hashes[MAX_HASHES];
hash_t hashes[MAX_HASHES];
CGACT.rollingHash().getHashes(hashes);
bloom.insert(hashes);
GACTC.rollingHash().getHashes(hashes);
Expand Down Expand Up @@ -268,7 +269,7 @@ class RollingBloomDBGSpacedSeedTest : public ::testing::Test
* any additional edges in the graph.
*/

size_t hashes[MAX_HASHES];
hash_t hashes[MAX_HASHES];
RollingHash("CGACT", m_numHashes, m_k).getHashes(hashes);
m_bloom.insert(hashes);
RollingHash("TGACT", m_numHashes, m_k).getHashes(hashes);
Expand Down
37 changes: 37 additions & 0 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,25 @@
jobs:
- job: linux_gcc8_32bit
pool:
vmImage: Ubuntu 16.04
steps:
- script: |
sudo apt-get update -qq
sudo apt-get install -qq software-properties-common
sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test
sudo apt-get update -qq
sudo apt-get install -qq autoconf automake gcc g++ libboost-dev libgtest-dev libopenmpi-dev libsparsehash-dev make pandoc
displayName: Install common
- script: sudo apt-get install -qq gcc-8 g++-8
displayName: Install gcc-8
- script: sudo apt-get install gcc-8-multilib g++-8-multilib
displayName: Install 32-bit compilation support
- script: |
./autogen.sh
./configure CC=gcc-8 CXX=g++-8 --build=i686-linux-gnu "CFLAGS=-m32" "CXXFLAGS=-m32" "LDFLAGS=-m32" --with-mpi=/usr/lib/openmpi
make -j12 distcheck
displayName: Compiling ABySS with gcc-8
- job: linux_clang6
pool:
vmImage: Ubuntu 16.04
Expand Down Expand Up @@ -118,3 +139,19 @@ jobs:
displayName: Install clang-format
- script: make clang-format
displayName: Run clang-format

- job: macOS_gcc8
pool:
vmImage: macOS-10.14
steps:
- script: |
brew update
brew install automake [email protected] openmpi google-sparsehash make pandoc ghc
displayName: Install common
- script: brew install gcc@8
displayName: Install gcc
- script: |
./autogen.sh
./configure CC=gcc-8 CXX=g++-8 --with-boost=/usr/local/Cellar/boost/1.70.0/include/ --with-mpi=/usr/local/Cellar/open-mpi/4.0.1_2/ CPPFLAGS=-I/usr/local/Cellar/google-sparsehash/2.0.3/include/
make -j12 distcheck
displayName: Compiling ABySS with gcc 8
2 changes: 1 addition & 1 deletion bin/abyss-pe
Original file line number Diff line number Diff line change
Expand Up @@ -398,7 +398,7 @@ help:
@echo 'Report bugs to https://github.com/bcgsc/abyss/issues or [email protected].'

version:
@echo "abyss-pe (ABySS) 2.2.0"
@echo "abyss-pe (ABySS) 2.2.1"
@echo "Written by Shaun Jackman and Anthony Raymond."
@echo
@echo "Copyright 2012 Canada's Michael Smith Genome Science Centre"
Expand Down
2 changes: 1 addition & 1 deletion configure.ac
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
AC_PREREQ(2.62)
AC_INIT(ABySS, 2.2.0, [email protected], abyss,
AC_INIT(ABySS, 2.2.1, [email protected], abyss,
http://www.bcgsc.ca/platform/bioinfo/software/abyss)

AC_CONFIG_MACRO_DIR([m4])
Expand Down
2 changes: 1 addition & 1 deletion doc/ABYSS.1
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.TH ABYSS "1" "2015-May" "ABYSS (ABySS) 2.2.0" "User Commands"
.TH ABYSS "1" "2015-May" "ABYSS (ABySS) 2.2.1" "User Commands"
.SH NAME
ABYSS \- assemble short reads into contigs
.SH SYNOPSIS
Expand Down
2 changes: 1 addition & 1 deletion doc/abyss-pe.1
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.TH abyss-pe "1" "2015-May" "abyss-pe (ABySS) 2.2.0" "User Commands"
.TH abyss-pe "1" "2015-May" "abyss-pe (ABySS) 2.2.1" "User Commands"
.SH NAME
abyss-pe - assemble reads into contigs
.SH SYNOPSIS
Expand Down
2 changes: 1 addition & 1 deletion doc/abyss-tofastq.1
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.TH abyss-tofastq "1" "2015-May" "ABySS 2.2.0" "User Commands"
.TH abyss-tofastq "1" "2015-May" "ABySS 2.2.1" "User Commands"
.SH NAME
abyss-tofastq \- convert various file formats to FASTQ format
.br
Expand Down
9 changes: 9 additions & 0 deletions vendor/btl_bloomfilter/.clang-format
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
BasedOnStyle: Mozilla
AlignAfterOpenBracket: AlwaysBreak
AlignOperands: true
ColumnLimit: 100
ContinuationIndentWidth: 4
IndentCaseLabels: false
IndentWidth: 4
TabWidth: 4
UseTab: ForIndentation
29 changes: 29 additions & 0 deletions vendor/btl_bloomfilter/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
INSTALL
Makefile
Makefile.in
Tests/AdHoc/BloomFilterTests
Tests/AdHoc/ParallelFilter
Tests/Unit/BloomFilterTests
aclocal.m4
autom4te.cache
autoscan-*.log
autoscan.log
compile
config.guess
config.h
config.h.in
config.status
config.sub
configure
configure.scan
depcomp
install-sh
missing
stamp-h1
test-driver

*.Po
*.Tpo
*.log
*.o
*.trs
Loading

0 comments on commit 6d9502b

Please sign in to comment.