-
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: support SAM files as sequence input and allow partial sequence …
…input with an offset
- Loading branch information
Showing
61 changed files
with
614 additions
and
884 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
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,17 @@ | ||
#pragma once | ||
|
||
#include <filesystem> | ||
#include <optional> | ||
#include <string> | ||
|
||
#include "silo/file_reader/file_reader.h" | ||
|
||
namespace silo::file_reader { | ||
|
||
class FastaReader : public FileReader { | ||
public: | ||
std::optional<ReadSequence> nextEntry() override; | ||
explicit FastaReader(const std::filesystem::path& in_file_name) | ||
: FileReader(in_file_name) {} | ||
}; | ||
} // namespace silo |
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,29 @@ | ||
#pragma once | ||
|
||
#include <optional> | ||
#include <string> | ||
|
||
#include "silo/common/input_stream_wrapper.h" | ||
|
||
namespace silo::file_reader { | ||
class FileReader { | ||
protected: | ||
explicit FileReader(const std::filesystem::path& in_file_name) | ||
: in_file(in_file_name){}; | ||
|
||
silo::InputStreamWrapper in_file; | ||
|
||
public: | ||
struct ReadSequence { | ||
std::string key; | ||
uint32_t offset; | ||
std::string sequence; | ||
}; | ||
|
||
virtual std::optional<ReadSequence> nextEntry() = 0; | ||
|
||
void reset(); | ||
|
||
virtual ~FileReader(){}; | ||
}; | ||
} // namespace silo::file_reader |
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,13 @@ | ||
#pragma once | ||
|
||
#include <stdexcept> | ||
#include <string> | ||
|
||
namespace silo::file_reader { | ||
|
||
class SamFormatException : public std::runtime_error { | ||
public: | ||
explicit SamFormatException(const std::string& error_message); | ||
}; | ||
|
||
} // namespace silo |
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,18 @@ | ||
#pragma once | ||
|
||
#include <filesystem> | ||
#include <optional> | ||
#include <string> | ||
|
||
#include "silo/common/string_utils.h" | ||
#include "silo/file_reader/fasta_format_exception.h" | ||
#include "silo/common/input_stream_wrapper.h" | ||
|
||
namespace silo::file_reader { | ||
class SamReader : public FileReader { | ||
public: | ||
std::optional<ReadSequence> nextEntry() override; | ||
explicit SamReader(const std::filesystem::path& in_file_name) | ||
: FileReader(in_file_name) {} | ||
}; | ||
} // namespace silo |
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
File renamed without changes.
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
File renamed without changes.
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.