Skip to content

Commit

Permalink
Last edits
Browse files Browse the repository at this point in the history
  • Loading branch information
Taepper committed Dec 18, 2023
1 parent fabf265 commit 619035b
Show file tree
Hide file tree
Showing 8 changed files with 2 additions and 39 deletions.
12 changes: 0 additions & 12 deletions include/silo/preprocessing/preprocessing_config.h
Original file line number Diff line number Diff line change
Expand Up @@ -62,16 +62,6 @@ struct GenePrefix {
};
const GenePrefix DEFAULT_GENE_PREFIX = {"gene_"};

struct PartitionsFolder {
std::string folder;
};
const PartitionsFolder DEFAULT_PARTITIONS_FOLDER = {"partitions/"};

struct SortedPartitionsFolder {
std::string folder;
};
const SortedPartitionsFolder DEFAULT_SORTED_PARTITIONS_FOLDER = {"partitions_sorted/"};

struct ReferenceGenomeFilename {
std::string filename;
};
Expand Down Expand Up @@ -102,8 +92,6 @@ class PreprocessingConfig {
const NdjsonInputFilename& ndjson_input_filename_,
const MetadataFilename& metadata_filename_,
const PangoLineageDefinitionFilename& pango_lineage_definition_filename_,
const PartitionsFolder& partition_folder_,
const SortedPartitionsFolder& sorted_partition_folder_,
const ReferenceGenomeFilename& reference_genome_filename_,
const NucleotideSequencePrefix& nucleotide_sequence_prefix_,
const GenePrefix& gene_prefix_
Expand Down
8 changes: 0 additions & 8 deletions include/silo/preprocessing/preprocessing_config_reader.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,14 +39,6 @@ struct OptionalPreprocessingConfig {
* The filename of the pango lineage definition file, relative to the inputDirectory
*/
std::optional<std::filesystem::path> pango_lineage_definition_file;
/**
* Folder for intermediate partition files, relative to the intermediateResultsDirectory
*/
std::optional<std::filesystem::path> partition_folder;
/**
* Folder for intermediate sorted partition files, relative to the intermediateResultsDirectory
*/
std::optional<std::filesystem::path> sorted_partition_folder;
/**
* The filename of the reference genome file, relative to the inputDirectory
*/
Expand Down
2 changes: 0 additions & 2 deletions include/silo/zstdfasta/zstdfasta_table_reader.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,6 @@ class ZstdFastaTableReader {
std::unique_ptr<silo::ZstdDecompressor> decompressor;
size_t current_row;

// std::string DEBUG_dictionary;

std::string genome_buffer;

std::optional<std::string> nextKey();
Expand Down
5 changes: 2 additions & 3 deletions src/silo/preprocessing/metadata_info.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -126,9 +126,8 @@ MetadataInfo MetadataInfo::validateFromNdjsonFile(
duckdb::Connection connection(db);

auto result = connection.Query(fmt::format(
"SELECT json_keys(metadata)"
"FROM "
"'{}' LIMIT 1; ",
"SELECT json_keys(metadata) "
"FROM read_json_auto(\"{}\") LIMIT 1; ",
ndjson_file.string()
));
if (result->HasError()) {
Expand Down
2 changes: 0 additions & 2 deletions src/silo/preprocessing/preprocessing_config.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,6 @@ PreprocessingConfig::PreprocessingConfig(
const NdjsonInputFilename& ndjson_input_filename_,
const MetadataFilename& metadata_filename_,
const PangoLineageDefinitionFilename& pango_lineage_definition_filename_,
const PartitionsFolder& partition_folder_,
const SortedPartitionsFolder& sorted_partition_folder_,
const ReferenceGenomeFilename& reference_genome_filename_,
const NucleotideSequencePrefix& nucleotide_sequence_prefix_,
const GenePrefix& gene_prefix_
Expand Down
9 changes: 0 additions & 9 deletions src/silo/preprocessing/preprocessing_config_reader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,6 @@ struct convert<OptionalPreprocessingConfig> {
extractStringIfPresent(node, "ndjsonInputFilename"),
extractStringIfPresent(node, "metadataFilename"),
extractStringIfPresent(node, "pangoLineageDefinitionFilename"),
extractStringIfPresent(node, "partitionsFolder"),
extractStringIfPresent(node, "sortedPartitionsFolder"),
extractStringIfPresent(node, "referenceGenomeFilename"),
extractStringIfPresent(node, "nucleotideSequencePrefix"),
extractStringIfPresent(node, "genePrefix")};
Expand Down Expand Up @@ -92,13 +90,6 @@ PreprocessingConfig OptionalPreprocessingConfig::mergeValuesFromOrDefault(
PangoLineageDefinitionFilename{
pango_lineage_definition_file.has_value() ? pango_lineage_definition_file
: other.pango_lineage_definition_file},
PartitionsFolder{partition_folder.value_or(
other.partition_folder.value_or(silo::preprocessing::DEFAULT_PARTITIONS_FOLDER.folder)
)},
SortedPartitionsFolder{
sorted_partition_folder.value_or(other.sorted_partition_folder.value_or(
silo::preprocessing::DEFAULT_SORTED_PARTITIONS_FOLDER.folder
))},
ReferenceGenomeFilename{reference_genome_file.value_or(other.reference_genome_file.value_or(
silo::preprocessing::DEFAULT_REFERENCE_GENOME_FILENAME.filename
))},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ TEST(PreprocessingConfigReader, shouldReadConfigWithOverriddenDefaults) {
);

const std::string input_directory = "./testBaseData/exampleDataset/";
const std::string intermediate_directory = "./output/overriddenTemp/";
ASSERT_EQ(config.getMetadataInputFilename(), input_directory + "small_metadata_set.tsv");
ASSERT_EQ(
config.getPangoLineageDefinitionFilename(), input_directory + "pangolineage_alias.json"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,5 @@ intermediateResultsDirectory: "./output/overriddenTemp/"
metadataFilename: "small_metadata_set.tsv"
pangoLineageDefinitionFilename: "pangolineage_alias.json"
referenceGenomeFilename: "reference_genomes.json"
partitionsFolder: "folder1/"
sortedPartitionsFolder: "folder2/"
genePrefix: "aaSeq_"
nucleotideSequencePrefix: ""

0 comments on commit 619035b

Please sign in to comment.