Skip to content

Commit

Permalink
#2189 HELM 2 support: support for SMILES
Browse files Browse the repository at this point in the history
Add helm with smiles import/export support. Add UTs.
  • Loading branch information
AliaksandrDziarkach committed Aug 29, 2024
1 parent 94852cd commit 6ade1c2
Show file tree
Hide file tree
Showing 17 changed files with 1,240 additions and 410 deletions.
1 change: 1 addition & 0 deletions api/tests/integration/ref/formats/helm_to_ket.py.out
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ helm_multi_char_rna.ket:SUCCEED
helm_peptide.ket:SUCCEED
helm_rna_without_base.ket:SUCCEED
helm_simple_rna.ket:SUCCEED
helm_smiles.ket:SUCCEED
Test 'CHEM1{[A6OH]}|PEPTIDE1{A}$CHEM1,PEPTIDE1,1:R2-3:R1$$$V2.0': got expected error 'Polymer 'PEPTIDE1' does not contains monomer with number 3.'
Test 'CHEM1{[A6OH]}|PEPTIDE1{A}$CHEM10,PEPTIDE1,1:R2-1:R1$$$V2.0': got expected error 'Polymer 'CHEM10' not found.'
Test 'CHEM1{[MCC]}|RNA1{R(A)P.R(C)P.R(G)P.R(T)P.R(U)P}$RNA1,PEPTIDE1,15:R2-1:R1$$$V2.0': got expected error 'Polymer 'PEPTIDE1' not found.'
Expand Down
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 @@ -8,6 +8,7 @@ helm_connetion_separator.ket:SUCCEED
helm_cycled_polymer.ket:SUCCEED
helm_mixed_base.ket:SUCCEED
helm_mixed_custom.ket:SUCCEED
helm_monomer_molecule.ket:SUCCEED
helm_multi_char_rna.ket:SUCCEED
helm_peptide.ket:SUCCEED
helm_rna_without_base.ket:SUCCEED
Expand Down
1 change: 1 addition & 0 deletions api/tests/integration/tests/formats/helm_to_ket.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ def find_diff(a, b):
"helm_mixed_base": "RNA1{[dR](A)P.[dR](A+G)P.[dR](A)P.[dR](G+C)}$$$$V2.0",
"helm_mixed_custom": "RNA1{[dR](A:10+C:20+G:30+T:50)P.[dR](A:10+C:20+G:30+T:50)P.[dR](A+C+G+T)}$$$$V2.0",
"aminoacids_variants": "PEPTIDE1{(D+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",
"helm_smiles": "PEPTIDE1{G.[[*]N[C@@H](C=O)C([*])=O |$_R1;;;;;;_R2;$|].C}|PEPTIDE2{G.[[*:1]N[C@@H](C=O)C([*:2])=O].C}$$$$",
}

lib = indigo.loadMonomerLibraryFromFile(
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 @@ -47,6 +47,7 @@ def find_diff(a, b):
"aminoacids_variants": "PEPTIDE1{(D+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}|CHEM1{[C(N%91)=C%92.[*:1]%92.[*:2]%91 |$;;;_R1;_R2$|}$CHEM1,PEPTIDE1,1:R2-1:R1$$$V2.0",
}

for filename in sorted(helm_data.keys()):
Expand Down
275 changes: 275 additions & 0 deletions api/tests/integration/tests/formats/ref/helm_monomer_molecule.ket
Original file line number Diff line number Diff line change
@@ -0,0 +1,275 @@
{
"root": {
"nodes": [
{
"$ref": "monomer2"
},
{
"$ref": "mol0"
}
],
"connections": [
{
"connectionType": "single",
"endpoint1": {
"moleculeId": "mol0",
"atomId": "3"
},
"endpoint2": {
"monomerId": "monomer2",
"attachmentPointId": "R1"
}
}
],
"templates": [
{
"$ref": "monomerTemplate-A___Alanine"
}
]
},
"mol0": {
"type": "molecule",
"atoms": [
{
"label": "C",
"location": [
15.525000000000002,
-7.1499999999999995,
0
]
},
{
"label": "C",
"location": [
16.39102540378444,
-6.649999999999999,
0
]
},
{
"label": "H",
"location": [
17.25705080756888,
-7.150000000000001,
0
]
},
{
"label": "N",
"location": [
14.658974596215565,
-6.649999999999999,
0
]
},
{
"label": "H",
"location": [
13.792949192431125,
-7.1499999999999995,
0
]
}
],
"bonds": [
{
"type": 2,
"atoms": [
0,
1
]
},
{
"type": 1,
"atoms": [
1,
2
]
},
{
"type": 1,
"atoms": [
0,
3
]
},
{
"type": 1,
"atoms": [
3,
4
]
}
],
"sgroups": [
{
"type": "SUP",
"atoms": [
1,
0,
2,
3,
4
],
"name": "",
"expanded": true,
"id": 0,
"attachmentPoints": [
{
"attachmentAtom": 1,
"leavingAtom": 2,
"attachmentId": "1"
},
{
"attachmentAtom": 3,
"leavingAtom": 4,
"attachmentId": "2"
}
]
}
]
},
"monomer2": {
"type": "monomer",
"id": "2",
"position": {
"x": 17.88125,
"y": -6.8812500000000005
},
"alias": "A",
"templateId": "A___Alanine"
},
"monomerTemplate-A___Alanine": {
"type": "monomerTemplate",
"atoms": [
{
"label": "N",
"location": [
-0.9805331061317907,
-0.3062945076130863,
0
]
},
{
"label": "C",
"location": [
-0.21253088283357008,
0.20573302003705513,
0
],
"stereoLabel": "abs"
},
{
"label": "C",
"location": [
-0.24245710640903237,
1.3590256048251048,
0
]
},
{
"label": "C",
"location": [
0.8222288529623742,
-0.3062945076130863,
0
]
},
{
"label": "O",
"location": [
0.8461385772811508,
-1.2284597573196283,
0
]
},
{
"label": "O",
"location": [
1.5903092126145777,
0.20573302003705513,
0
]
},
{
"label": "H",
"location": [
-1.8232336838376928,
0.07071340035455181,
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"
}
}
Loading

0 comments on commit 6ade1c2

Please sign in to comment.