Cookbook: basic usage of strange¶
Assumption¶
- You have installed correctly
strange. - You are using
bash.
Data preparation¶
In this notebook, we are going to compute interaction for the PDB files 9i38.
More precisely between the protein m4D2 and its FDD ligand.
⚠️ CAUTION
Note that we have choosen a NMR structure. If you choose a cristallographic structure, you will have to add hydrogens and fill gaps in the structure, if there are.
ℹ️ INFORMATION
All data are available on the project GitLab.
Download 9i38 structure¶
%%bash
wget https://files.rcsb.org/view/9i38.pdb --output-document=../../data/input/9i38.pdb > /dev/null 2>&1
head ../../data/input/9i38.pdb
HEADER DE NOVO PROTEIN 22-JAN-25 9I38 TITLE SOLUTION STRUCTURE OF THE DE NOVO DESIGNED MONOHEME PROTEIN M4D2 WITH TITLE 2 BOUND IRON(III) 2,4-DIMETHYLDEUTEROPORPHYRIN IX COMPND MOL_ID: 1; COMPND 2 MOLECULE: M4D2; COMPND 3 CHAIN: A; COMPND 4 ENGINEERED: YES; COMPND 5 OTHER_DETAILS: DE NOVO DESIGNED SOURCE MOL_ID: 1; SOURCE 2 ORGANISM_SCIENTIFIC: TEST ORGANISM;
Adding parameter file¶
We need to create and give to strange this next parameter file:
miscellaneous:
enable_vdw_radius: True
Actually, the ligand contains a FE atoms, which is not define in the MDAnalysis.guesser.tables.vdwradii.
This is a dictionnary containing as key atoms names, and value van der Waals atoms radius, as float.
We use these to define connectivity.
%%bash
echo "miscellaneous:
enable_vdw_radius: True
" > ../../data/input/parameter.yml
cat ../../data/input/parameter.yml
miscellaneous:
enable_vdw_radius: True
Running the software¶
Now we are going to run the software and check the produced results!
%%bash
MPLBACKEND=agg strange \
--input ../../data/input/9i38.pdb \
--parameter ../../data/input/parameter.yml \
--selection "resname FDD" "protein" \
--output ../../data/output/interaction.csv \
--visualization ../../data/output/visualization.mvsj
[Warn02][UserWarning] Checking and assigning aromaticity for input file '../../data/input/9i38.pdb', with selection 'resname FDD'. [Warn03][UserWarning] Skipping cycle of size 3 atoms. [Warn02][UserWarning] Checking and assigning aromaticity for input file '../../data/input/9i38.pdb', with selection 'protein'. [Inf01] Computing pharmacophore in progress… [Inf01] Computing pharmacophore done! [Inf01] Computing pharmacophore in progress… [Inf01] Computing pharmacophore done!
import csv
from IPython import display
markdown: str = ""
size: int = 10
with open("../../data/output/interaction.csv", newline="") as csvfile:
reader: csv.reader = csv.reader(csvfile, delimiter=",", quotechar="\"")
header: list[str] = next(reader)
markdown += "| **" + "** | **".join(header) + "** |\n"
markdown += "|:-:" * len(header) + "|\n"
for row in reader:
markdown += "| " + " | ".join(row) + " |\n"
if size == 1:
break
else:
size -= 1
display.display(display.Markdown(markdown))
| INTERACTION | DISTANCE | ANGLE | OFFSET | STACKING_SHAPE | MOLECULE_A_KEY | MOLECULE_A_ID | MOLECULE_A_COORDINATE_X | MOLECULE_A_COORDINATE_Y | MOLECULE_A_COORDINATE_Z | MOLECULE_A_FAMILY | MOLECULE_A_SUBFAMILY | MOLECULE_A_ATOM_NAME | MOLECULE_A_ATOM_TYPE | MOLECULE_A_ATOM_ID | MOLECULE_A_RESIDU_NAME | MOLECULE_A_RESIDU_ID | MOLECULE_A_CHAIN | MOLECULE_B_KEY | MOLECULE_B_ID | MOLECULE_B_COORDINATE_X | MOLECULE_B_COORDINATE_Y | MOLECULE_B_COORDINATE_Z | MOLECULE_B_FAMILY | MOLECULE_B_SUBFAMILY | MOLECULE_B_ATOM_NAME | MOLECULE_B_ATOM_TYPE | MOLECULE_B_ATOM_ID | MOLECULE_B_RESIDU_NAME | MOLECULE_B_RESIDU_ID | MOLECULE_B_CHAIN | FRAME |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| hydrophobic | 3.9658229562364125 | atom | 5 | 11.692000389099121 | 0.15700000524520874 | 1.2970000505447388 | Hydrophobe | ThreeWayAttach | CAA | C | 1860 | FDD | 200 | A | atom | 426 | 12.222999572753906 | 2.433000087738037 | 4.500999927520752 | Hydrophobe | ThreeWayAttach | CG | C | 528 | ARG | 34 | A | 0 | |||
| hydrophobic | 3.590886981314969 | atom | 7 | 11.41100025177002 | 0.7720000147819519 | -1.7580000162124634 | Hydrophobe | ThreeWayAttach | CMA | C | 1858 | FDD | 200 | A | atom | 294 | 12.539999961853027 | -2.4509999752044678 | -2.868000030517578 | Hydrophobe | ThreeWayAttach | CG | C | 1465 | ARG | 92 | A | 0 | |||
| hydrophobic | 3.651595299090022 | atom | 13 | 4.177999973297119 | 1.128000020980835 | -4.978000164031982 | Hydrophobe | ThreeWayAttach | CME | C | 1850 | FDD | 200 | A | atom | 243 | 3.3420000076293945 | 3.7109999656677246 | -7.420000076293945 | LumpedHydrophobe | RH6_6 | CD1 | C | 275 | TYR | 17 | A | 0 | |||
| hydrophobic | 3.6669647129775536 | atom | 13 | 4.177999973297119 | 1.128000020980835 | -4.978000164031982 | Hydrophobe | ThreeWayAttach | CME | C | 1850 | FDD | 200 | A | atom | 280 | 3.062999963760376 | -2.1649999618530273 | -3.812000036239624 | Hydrophobe | ThreeWayAttach | CB | C | 1595 | ALA | 99 | A | 0 | |||
| hydrophobic | 3.7624681760239316 | atom | 14 | 5.1620001792907715 | 0.9570000171661377 | -3.871000051498413 | Hydrophobe | ThreeWayAttach | C3B | C | 1849 | FDD | 200 | A | atom | 280 | 3.062999963760376 | -2.1649999618530273 | -3.812000036239624 | Hydrophobe | ThreeWayAttach | CB | C | 1595 | ALA | 99 | A | 0 | |||
| hydrophobic | 3.6167937050173036 | atom | 15 | 3.5980000495910645 | 0.515999972820282 | -1.9869999885559082 | Hydrophobe | ThreeWayAttach | CHC | C | 1847 | FDD | 200 | A | atom | 234 | 2.509999990463257 | 3.622999906539917 | -0.48899999260902405 | LumpedHydrophobe | iPropyl | CG1 | C | 258 | VAL | 16 | A | 0 | |||
| hydrophobic | 3.287036798638357 | atom | 15 | 3.5980000495910645 | 0.515999972820282 | -1.9869999885559082 | Hydrophobe | ThreeWayAttach | CHC | C | 1847 | FDD | 200 | A | atom | 280 | 3.062999963760376 | -2.1649999618530273 | -3.812000036239624 | Hydrophobe | ThreeWayAttach | CB | C | 1595 | ALA | 99 | A | 0 | |||
| hydrophobic | 3.926550924650316 | atom | 17 | 0.6830000281333923 | 0.18000000715255737 | -0.9639999866485596 | Hydrophobe | ThreeWayAttach | CMC | C | 1841 | FDD | 200 | A | atom | 234 | 2.509999990463257 | 3.622999906539917 | -0.48899999260902405 | LumpedHydrophobe | iPropyl | CG1 | C | 258 | VAL | 16 | A | 0 | |||
| hydrophobic | 3.6154962732811944 | atom | 18 | 1.9470000267028809 | 0.06499999761581421 | -0.18000000715255737 | Hydrophobe | ThreeWayAttach | C2C | C | 1840 | FDD | 200 | A | atom | 234 | 2.509999990463257 | 3.622999906539917 | -0.48899999260902405 | LumpedHydrophobe | iPropyl | CG1 | C | 258 | VAL | 16 | A | 0 | |||
| hydrophobic | 3.4077149924614187 | atom | 21 | 3.993000030517578 | -0.4830000102519989 | 2.684000015258789 | Hydrophobe | ThreeWayAttach | CHD | C | 1836 | FDD | 200 | A | atom | 412 | 2.997999906539917 | 2.118000030517578 | 4.6479997634887695 | Hydrophobe | ThreeWayAttach | CB | C | 658 | ALA | 41 | A | 0 |
In this table, there are a lot of useful information! Like which residue interact with whom? Coordinates of the interacting atom. Interacting geometry like distance, angle, or offset… We are advising you to check the corresponding section in the documentation to understand the meaning of this table!
⚠️ CAUTION
For a gain of space, some constants appear in a header which not necessarily describe what it is. For instance, for
halogen_bond,OFFSETrepresent an angle, and not anOFFSET! This is only the case for these geometric data (DISTANCE,ANGLE,OFFSET,STACKING_SHAPE).
Visualize the interaction¶
With generated visualization.mvsj, we can directly observe interaction using MolStar viewer.
To do so:
- [Open files] > [Select files] (here, you open
visualization.mvsj) > [Apply] - [Open files] > [Select files] (here, you open
9i38.pdb) > [Apply]
Respect this order.
Due to its conception, loading a state.mvsj in MolStar will delete everything load in the viewer…
from IPython.display import HTML
HTML("""
<link href="https://molstar.org/viewer/molstar.css" rel="stylesheet">
<script type="text/javascript" src="https://molstar.org/viewer/molstar.js"></script>
<div id="viewer" class="molstar-container"></div>
<style>
.molstar-container {
height: 15cm;
}
.msp-plugin {
position: relative !important;
width: 100% !important;
height: 100% !important;
}
.msp-plugin,
.msp-plugin .msp-viewport {
background-color: #0000;
}
.msp-plugin .msp-layout-standard {
border: none;
}
canvas {
background: none !important;
}
</style>
<script type="text/javascript">
molstar.Viewer.create(
"viewer",
{
layoutIsExpanded: false,
layoutShowControls: false,
layoutShowRemoteState: false,
layoutShowSequence: false,
layoutShowLog: false,
}
).then(viewer => {
viewer.plugin.canvas3d.setProps({
transparentBackground: true,
});
viewer.loadMvsFromUrl(
"../../visualization.mvsj", "mvsj"
).then(() => {
viewer.loadPdb("9I38");
});
});
</script>
""")