Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

faster Ripples #202

Merged
merged 11 commits into from
Dec 19, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
FROM ubuntu:20.04
ENV APT_KEY_DONT_WARN_ON_DANGEROUS_USAGE=DontWarn
ENV DEBIAN_FRONTEND=noninteractive
USER root
RUN apt-get update && apt-get install -yq --no-install-recommends \
git wget \
ca-certificates \
wget cmake libboost-filesystem-dev libboost-program-options-dev libboost-iostreams-dev libboost-date-time-dev \
libprotoc-dev libprotoc-dev protobuf-compiler openssl openssh-client vim \
mafft rsync libtbb-dev mpich libmpich-dev automake libtool autoconf make nasm gdb && apt clean

RUN mkdir ISAL&& \
cd ISAL&& \
wget https://github.com/intel/isa-l/archive/refs/tags/v2.30.0.tar.gz && \
tar -xvf v2.30.0.tar.gz && \
cd isa-l-2.30.0 && \
./autogen.sh && \
./configure && \
make -j$(nproc) && \
make install && \
cd .. && rm -rf ISAL
LABEL Name=usher-dev
32 changes: 32 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
// For format details, see https://aka.ms/devcontainer.json. For config options, see the README at:
// https://github.com/microsoft/vscode-dev-containers/tree/v0.209.6/containers/docker-existing-dockerfile
{
"name": "Existing Dockerfile",

// Sets the run context to one level up instead of the .devcontainer folder.
"context": ".",

// Update the 'dockerFile' property if you aren't using the standard 'Dockerfile' filename.
"dockerFile": "./Dockerfile",

// Set *default* container specific settings.json values on container create.
"settings": {},

// Add the IDs of extensions you want installed when the container is created.
"extensions": [],

// Use 'forwardPorts' to make a list of ports inside the container available locally.
// "forwardPorts": [],

// Uncomment the next line to run commands after the container is created - for example installing curl.
// "postCreateCommand": "apt-get update && apt-get install -y curl",

// Uncomment when using a ptrace-based debugger like C++, Go, and Rust
"runArgs": [ "--cap-add=SYS_PTRACE", "--security-opt", "seccomp=unconfined" ]

// Uncomment to use the Docker CLI from inside the container. See https://aka.ms/vscode-remote/samples/docker-from-docker.
// "mounts": [ "source=/var/run/docker.sock,target=/var/run/docker.sock,type=bind" ],

// Uncomment to connect as a non-root user if you've added one. See https://aka.ms/vscode-remote/containers/non-root.
// "remoteUser": "vscode"
}
15 changes: 12 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ configure_file(src/version.hpp.in version.hpp)

set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O3 -std=c++17 -Wall -g -Wno-unused-function -Wno-deprecated-declarations")
#-DDEBUG_PARSIMONY_SCORE_CHANGE_CORRECT -DCHECK_PAR_MAIN -DEASY_DEBUG -DSTOP_ON_ERROR -fsanitize=address
set(CMAKE_CXX_FLAGS_DEBUG "-fsanitize=address")
set(CMAKE_CXX_FLAGS_DEBUG "-fsanitize=address -O0 -ggdb3 -fno-eliminate-unused-debug-symbols")
set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-DNDEBUG -O3")
set(CMAKE_CXX_FLAGS_RELEASE "-DNDEBUG -O3")
set(CMAKE_INCLUDE_CURRENT_DIR ON)
Expand Down Expand Up @@ -52,9 +52,10 @@ AUX_SOURCE_DIRECTORY(src/matOptimize/Profitable_Moves_Enumerators New_Profitable
AUX_SOURCE_DIRECTORY(src/matOptimize/apply_move patch_tree)
file(GLOB MATUTIL_SRCS "src/matUtils/*.cpp" "src/matUtils/*.hpp")
file(GLOB RIPPLES_SRCS "src/ripples/*.cpp" "src/ripples/*.hpp")
file(GLOB RIPPLES_FAST_SRCS "src/ripples/ripples_fast/*.cpp" "src/ripples/ripples_fast/*.hpp")

#set_source_files_properties(src/matOptimize/Profitable_Moves_Enumerators/upward_integrated.cpp PROPERTIES COMPILE_FLAGS -O0)
#set_source_files_properties(src/matOptimize/Profitable_Moves_Enumerators/downward_integrated.cpp PROPERTIES COMPILE_FLAGS -O0)
set_source_files_properties(src/mutation_annotated_tree.cpp PROPERTIES COMPILE_FLAGS -O3)
#set_source_files_properties(src/usher_mapper.cpp PROPERTIES COMPILE_FLAGS -O3)
#set_source_files_properties(src/matOptimize/Profitable_Moves_Enumerators/range_tree.cpp PROPERTIES COMPILE_FLAGS -O0)

#set_source_files_properties(src/matOptimize/detailed_mutations_store.cpp PROPERTIES COMPILE_FLAGS -O0)
Expand Down Expand Up @@ -214,6 +215,13 @@ else()
${PROTO_HDRS}
)

