Skip to content
Snippets Groups Projects
Verified Commit aa4c41a5 authored by Xavier Robin's avatar Xavier Robin
Browse files

Fail cleanly for gaps in unknown polymer chain types

This avoids silently creating invalid files if we have gaps in
oligosaccharide chains, for instance.
parent 81ea25b5
Branches
Tags
No related merge requests found
......@@ -1344,7 +1344,7 @@ namespace {
}
}
if(entity_infos[entity_idx].poly_type == "polydeoxyribonucleotide") {
else if(entity_infos[entity_idx].poly_type == "polydeoxyribonucleotide") {
entity_infos[entity_idx].mon_ids[mon_id_idx] = "DN";
entity_infos[entity_idx].seq_olcs[mon_id_idx] = "(DN)";
entity_infos[entity_idx].seq_can_olcs[mon_id_idx] = "N";
......@@ -1355,7 +1355,7 @@ namespace {
}
}
if(entity_infos[entity_idx].poly_type == "polyribonucleotide" ||
else if(entity_infos[entity_idx].poly_type == "polyribonucleotide" ||
entity_infos[entity_idx].poly_type == "polydeoxyribonucleotide/polyribonucleotide hybrid") {
entity_infos[entity_idx].mon_ids[mon_id_idx] = "N";
entity_infos[entity_idx].seq_olcs[mon_id_idx] = "N";
......@@ -1366,6 +1366,13 @@ namespace {
comp_infos["N"] = info;
}
}
else {
std::stringstream ss;
ss << "Gaps are not supported for polymer chains of type ";
ss << entity_infos[entity_idx].poly_type;
throw ost::io::IOException(ss.str());
}
}
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment