-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add stellar3 submodule * Add seqan2 submodule * Update lib/stellar3 (seqan2 namespace) * Load Stellar3 database sequences * Load database sequences from all reference files * Add flag to toggle shared memory vs distributed (default) execution * Each threads imports cart query sequences * sharg::parser instead of seqan3::argument_parser * Workaround for g++-10 template deduction * [FIX] error handling; lambda with implicit void return type * Environment variable parsing as struct * Supress stellar3 warnings * Overwrite (not append) stellar search output files * Compile stellar diagnostics * Stream stellar diagnostics * Share databaseIDMap between threads * Test data for DREAM-Stellar CLI tests * [FIX] empty output when no valik matches found * [TEST] DREAM-Stellar output shared memory vs distributed * [FIX] always write out matches * Compare DREAM-Stellar matches * Launch Stellar3 search * Calculate Stellar qGram length * Refactor search time printing * Pump stellar version * Stellar search reverse strand * Update CLI test suit after raptor_data_simulation update * Delete stellar_call.hpp * Apply suggestions from code review * Pump lib/stellar3 version
- Loading branch information
Showing
62 changed files
with
7,060 additions
and
1,381 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,3 +11,12 @@ | |
[submodule "lib/raptor_data_simulation"] | ||
path = lib/raptor_data_simulation | ||
url = [email protected]:eaasna/raptor_data_simulation.git | ||
[submodule "lib/stellar3"] | ||
path = lib/stellar3 | ||
url = [email protected]:seqan/stellar3.git | ||
[submodule "lib/seqan"] | ||
path = lib/seqan | ||
url = [email protected]:seqan/seqan.git | ||
[submodule "lib/sharg"] | ||
path = lib/sharg | ||
url = https://github.com/seqan/sharg-parser.git |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
#pragma once | ||
|
||
#include <cstdlib> | ||
#include <unistd.h> | ||
#include <filesystem> | ||
#include <vector> | ||
#include <algorithm> | ||
|
||
namespace valik | ||
{ | ||
|
||
struct env_var_pack | ||
{ | ||
std::filesystem::path tmp_path; | ||
std::string stellar_exec{"stellar"}; | ||
std::string merge_exec{"cat"}; | ||
|
||
env_var_pack() | ||
{ | ||
// the location of bin-query fasta files can be overwritten with an environment variable | ||
if (auto ptr = std::getenv("VALIK_TMP"); ptr != nullptr) | ||
{ | ||
tmp_path = std::string(ptr); | ||
std::filesystem::file_status s = status(tmp_path); | ||
std::filesystem::perms p = s.permissions(); | ||
bool is_writable = (std::filesystem::perms::none != (p & std::filesystem::perms::owner_write)) | | ||
(std::filesystem::perms::none != (p & std::filesystem::perms::group_write)) | | ||
(std::filesystem::perms::none != (p & std::filesystem::perms::others_write)); | ||
|
||
if (!exists(tmp_path) | !is_directory(s) | !is_writable ) | ||
throw std::runtime_error("Directory $VALIK_TMP=" + std::string(ptr) + " must exist and write permission must be granted"); | ||
} | ||
|
||
else | ||
tmp_path = create_temporary_path("valik/stellar_call_XXXXXX"); | ||
|
||
if (auto ptr = std::getenv("VALIK_STELLAR"); ptr != nullptr) | ||
stellar_exec = std::string(ptr); | ||
|
||
if (auto ptr = std::getenv("VALIK_MERGE"); ptr != nullptr) | ||
merge_exec = std::string(ptr); | ||
} | ||
|
||
/* Creates a temporary folder in the temporary path of the OS | ||
* | ||
* \param name: a name with 'XXXXXX' at the end, e.g.: valik/call_XXXXXX | ||
* \return returns the name with the 'XXXXXX' replaced and the directory created | ||
* | ||
* throws if any errors occurs | ||
*/ | ||
static std::filesystem::path create_temporary_path(std::filesystem::path name) | ||
{ | ||
if (!name.is_relative()) | ||
{ | ||
throw std::runtime_error("Must be given a relative file"); | ||
} | ||
auto path = std::filesystem::temp_directory_path() / name; | ||
auto path_str = path.native(); | ||
create_directories(path.parent_path()); | ||
auto str = std::vector<char>(path_str.size()+1, '\0'); // Must include an extra character to include a 0 | ||
std::copy_n(path_str.data(), path_str.size(), str.data()); | ||
auto ptr = mkdtemp(str.data()); | ||
if (!ptr) | ||
{ | ||
throw std::runtime_error("Could not create temporary folder: " + path_str); | ||
} | ||
return str.data(); | ||
} | ||
}; | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.