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

Deprecate tsv fasta #640

Merged
merged 3 commits into from
Nov 14, 2024
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
10 changes: 10 additions & 0 deletions .run/silo --preprocessing.run.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="silo --preprocessing" type="CMakeRunConfiguration" factoryName="Application" PROGRAM_PARAMS="--preprocessing --preprocessingConfig=testBaseData/test_preprocessing_config.yaml --databaseConfig=testBaseData/exampleDataset/database_config.yaml" REDIRECT_INPUT="false" ELEVATE="false" USE_EXTERNAL_CONSOLE="false" EMULATE_TERMINAL="false" WORKING_DIR="file://../" PASS_PARENT_ENVS_2="true" PROJECT_NAME="SILO" TARGET_NAME="siloApi" CONFIG_NAME="Debug" RUN_TARGET_PROJECT_NAME="SILO" RUN_TARGET_NAME="siloApi">
<envs>
<env name="SPDLOG_LEVEL" value="debug" />
</envs>
<method v="2">
<option name="com.jetbrains.cidr.execution.CidrBuildBeforeRunTaskProvider$BuildBeforeRunTask" enabled="true" />
</method>
</configuration>
</component>
10 changes: 0 additions & 10 deletions .run/silo--preprocessing.run.xml

This file was deleted.

3 changes: 1 addition & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,8 @@ find_package(re2 REQUIRED)
# Includes
# ---------------------------------------------------------------------------

include_directories(SYSTEM
include_directories(
${CMAKE_SOURCE_DIR}/include
${roaring_INCLUDE_DIRS}
fengelniederhammer marked this conversation as resolved.
Show resolved Hide resolved
)

# ---------------------------------------------------------------------------
Expand Down
2 changes: 1 addition & 1 deletion conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ class SiloRecipe(ConanFile):

"re2/*:shared": False,

"absl/*:shared": False,
"abseil/*:shared": False,
}

def generate(self):
Expand Down
23 changes: 0 additions & 23 deletions include/silo/common/input_stream_wrapper.h

This file was deleted.

29 changes: 0 additions & 29 deletions include/silo/config/preprocessing_config.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,17 +26,7 @@ const AbstractConfigSource::Option LINEAGE_DEFINITIONS_FILENAME_OPTION = {
{"lineageDefinitionsFilename"}
};
const AbstractConfigSource::Option NDJSON_INPUT_FILENAME_OPTION = {{"ndjsonInputFilename"}};
const AbstractConfigSource::Option METADATA_FILENAME_OPTION = {{"metadataFilename"}};
const AbstractConfigSource::Option REFERENCE_GENOME_FILENAME_OPTION = {{"referenceGenomeFilename"}};
const AbstractConfigSource::Option NUCLEOTIDE_SEQUENCE_PREFIX_OPTION = {{"nucleotideSequencePrefix"}
};
const AbstractConfigSource::Option UNALIGNED_NUCLEOTIDE_SEQUENCE_PREFIX_OPTION = {
{"unalignedNucleotideSequencePrefix"}
};
const AbstractConfigSource::Option GENE_PREFIX_OPTION = {{"genePrefix"}};
const AbstractConfigSource::Option NUCLEOTIDE_INSERTIONS_OPTION = {{"nucleotideInsertionsFilename"}
};
const AbstractConfigSource::Option AMINO_ACID_INSERTIONS_OPTION = {{"aminoAcidInsertionsFilename"}};

const std::string DEFAULT_OUTPUT_DIRECTORY = "./output/";

