Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
* 'master' of https://github.com/fbreitwieser/kraken-hll:
  Fix gzstream building and licensing
  Fix gzstream compilation, update on HLL

Conflicts:
	src/hyperloglogplus.h
  • Loading branch information
fbreitwieser committed Nov 9, 2017
2 parents c6871c1 + 93c155f commit e4904a7
Show file tree
Hide file tree
Showing 21 changed files with 113 additions and 533 deletions.
90 changes: 0 additions & 90 deletions CHANGELOG

This file was deleted.

File renamed without changes.
3 changes: 2 additions & 1 deletion scripts/krakenhll
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#!/usr/bin/env perl

# Copyright 2013-2015, Derrick Wood <[email protected]>
# Original file Copyright 2013-2015, Derrick Wood <[email protected]>
# Portions (c) 2017, Florian Breitwieser <[email protected]> as part of KrakenHLL
#
# This file is part of the Kraken taxonomic sequence classification system.
#
Expand Down
3 changes: 2 additions & 1 deletion scripts/krakenhll-build
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#!/usr/bin/env perl

# Copyright 2013-2015, Derrick Wood <[email protected]>
# Original file Copyright 2013-2015, Derrick Wood <[email protected]>
# Portions (c) 2017, Florian Breitwieser <[email protected]> as part of KrakenHLL
#
# This file is part of the Kraken taxonomic sequence classification system.
#
Expand Down
3 changes: 2 additions & 1 deletion scripts/krakenhll-build_db.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
#!/bin/bash
#vim: noai:ts=2:sw=2

# Copyright 2013-2015, Derrick Wood <[email protected]>
# Original file Copyright 2013-2015, Derrick Wood <[email protected]>
# Portions (c) 2017, Florian Breitwieser <[email protected]> as part of KrakenHLL
#
# This file is part of the Kraken taxonomic sequence classification system.
#
Expand Down
4 changes: 2 additions & 2 deletions scripts/krakenhll-check_for_jellyfish.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/bash

# Copyright 2013-2015, Derrick Wood <[email protected]>
# modified by Florian Breitwieser, 2017
# Original file Copyright 2013-2015, Derrick Wood <[email protected]>
# Portions (c) 2017, Florian Breitwieser <[email protected]> as part of KrakenHLL
#
# This file is part of the Kraken taxonomic sequence classification system.
#
Expand Down
1 change: 1 addition & 0 deletions scripts/krakenhll-download
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

# krakenhll-download.pl - based on centrifuge-download
# (c) Florian Breitwieser, 2017
# licensed under GPL-3

use strict;
use warnings;
Expand Down
3 changes: 2 additions & 1 deletion scripts/krakenhll-report
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#!/usr/bin/env perl

# Copyright 2013-2015, Derrick Wood <[email protected]>
# Original file Copyright 2013-2015, Derrick Wood <[email protected]>
# Portions (c) 2017, Florian Breitwieser <[email protected]> as part of KrakenHLL
#
# This file is part of the Kraken taxonomic sequence classification system.
#
Expand Down
3 changes: 2 additions & 1 deletion scripts/krakenhll-standard_installation.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#!/bin/bash

# Copyright 2013-2015, Derrick Wood <[email protected]>
# Original file Copyright 2013-2015, Derrick Wood <[email protected]>
# Portions (c) 2017, Florian Breitwieser <[email protected]> as part of KrakenHLL
#
# This file is part of the Kraken taxonomic sequence classification system.
#
Expand Down
54 changes: 0 additions & 54 deletions scripts/krakenhll-verify_gi_numbers.pl

This file was deleted.

12 changes: 8 additions & 4 deletions src/Makefile
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
CXX = g++
FOPENMP?=-fopenmp
CXXFLAGS = -Wall -std=c++0x $(FOPENMP) -O2 -Wfatal-errors ${CPPFLAGS}
CXXFLAGS = -Wall -std=c++0x $(FOPENMP) -I./gzstream -O2 -Wfatal-errors ${CPPFLAGS}
#CXXFLAGS = -Wall -std=c++11 $(FOPENMP) -O3 -Wfatal-errors
PROGS = classify db_sort set_lcas make_seqid_to_taxid_map db_shrink build_taxdb grade_classification dump_taxdb read_uid_mapping
LIBFLAGS = -L. -I./gzstream -L./gzstream -lz -lgzstream ${LDFLAGS}
#LIBFLAGS = -L. -lz -lgzstream ${LDFLAGS}
LIBFLAGS = -L. -lz ${LDFLAGS}

.PHONY: all install clean

Expand All @@ -13,7 +14,7 @@ install: $(PROGS)
cp $(PROGS) $(KRAKEN_DIR)/

clean:
rm -f $(PROGS) *.o
rm -rf $(PROGS) *.o *.dSYM

db_shrink: krakendb.o quickfile.o

Expand All @@ -25,7 +26,7 @@ grade_classification: taxdb.h report-cols.h

read_uid_mapping: quickfile.o

classify: classify.cpp krakendb.o quickfile.o krakenutil.o seqreader.o uid_mapping.o hyperloglogplus.h taxdb.h report-cols.h
classify: classify.cpp krakendb.o quickfile.o krakenutil.o seqreader.o uid_mapping.o gzstream.o hyperloglogplus.h taxdb.h report-cols.h
$(CXX) $(CXXFLAGS) -o classify $^ $(LIBFLAGS)

