-
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.
feat: Generalizing the config for multiple nucleotide sequences and m…
…ultiple genes
- Loading branch information
Showing
67 changed files
with
3,510 additions
and
954 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
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,37 @@ | ||
#ifndef SILO_ZSTDFASTA_READER_H | ||
#define SILO_ZSTDFASTA_READER_H | ||
|
||
#include <filesystem> | ||
#include <iostream> | ||
|
||
#include <zstd.h> | ||
|
||
#include "silo/common/input_stream_wrapper.h" | ||
|
||
namespace silo { | ||
class ZstdFastaReader { | ||
private: | ||
silo::InputStreamWrapper in_file; | ||
ZSTD_DDict* zstd_dictionary; | ||
ZSTD_DCtx* zstd_context; | ||
std::string genome_buffer; | ||
|
||
bool populateKey(std::string& key); | ||
|
||
public: | ||
explicit ZstdFastaReader( | ||
const std::filesystem::path& in_file_name, | ||
const std::string& compression_dict | ||
); | ||
|
||
bool nextKey(std::string& key); | ||
|
||
bool next(std::string& key, std::string& genome); | ||
|
||
bool nextCompressed(std::string& key, std::string& compressed_genome); | ||
|
||
void reset(); | ||
}; | ||
} // namespace silo | ||
|
||
#endif // SILO_ZSTDFASTA_READER_H |
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,31 @@ | ||
#ifndef SILO_ZSTDFASTA_WRITER_H | ||
#define SILO_ZSTDFASTA_WRITER_H | ||
|
||
#include <filesystem> | ||
#include <iostream> | ||
|
||
#include <zstd.h> | ||
|
||
#include "silo/common/input_stream_wrapper.h" | ||
|
||
namespace silo { | ||
class ZstdFastaWriter { | ||
private: | ||
std::ofstream outStream; | ||
ZSTD_CDict* zstd_dictionary; | ||
ZSTD_CCtx* zstd_context; | ||
std::string buffer; | ||
|
||
public: | ||
explicit ZstdFastaWriter( | ||
const std::filesystem::path& out_file_name, | ||
const std::string& compression_dict | ||
); | ||
|
||
void write(const std::string& key, const std::string& genome); | ||
|
||
void writeRaw(const std::string& key, const std::string& compressed_genome); | ||
}; | ||
} // namespace silo | ||
|
||
#endif // SILO_ZSTDFASTA_WRITER_H |
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
Oops, something went wrong.