Expand All @@ -51,13 +41,7 @@ class PreprocessingConfig {
std::optional<uint32_t> duckdb_memory_limit_in_g;
std::optional<std::filesystem::path> lineage_definitions_file;
std::optional<std::filesystem::path> ndjson_input_filename;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we make this non-optional now?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If this were non-optional, it would need a default value. Anyways, I would wait for the config refactor for this. Maybe it will resolve this already

std::optional<std::filesystem::path> metadata_file;
std::filesystem::path reference_genome_file = "reference_genomes.json";
std::string nucleotide_sequence_prefix = "nuc_";
std::string unaligned_nucleotide_sequence_prefix = "unaligned_";
std::string gene_prefix = "gene_";
std::string nuc_insertions_filename = "nuc_insertions.tsv";
std::string aa_insertions_filename = "aa_insertions.tsv";

void validate() const;

Expand All @@ -75,19 +59,6 @@ class PreprocessingConfig {

[[nodiscard]] std::optional<std::filesystem::path> getNdjsonInputFilename() const;

[[nodiscard]] std::optional<std::filesystem::path> getMetadataInputFilename() const;

[[nodiscard]] std::filesystem::path getNucFilenameNoExtension(size_t sequence_idx) const;

[[nodiscard]] std::filesystem::path getUnalignedNucFilenameNoExtension(size_t sequence_idx
) const;

[[nodiscard]] std::filesystem::path getGeneFilenameNoExtension(size_t sequence_idx) const;

[[nodiscard]] std::filesystem::path getNucleotideInsertionsFilename() const;

[[nodiscard]] std::filesystem::path getAminoAcidInsertionsFilename() const;

void overwrite(const silo::config::AbstractConfigSource& config_reader);
};

Expand Down
21 changes: 0 additions & 21 deletions include/silo/preprocessing/preprocessing_database.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
#include "silo/preprocessing/sql_function.h"
#include "silo/storage/reference_genomes.h"
#include "silo/zstd/zstd_compressor.h"
#include "silo/zstd/zstd_table.h"

namespace silo::preprocessing {

Expand All @@ -38,26 +37,6 @@ class PreprocessingDatabase {
Partitions getPartitionDescriptor();

std::unique_ptr<duckdb::MaterializedQueryResult> query(std::string sql_query);

static std::string getBaseStem(const std::filesystem::path& file_path);

ZstdTable generateSequenceTableViaFile(
const std::string& table_name,
const std::string& reference_sequence,
const std::filesystem::path& file_path
);

ZstdTable generateSequenceTableFromFasta(
const std::string& table_name,
const std::string& reference_sequence,
const std::filesystem::path& file_name
);

ZstdTable generateSequenceTableFromSAM(
const std::string& table_name,
const std::string& reference_sequence,
const std::filesystem::path& file_name
);
};

std::vector<std::string> extractStringListValue(
Expand Down
20 changes: 0 additions & 20 deletions include/silo/preprocessing/preprocessor.h
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@ class Preprocessor {
std::string getPartitionKeySelect() const;

void buildTablesFromNdjsonInput(const ValidatedNdjsonFile& input_file);
void buildMetadataTableFromFile(const std::filesystem::path& metadata_filename);

void buildPartitioningTable();
void buildPartitioningTableByColumn(const Identifier& partition_by_field);
Expand All @@ -65,25 +64,12 @@ class Preprocessor {
template <typename SymbolType>
Identifiers getInsertionsFields();

template <typename SymbolType>
void createInsertionsTableFromFile(const std::filesystem::path& insertion_file);

void createPartitionedSequenceTablesFromNdjson(const ValidatedNdjsonFile& input_file);

void createAlignedPartitionedSequenceViews(const ValidatedNdjsonFile& input_file);
void createUnalignedPartitionedSequenceFiles(const ValidatedNdjsonFile& input_file);
void createUnalignedPartitionedSequenceFile(size_t sequence_idx, const std::string& table_sql);

void createPartitionedSequenceTablesFromSequenceFiles();

template <typename SymbolType>
void createPartitionedTableForSequence(
size_t sequence_idx,
const Identifier& prefixed_sequence_identifier,
const std::string& compression_dictionary,
const std::filesystem::path& filename
);

Database buildDatabase(
const preprocessing::Partitions& partition_descriptor,
const std::filesystem::path& intermediate_results_directory
Expand All @@ -101,12 +87,6 @@ class Preprocessor {
silo::SequenceStorePartition<SymbolType>& sequence_store
);

template <typename SymbolType>
ColumnFunction createInsertionLambda(
const std::string& sequence_name,
silo::SequenceStorePartition<SymbolType>& sequence_store
);

template <typename SymbolType>
void buildSequenceStore(
Database& database,
Expand Down
2 changes: 1 addition & 1 deletion include/silo/query_engine/actions/aggregated.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ class Aggregated : public Action {
private:
std::vector<std::string> group_by_fields;

[[nodiscard]] void validateOrderByFields(const Database& database) const override;
void validateOrderByFields(const Database& database) const override;

[[nodiscard]] QueryResult execute(
const Database& database,
Expand Down
2 changes: 1 addition & 1 deletion include/silo/query_engine/actions/mutations.h
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ class Mutations : public Action {
std::vector<QueryResultEntry>& output
) const;

[[nodiscard]] void validateOrderByFields(const Database& database) const override;
void validateOrderByFields(const Database& database) const override;

[[nodiscard]] QueryResult execute(
const Database& database,
Expand Down
2 changes: 1 addition & 1 deletion include/silo/query_engine/operators/selection.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
#include "silo/query_engine/operators/operator.h"

namespace silo::query_engine::filter_expressions {
struct And;
class And;
}

namespace silo::query_engine::operators {
Expand Down
2 changes: 1 addition & 1 deletion include/silo/query_engine/query_engine.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

namespace silo::query_engine {

struct QueryResult;
class QueryResult;

class QueryEngine {
private:
Expand Down
14 changes: 0 additions & 14 deletions include/silo/sequence_file_reader/fasta_format_exception.h

This file was deleted.

17 changes: 0 additions & 17 deletions include/silo/sequence_file_reader/fasta_reader.h

This file was deleted.

14 changes: 0 additions & 14 deletions include/silo/sequence_file_reader/sam_format_exception.h

This file was deleted.

19 changes: 0 additions & 19 deletions include/silo/sequence_file_reader/sam_reader.h

This file was deleted.

29 changes: 0 additions & 29 deletions include/silo/sequence_file_reader/sequence_file_reader.h

This file was deleted.

3 changes: 2 additions & 1 deletion include/silo/storage/insertion_index.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@
namespace silo::storage::insertion {

template <typename SymbolType>
struct ThreeMerHash {
class ThreeMerHash {
public:
size_t operator()(const std::array<typename SymbolType::Symbol, 3>& three_mer) const;
};

Expand Down
6 changes: 3 additions & 3 deletions include/silo/storage/sequence_store.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,9 @@ struct ReadSequence {
uint32_t offset;

ReadSequence(std::string_view _sequence, uint32_t _offset = 0)
: sequence(std::move(_sequence)),
offset(_offset),
is_valid(true) {}
: is_valid(true),
sequence(std::move(_sequence)),
offset(_offset) {}

ReadSequence() {}
};
Expand Down
30 changes: 0 additions & 30 deletions include/silo/zstd/zstd_table.h

This file was deleted.

2 changes: 1 addition & 1 deletion include/silo/zstd/zstd_table_reader.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ struct DataChunk;
} // namespace duckdb

namespace silo {
struct ZstdDecompressor;
class ZstdDecompressor;

class ZstdTableReader {
private:
Expand Down
Loading