Skip to content

Commit

Permalink
Address feedback and fix potential undefined behavior in seqreader.cc
Browse files Browse the repository at this point in the history
  • Loading branch information
ch4rr0 committed Feb 1, 2023
1 parent 33cdd9f commit de12003
Show file tree
Hide file tree
Showing 6 changed files with 381 additions and 330 deletions.
4 changes: 2 additions & 2 deletions scripts/mask_low_complexity.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ set -o pipefail # Stop on failures in non-final pipeline commands

target="$1"

MASKER="dustmasker"
MASKER="k2mask"
if [ -n "$KRAKEN2_PROTEIN_DB" ]; then
MASKER="segmasker"
fi
Expand All @@ -33,7 +33,7 @@ if [ -d $target ]; then
done
elif [ -f $target ]; then
if [ ! -e "$target.masked" ]; then
$MASKER -in $target -outfmt fasta | sed -e '/^>/!s/[a-z]/x/g' > "$target.tmp"
$MASKER -in $target -threads 4 -outfmt fasta | sed -e '/^>/!s/[a-z]/x/g' > "$target.tmp"
mv "$target.tmp" $target
touch "$target.masked"
fi
Expand Down
4 changes: 2 additions & 2 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@ add_executable(lookup_accession_numbers
omp_hack.cc
utilities.cc)

add_executable(dustmasker
dustmasker.cc
add_executable(k2mask
k2mask.cc
seqreader.cc)

target_link_libraries(dustmasker ${ZLIB_LIBRARIES} Threads::Threads)
9 changes: 5 additions & 4 deletions src/Makefile
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
CXX = g++
CXXFLAGS = -fopenmp -Wall -std=c++11 -O3
OMPFLAG ?= -fopenmp
CXXFLAGS = $(OMPFLAG) -Wall -std=c++11 -O3
CXXFLAGS += -DLINEAR_PROBING

.PHONY: all clean install

PROGS = estimate_capacity build_db classify dump_table lookup_accession_numbers
PROGS = estimate_capacity build_db classify dump_table lookup_accession_numbers k2mask

all: $(PROGS)

Expand All @@ -24,13 +25,13 @@ omp_hack.o: omp_hack.cc omp_hack.h
reports.o: reports.cc reports.h kraken2_data.h
aa_translate.o: aa_translate.cc aa_translate.h
utilities.o: utilities.cc utilities.h
dustmasker.o: dustmasker.cc gzstream.h threadpool.h

classify.o: classify.cc kraken2_data.h kv_store.h taxonomy.h seqreader.h mmscanner.h compact_hash.h aa_translate.h reports.h utilities.h readcounts.h
dump_table.o: dump_table.cc compact_hash.h taxonomy.h mmscanner.h kraken2_data.h reports.h
estimate_capacity.o: estimate_capacity.cc kv_store.h mmscanner.h seqreader.h utilities.h
build_db.o: build_db.cc taxonomy.h mmscanner.h seqreader.h compact_hash.h kv_store.h kraken2_data.h utilities.h
lookup_accession_numbers.o: lookup_accession_numbers.cc mmap_file.h utilities.h
k2mask.o: k2mask.cc gzstream.h threadpool.h

build_db: build_db.o mmap_file.o compact_hash.o taxonomy.o seqreader.o mmscanner.o omp_hack.o utilities.o
$(CXX) $(CXXFLAGS) -o $@ $^
Expand All @@ -47,5 +48,5 @@ dump_table: dump_table.o mmap_file.o compact_hash.o omp_hack.o taxonomy.o report
lookup_accession_numbers: lookup_accession_numbers.o mmap_file.o omp_hack.o utilities.o
$(CXX) $(CXXFLAGS) -o $@ $^

dustmasker: dustmasker.o seqreader.o
k2mask: k2mask.o seqreader.o
$(CXX) $(CXXFLAGS) -o $@ $^ -lz -pthread
322 changes: 0 additions & 322 deletions src/dustmasker.cc

This file was deleted.

Loading

0 comments on commit de12003

Please sign in to comment.