Skip to content

Commit

Permalink
Backmerge: #2357 - Export to HELM doesn't work if we connect peptide …
Browse files Browse the repository at this point in the history
…TO molecule (#2370)
  • Loading branch information
AliaksandrDziarkach authored Sep 16, 2024
1 parent 163acd3 commit 04356f1
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 3 deletions.
2 changes: 1 addition & 1 deletion api/tests/integration/tests/formats/ket_to_helm.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ def find_diff(a, b):
"helm_aminoacids_variants": "PEPTIDE1{([Dha]+N).(L+I).(E+Q).(A+C+D+E+F+G+H+I+K+L+M+N+O+P+Q+R+S+T+U+V+W+Y)}$$$$V2.0",
"dna_variants": "RNA1{[dR](C,G,T)P.[dR](A,C,G,T)}$$$$V2.0",
"rna_variants": "RNA1{R(G,T)P.R(A,C,G,T)}$$$$V2.0",
"helm_monomer_molecule": "PEPTIDE1{A}|PEPTIDE2{G}|CHEM1{[C(N[*:2])=C[*:1] |$;;_R2;;_R1$|]}$CHEM1,PEPTIDE1,1:R2-1:R1$$$V2.0",
"helm_monomer_molecule": "PEPTIDE1{A}|PEPTIDE2{G}|CHEM1{[C(N[*:2])=C[*:1] |$;;_R2;;_R1$|]}$CHEM1,PEPTIDE1,1:R2-1:R1|PEPTIDE2,CHEM1,1:R2-1:R1$$$V2.0",
}

for filename in sorted(helm_data.keys()):
Expand Down
11 changes: 11 additions & 0 deletions api/tests/integration/tests/formats/ref/helm_monomer_molecule.ket
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,17 @@
"monomerId": "monomer98",
"attachmentPointId": "R1"
}
},
{
"connectionType": "single",
"endpoint1": {
"monomerId": "monomer102",
"attachmentPointId": "R2"
},
"endpoint2": {
"moleculeId": "mol0",
"atomId": "1"
}
}
],
"templates": [
Expand Down
4 changes: 2 additions & 2 deletions core/indigo-core/molecule/src/ket_document.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -410,7 +410,7 @@ void KetDocument::parseSimplePolymers(std::vector<std::deque<std::string>>& sequ
bool has_ap_1 = ep1.hasStringProp("attachmentPointId");
bool has_atom_1 = ep1.hasStringProp("atomId");
bool has_ap_2 = ep2.hasStringProp("attachmentPointId");
bool has_atom_2 = ep1.hasStringProp("atomId");
bool has_atom_2 = ep2.hasStringProp("atomId");
if ((has_ap_1 || has_atom_1) != (has_ap_2 || has_atom_2))
throw Error("Connection with only one attachment point id.");
if (!(has_ap_1 || has_atom_1))
Expand All @@ -433,7 +433,7 @@ void KetDocument::parseSimplePolymers(std::vector<std::deque<std::string>>& sequ
auto& mon2_class = id_to_class.at(mon_id_2);

auto& ap_id_1 = has_mon_1 ? ep1.getStringProp("attachmentPointId") : ep1.getStringProp("atomId");
auto& ap_id_2 = has_mon_1 ? ep2.getStringProp("attachmentPointId") : ep1.getStringProp("atomId");
auto& ap_id_2 = has_mon_2 ? ep2.getStringProp("attachmentPointId") : ep2.getStringProp("atomId");

ap_to_connection.emplace(std::make_pair(mon_id_1, ap_id_1), connection);
ap_to_connection.emplace(std::make_pair(mon_id_2, ap_id_2), connection);
Expand Down

0 comments on commit 04356f1

Please sign in to comment.