Skip to content

Commit

Permalink
Backmerge: #2418 - Unable to save micro-molecule connected to monomer…
Browse files Browse the repository at this point in the history
… to HELM (#2420)

Co-authored-by: Aliakasndr Dziarkach <[email protected]>
  • Loading branch information
AliaksandrDziarkach and Aliakasndr Dziarkach authored Sep 24, 2024
1 parent 26e6e29 commit 82f6ae0
Show file tree
Hide file tree
Showing 4 changed files with 312 additions and 1 deletion.
1 change: 1 addition & 0 deletions api/tests/integration/ref/formats/ket_to_helm.py.out
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ helm_cycled_polymer.ket:SUCCEED
helm_fractional_ratio.ket FAILED : expected 'PEPTIDE1{(A:1.5+C:.1+G:3.)}$$$$V2.0', got 'PEPTIDE1{(A:1.5+C:0.1+G:3)}$$$$V2.0'
helm_mixed_base.ket:SUCCEED
helm_mixed_custom.ket:SUCCEED
helm_molecule_2418.ket:SUCCEED
helm_monomer_molecule.ket:SUCCEED
helm_multi_char_rna.ket:SUCCEED
helm_peptide.ket:SUCCEED
Expand Down
1 change: 1 addition & 0 deletions api/tests/integration/tests/formats/ket_to_helm.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ def find_diff(a, b):
"helm_fractional_ratio": "PEPTIDE1{(A:1.5+C:.1+G:3.)}$$$$V2.0",
"helm_smiles": "PEPTIDE1{G.[[*:1]NC(C(=O)[*:2])C=O |$_R1;;;;;_R2;;$|].C}|PEPTIDE2{G.[[*:1]NC(C(=O)[*:2])C=O |$_R1;;;;;_R2;;$|].C}$$$$V2.0",
"helm_smiles_sugar": "RNA1{[C(C(CO[*:1])O[*:2])[*:3] |$;;;;_R1;;_R2;_R3$|](A)P}$$$$V2.0",
"helm_molecule_2418": "PEPTIDE1{A}|CHEM1{[C1C=CC=CC=1[*:1] |$;;;;;;_R1$|]}$PEPTIDE1,CHEM1,1:R1-1:R1$$$V2.0",
}

for filename in sorted(helm_data.keys()):
Expand Down
309 changes: 309 additions & 0 deletions api/tests/integration/tests/formats/ref/helm_molecule_2418.ket
Original file line number Diff line number Diff line change
@@ -0,0 +1,309 @@
{
"root": {
"nodes": [
{
"$ref": "monomer2"
},
{
"$ref": "mol0"
}
],
"connections": [
{
"connectionType": "single",
"endpoint1": {
"monomerId": "monomer2",
"attachmentPointId": "R1"
},
"endpoint2": {
"moleculeId": "mol0",
"atomId": "2"
}
}
],
"templates": [
{
"$ref": "monomerTemplate-A___Alanine"
}
]
},
"mol0": {
"type": "molecule",
"atoms": [
{
"label": "C",
"location": [
0.38484915212857373,
-2.750074324253319,
0
]
},
{
"label": "C",
"location": [
2.1151508478714334,
-2.7495891362559064,
0
]
},
{
"label": "C",
"location": [
1.251637509491239,
-2.2499667959289127,
0
]
},
{
"label": "C",
"location": [
2.1151508478714334,
-3.7505319749008663,
0
]
},
{
"label": "C",
"location": [
0.38484915212857373,
-3.7550199638768618,
0
]
},
{
"label": "C",
"location": [
1.2538208554795531,
-4.250033018228521,
0
]
},
{
"label": "H",
"location": [
1.2522471693575667,
-1.2499669817715073,
0
]
}
],
"bonds": [
{
"type": 2,
"atoms": [
2,
0
]
},
{
"type": 1,
"atoms": [
0,
4
]
},
{
"type": 2,
"atoms": [
4,
5
]
},
{
"type": 1,
"atoms": [
5,
3
]
},
{
"type": 2,
"atoms": [
3,
1
]
},
{
"type": 1,
"atoms": [
1,
2
]
},
{
"type": 1,
"atoms": [
2,
6
]
}
],
"sgroups": [
{
"type": "SUP",
"atoms": [
2,
0,
4,
5,
3,
1,
6
],
"name": "",
"expanded": true,
"id": 0,
"attachmentPoints": [
{
"attachmentAtom": 2,
"leavingAtom": 6,
"attachmentId": "1"
}
]
}
]
},
"monomer2": {
"type": "monomer",
"id": "2",
"position": {
"x": 1.25,
"y": -1.25
},
"alias": "A",
"templateId": "A___Alanine"
},
"monomerTemplate-A___Alanine": {
"type": "monomerTemplate",
"atoms": [
{
"label": "N",
"location": [
-1.2549,
-0.392,
0
]
},
{
"label": "C",
"location": [
-0.272,
0.2633,
0
],
"stereoLabel": "abs"
},
{
"label": "C",
"location": [
-0.3103,
1.7393,
0
]
},
{
"label": "C",
"location": [
1.0523,
-0.392,
0
]
},
{
"label": "O",
"location": [
1.0829,
-1.5722,
0
]
},
{
"label": "O",
"location": [
2.0353,
0.2633,
0
]
},
{
"label": "H",
"location": [
-2.3334,
0.0905,
0
]
}
],
"bonds": [
{
"type": 1,
"atoms": [
1,
0
]
},
{
"type": 1,
"atoms": [
1,
2
],
"stereo": 1
},
{
"type": 1,
"atoms": [
1,
3
]
},
{
"type": 2,
"atoms": [
3,
4
]
},
{
"type": 1,
"atoms": [
3,
5
]
},
{
"type": 1,
"atoms": [
0,
6
]
}
],
"class": "AminoAcid",
"classHELM": "PEPTIDE",
"id": "A___Alanine",
"fullName": "Alanine",
"alias": "A",
"attachmentPoints": [
{
"attachmentAtom": 0,
"leavingGroup": {
"atoms": [
6
]
},
"type": "left"
},
{
"attachmentAtom": 3,
"leavingGroup": {
"atoms": [
5
]
},
"type": "right"
}
],
"naturalAnalogShort": "A"
}
}
2 changes: 1 addition & 1 deletion core/indigo-core/molecule/src/ket_document.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -430,7 +430,7 @@ void KetDocument::parseSimplePolymers(std::vector<std::deque<std::string>>& sequ
// molecules saved in helm as CHEM
if (has_mol_1)
id_to_class.emplace(mon_ref_1, MonomerClass::CHEM);
if (has_mol_1)
if (has_mol_2)
id_to_class.emplace(mon_ref_2, MonomerClass::CHEM);

auto& mon1_class = id_to_class.at(mon_id_1);
Expand Down

0 comments on commit 82f6ae0

Please sign in to comment.