build_taxdb: taxdb.h report-cols.h quickfile.o
Expand All @@ -43,6 +44,9 @@ krakendb.o: krakendb.cpp krakendb.hpp quickfile.hpp
seqreader.o: seqreader.cpp seqreader.hpp quickfile.hpp
$(CXX) $(CXXFLAGS) -c seqreader.cpp

gzstream.o: gzstream/gzstream.C gzstream/gzstream.h
$(CXX) $(CXXFLAGS) -c -O gzstream/gzstream.C

quickfile.o: quickfile.cpp quickfile.hpp
$(CXX) $(CXXFLAGS) -c quickfile.cpp

Expand Down
60 changes: 30 additions & 30 deletions src/classify.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -115,19 +115,19 @@ ostream* cout_or_file(string file) {
}

void loadKrakenDB(KrakenDB& database, string DB_filename, string Index_filename) {
QuickFile db_file;
db_file.open_file(DB_filename);
if (Populate_memory) {
db_file.load_file();
}
database = KrakenDB(db_file.ptr());
QuickFile idx_file;
idx_file.open_file(Index_filename);
if (Populate_memory)
idx_file.load_file();

KrakenDBIndex db_index(idx_file.ptr());
database.set_index(&db_index);
QuickFile db_file;
db_file.open_file(DB_filename);
if (Populate_memory) {
db_file.load_file();
}
database = KrakenDB(db_file.ptr());
QuickFile idx_file;
idx_file.open_file(Index_filename);
if (Populate_memory)
idx_file.load_file();

KrakenDBIndex db_index(idx_file.ptr());
database.set_index(&db_index);
}

int main(int argc, char **argv) {
Expand Down Expand Up @@ -243,18 +243,18 @@ int main(int argc, char **argv) {
taxdb.readGenomeSizes(fname);
}

TaxReport<uint32_t,ReadCounts> rep = TaxReport<uint32_t, ReadCounts>(*Report_output, taxdb, taxon_counts, false);
rep.setReportCols(vector<string> {
"%",
"reads",
TaxReport<uint32_t,ReadCounts> rep = TaxReport<uint32_t, ReadCounts>(*Report_output, taxdb, taxon_counts, false);
rep.setReportCols(vector<string> {
"%",
"reads",
"taxReads",
"kmers",
"dup",
"cov",
"taxID",
"rank",
"taxName"});
rep.printReport("kraken","blu");
"taxID",
"rank",
"taxName"});
rep.printReport("kraken","blu");
}

for (size_t i = 0; i < Open_fstreams.size(); ++i) {
Expand Down Expand Up @@ -368,11 +368,11 @@ void process_file(char *filename) {

inline
uint32_t get_taxon_for_kmer(KrakenDB& database, uint64_t* kmer_ptr, uint64_t& current_bin_key,
int64_t& current_min_pos, int64_t& current_max_pos) {
uint32_t* val_ptr = database.kmer_query(
database.canonical_representation(*kmer_ptr), &current_bin_key,
&current_min_pos, &current_max_pos);
return val_ptr ? *val_ptr : 0;
int64_t& current_min_pos, int64_t& current_max_pos) {
uint32_t* val_ptr = database.kmer_query(
database.canonical_representation(*kmer_ptr), &current_bin_key,
&current_min_pos, &current_max_pos);
return val_ptr ? *val_ptr : 0;
}


Expand Down Expand Up @@ -513,10 +513,10 @@ bool classify_sequence(DNASequence &dna, ostringstream &koss,
taxon = get_taxon_for_kmer(*KrakenDatabases[i], kmer_ptr,
db_statuses[i].current_bin_key, db_statuses[i].current_min_pos, db_statuses[i].current_max_pos);

//uint32_t* val_ptr = KrakenDatabases[i]->kmer_query(
// KrakenDatabases[i]->canonical_representation(*kmer_ptr), &db_statuses[i].current_bin_key,
// &db_statuses[i].current_min_pos, &db_statuses[i].current_max_pos);
//taxon = val_ptr ? *val_ptr : 0;
//uint32_t* val_ptr = KrakenDatabases[i]->kmer_query(
// KrakenDatabases[i]->canonical_representation(*kmer_ptr), &db_statuses[i].current_bin_key,
// &db_statuses[i].current_min_pos, &db_statuses[i].current_max_pos);
//taxon = val_ptr ? *val_ptr : 0;
if (taxon) break;
}

Expand Down
Binary file removed src/gzstream/.Makefile.swp
Binary file not shown.
2 changes: 1 addition & 1 deletion src/gzstream/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
# ----------------------------------------------------------------------------

# CXX = CC -n32 -LANG:std # for SGI Irix 6.5, MIPSpro CC version 7.30
CXX = g++-7 # for Linux RedHat 6.1, g++ version 2.95.2
CXX = g++ # for Linux RedHat 6.1, g++ version 2.95.2

CPPFLAGS = -I. -O -fPIC
LDFLAGS = -L. -lgzstream -lz
Expand Down
Loading

0 comments on commit e4904a7

Please sign in to comment.