add_executable(ripples-fast
src/mutation_annotated_tree.cpp
src/usher_mapper.cpp
${RIPPLES_FAST_SRCS}
${PROTO_SRCS}
${PROTO_HDRS}
)

add_executable(compareVCF
src/mutation_annotated_tree.cpp
Expand Down Expand Up @@ -347,6 +355,7 @@ TARGET_LINK_LIBRARIES(matUtils PRIVATE stdc++ ${Boost_LIBRARIES} ${TBB_IMPORTED

TARGET_COMPILE_OPTIONS(ripples PRIVATE -DTBB_SUPPRESS_DEPRECATED_MESSAGES)
TARGET_LINK_LIBRARIES(ripples PRIVATE stdc++ ${Boost_LIBRARIES} ${TBB_IMPORTED_TARGETS} ${Protobuf_LIBRARIES}) # OpenMP::OpenMP_CXX)
TARGET_LINK_LIBRARIES(ripples-fast PRIVATE stdc++ ${Boost_LIBRARIES} ${TBB_IMPORTED_TARGETS} ${Protobuf_LIBRARIES}) # OpenMP::OpenMP_CXX)

if(USHER_SERVER)
TARGET_COMPILE_OPTIONS(usher_server PRIVATE -DTBB_SUPPRESS_DEPRECATED_MESSAGES)
Expand Down
4 changes: 3 additions & 1 deletion src/mutation_annotated_tree.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
#include <google/protobuf/io/coded_stream.h>
#include <google/protobuf/io/zero_copy_stream_impl.h>
#include "usher_graph.hpp"

#include <signal.h>
// Uses one-hot encoding if base is unambiguous
// A:1,C:2,G:4,T:8
int8_t Mutation_Annotated_Tree::get_nuc_id (char nuc) {
Expand Down Expand Up @@ -1141,10 +1141,12 @@ std::vector<Mutation_Annotated_Tree::Node*> Mutation_Annotated_Tree::Tree::bread
}

void Mutation_Annotated_Tree::Tree::depth_first_expansion_helper(Mutation_Annotated_Tree::Node* node, std::vector<Mutation_Annotated_Tree::Node*>& vec) const {
node->dfs_idx=vec.size();
vec.push_back(node);
for (auto c: node->children) {
depth_first_expansion_helper(c, vec);
}
node->dfs_end_idx=vec.size();
}

std::vector<Mutation_Annotated_Tree::Node*> Mutation_Annotated_Tree::Tree::depth_first_expansion(Mutation_Annotated_Tree::Node* node) const {
Expand Down
2 changes: 2 additions & 0 deletions src/mutation_annotated_tree.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,8 @@ class Node {
Node* parent;
std::vector<Node*> children;
std::vector<Mutation> mutations;
size_t dfs_idx;
size_t dfs_end_idx;

bool is_leaf();
bool is_root();
Expand Down
Loading