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

fix: allow insertions that start at 0 #449

Merged
merged 1 commit into from
May 28, 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
Original file line number Diff line number Diff line change
Expand Up @@ -118,8 +118,8 @@ void from_json(const nlohmann::json& json, std::unique_ptr<InsertionContains<Sym
"The field 'position' is required in an InsertionContains expression"
)
CHECK_SILO_QUERY(
json["position"].is_number_unsigned() && (json["position"].get<uint32_t>() > 0),
"The field 'position' in an InsertionContains expression needs to be a positive number (> 0)"
json["position"].is_number_unsigned(),
"The field 'position' in an InsertionContains expression needs to be an unsigned integer"
)
CHECK_SILO_QUERY(
!json.contains("sequenceName") || json["sequenceName"].is_string(),
Expand Down
5 changes: 0 additions & 5 deletions src/silo/storage/sequence_store.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -89,11 +89,6 @@ InsertionEntry parseInsertion(const std::string& value) {
try {
if (position_and_insertion.size() == 2) {
const auto position = boost::lexical_cast<uint32_t>(position_and_insertion[0]);
if (position == 0) {
const std::string message =
"Positions are 1-indexed, position of 0 not allowed in insertion: " + value;
throw silo::preprocessing::PreprocessingException(message);
}
const auto& insertion = position_and_insertion[1];
return {.position_idx = position, .insertion = insertion};
}
Expand Down