Skip to content

Commit ba96fbf

Browse files
authored
feat: docs cleanup (#351)
## changes - [x] remove references to workstations (in installation) - [x] remove references to workstations (in config) - [x] remove references to workstations (in auth) - [x] getting started > input data has some weird formatting - [x] docking > get results removed, get_poses - [x] docking > scatter plot of all poses - [x] docking > show composite job widget - [x] docking > composite job widget is animated - [x] abfe > update job widget - [x] abfe > job control section needs to be moved elsewhere (how to > job control) - [x] abfe > view trajectories - [x] complex preparation params (padding) - [x] add a warning about loop modelling (in development) - [x] protein > discourage saving to pdb in common use cases - [x] ligandset > update display (no longer shows a dataframe) - [ ] ligandset > add warning about konnektor - [ ] find pockets > add info about each pokcet and inspecting pocket data - [ ] find pockets > add info about making pockets from other sources - [ ] dock ligands > add ligandset widget showing poses - [ ] dock ligands > add warning about constrained docking - [ ] filter outputs of docking --> needs a total overhaul - [ ] job control -- needs to be updated with JobList - [ ] clarify which methods modify state in Ligand or Protein - [ ] clarify how we can get the org key from the UI - [ ] docking > residue ID - [ ] add a "concepts" page
1 parent 94fd396 commit ba96fbf

25 files changed

+1769
-704
lines changed

docs/configure.md

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,12 @@
11
# Configuration
22

3-
## On a Deep Origin workstation
4-
5-
On a Deep Origin workstation, no configuration is needed! Within a workstation, the Deep Origin Python client is automatically configured.
6-
7-
## On your local computer
8-
9-
To run this package outside of a Deep Origin workstation (for example, on your own computer), first you need to configure this package. After installing this package, set your organization key and environment.
10-
3+
To configure the client to connect to the DeepOrigin API, set your organization key and environment.
114

125

136
```{.python notest}
147
from deeporigin import config
158
config.set_value("org_key", "your-org-key")
16-
config.set_value("env", "prod") # or "staging" / "edge"
9+
config.set_value("env", "prod")
1710
```
1811

1912

docs/dd/how-to/complex.md

Lines changed: 25 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
This document describes how to create a `Complex` object, that can be used to run Docking, ABFE and RBFE.
1+
This document describes how to create a `Complex` object, that can be used to run [Docking](./docking.md), [ABFE](../tutorial/abfe.md) and [RBFE](../tutorial/rbfe.md).
2+
23

34

45
## Creating a Complex
@@ -19,7 +20,7 @@ The directory should contain:
1920

2021
### From `Protein` and `Ligand` objects
2122

22-
A `Complex` object can be also be constructed using `Protein` and `Ligand` objects.
23+
A `Complex` object can be also be constructed using [`Protein`](./proteins.md) and [`Ligand`](./ligands.md) objects.
2324

2425
```{.python notest}
2526
from deeporigin.drug_discovery import Complex, BRD_DATA_DIR, Protein, Ligand
@@ -33,7 +34,7 @@ sim = Complex(protein=protein, ligands=[ligand])
3334
### From `LigandSet` objects
3435

3536

36-
A `Complex` object can also be constructed using `Protein` and `LigandSet` objects.
37+
A `Complex` object can also be constructed using [`Protein`](./proteins.md) and [`LigandSet`](./ligands.md) objects.
3738

3839
```{.python notest}
3940
from deeporigin.drug_discovery import Complex, BRD_DATA_DIR, Protein, LigandSet
@@ -70,12 +71,12 @@ sim.ligands = ligand5 # Replace with a single ligand
7071
```
7172

7273
??? tip "Constructing Ligands"
73-
To see how to construct Ligands, see [this](./ligands.md)
74+
To see how to construct Ligands, see [:material-page-previous: Ligands](./ligands.md)
7475

7576
??? tip "Constructing the Protein"
76-
To see how to construct the Protein, see [this](./proteins.md)
77+
To see how to construct the Protein, see [:material-page-previous: Proteins](./proteins.md)
7778

78-
## Preparing a complex
79+
## Preparing a Complex
7980

8081
To prepare a protein-ligand complex for simulation or further analysis, use the `Complex.prepare()` method. This method runs system preparation on a given ligand in the context of the complex's protein, handling tasks such as protonation, water retention, and box padding.
8182

@@ -84,7 +85,8 @@ To prepare a protein-ligand complex for simulation or further analysis, use the
8485
Typically, you would call this method using a ligand in the complex:
8586

8687
```{.python notest}
87-
sim.prepare(sim.ligands[0])
88+
prepared_system = sim.prepare(sim.ligands[0])
89+
prepared_system.show()
8890
```
8991

9092
You should see something like:
@@ -98,3 +100,19 @@ You should see something like:
98100
></iframe>
99101
100102
which shows you the prepared system.
103+
104+
!!! info "System preparation parameters"
105+
Look at the [:material-page-next: reference documentation](../ref/complex.md#src.drug_discovery.complex.Complex.prepare) to understand parameters for system preparation.
106+
107+
108+
## Specifying a Client
109+
110+
A `Complex` can be configured with a [`DeepOriginClient`](../../platform/index.md) explicitly, using:
111+
112+
```{.python notest}
113+
sim = Complex.from_dir(..., client=client)
114+
```
115+
116+
## Reference
117+
118+
- [:material-page-next: Complex](../ref/complex.md)

docs/dd/how-to/ligands.md

Lines changed: 34 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -138,21 +138,9 @@ ligand = Ligand.from_rdkit_mol(
138138
)
139139
```
140140

141-
This is particularly useful when you're working with RDKit's molecular manipulation functions and want to convert the results into a Deep Origin Ligand object for further processing or visualization.
141+
This is particularly useful when you're working with RDKit's molecular manipulation functions and want to convert the results into a `Ligand` for further processing or visualization.
142142

143143

144-
The method will:
145-
146-
- Read the CSV file using pandas
147-
- Extract SMILES strings from the specified column
148-
- Create a Ligand instance for each valid SMILES
149-
- Store all other columns as properties in each Ligand instance
150-
- Skip any rows with empty or invalid SMILES strings
151-
152-
!!! note "Error Handling"
153-
The method will raise:
154-
- `FileNotFoundError` if the CSV file does not exist
155-
- `ValueError` if the specified SMILES column is not found in the CSV file
156144

157145
### From a CSV file
158146

@@ -167,13 +155,27 @@ ligands = LigandSet.from_csv(
167155
)
168156
```
169157

158+
159+
The method will:
160+
161+
- Read the CSV file using pandas
162+
- Extract SMILES strings from the specified column
163+
- Create a Ligand instance for each valid SMILES
164+
- Store all other columns as properties in each Ligand instance
165+
- Skip any rows with empty or invalid SMILES strings
166+
167+
!!! note "Error Handling"
168+
The method will raise:
169+
- `FileNotFoundError` if the CSV file does not exist
170+
- `ValueError` if the specified SMILES column is not found in the CSV file
171+
170172
### Filtering Top Poses
171173

172174
When working with docking results, you often have multiple poses for the same molecule. The `filter_top_poses()` method helps you select only the best pose for each unique molecule:
173175

174176
```{.python notest}
175177
176-
# assuming poses comes from protein.dock()
178+
# assuming poses comes from protein.dock() or Complex.docking.get_results()
177179
178180
# Filter to keep only the best pose per molecule (by binding energy)
179181
best_poses = poses.filter_top_poses()
@@ -217,29 +219,34 @@ A visualization similar to the following will be shown:
217219

218220
A `LigandSet` can be visualized using several different methods.
219221

220-
#### Table view (2D)
222+
#### Summary card
221223

222-
First, simply printing the `LigandSet` shows a table of ligands in the `LigandSet`:
224+
Simply inspecting the `LigandSet` object shows the following:
223225

224-
```python
225-
from deeporigin.drug_discovery import LigandSet
226+
```{.python notest}
227+
ligands
228+
```
226229

227-
smiles = {
228-
"C/C=C/Cn1cc(-c2cccc(C(=O)N(C)C)c2)c2cc[nH]c2c1=O",
229-
"C=CCCn1cc(-c2cccc(C(=O)N(C)C)c2)c2cc[nH]c2c1=O",
230-
}
231230

232-
ligands = LigandSet.from_smiles(smiles)
233-
ligands
231+
<div style='width: 500px; padding: 15px; border: 1px solid #ddd; border-radius: 6px; background-color: #f9f9f9;'><h3 style='margin-top: 0; color: #333;'>LigandSet with 8 ligands</h3><p style='margin: 8px 0;'><strong>8</strong> unique SMILES</p><p style='margin: 8px 0;'>Properties: initial_smiles, r_exp_dg</p><div style='margin-top: 12px; padding-top: 12px; border-top: 1px solid #ddd;'><p style='margin: 4px 0; font-size: 0.9em; color: #666;'><em>Use <code>.to_dataframe()</code> to convert to a dataframe, <code>.show_df()</code> to view dataframewith structures, or <code>.show()</code> for 3D visualization</em></p></div></div>
232+
233+
#### Table view (2D)
234+
235+
To view a dataframe containined rendered (2D) structures of ligands, use:
234236

237+
```python
238+
# for example
239+
from deeporigin.drug_discovery import LigandSet, DATA_DIR
240+
241+
ligands = LigandSet.from_sdf(DATA_DIR / "ligands" / "ligands-brd-all.sdf")
242+
ligands.show_df()
235243
```
236244

237245
!!! success "Expected Output"
238246

239247
![](./../../images/ligands.png)
240248

241249

242-
This table view is also available using `ligands.show_df`
243250

244251
#### Individual view (3D)
245252

@@ -255,12 +262,12 @@ ligands.show()
255262

256263
```
257264

258-
A visualization similar to this will be shown. Use the arrows to flip between ligands in the `LigandSet`.
265+
A visualization similar to this will be shown. Use the arrows to switch between Ligands in the `LigandSet`.
259266

260267
<iframe
261268
src="../../images/brd-3d.html"
262269
width="100%"
263-
height="600"
270+
height="610"
264271
style="border:none;"
265272
title="Visualization of ligands"
266273
></iframe>

docs/dd/how-to/proteins.md

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ A visualization such as this will be shown:
108108
<iframe
109109
src="../../images/1eby.html"
110110
width="100%"
111-
height="600"
111+
height="610"
112112
style="border:none;"
113113
title="Protein visualization"
114114
></iframe>
@@ -143,6 +143,9 @@ ligand = protein.extract_ligand()
143143

144144
### Loop modelling
145145

146+
!!! warning "Coming soon"
147+
Loop modelling functionality is under active development and will be available soon.
148+
146149
Missing information and gaps in the structure can be filled in using the Loop Modelling tool.
147150

148151
For example, this protein from the PDB has missing elements, as can be seen from the dashed lines below:
@@ -157,7 +160,7 @@ protein.show()
157160
<iframe
158161
src="../../images/5QSP.html"
159162
width="100%"
160-
height="600"
163+
height="610"
161164
style="border:none;"
162165
title="Protein visualization"
163166
></iframe>
@@ -316,7 +319,7 @@ chains_ab = protein.select_chains(['A', 'B'])
316319
1. Always visualize the structure before and after preparation to ensure the desired changes were made
317320
2. When working with metalloproteins, use `remove_hetatm()` with appropriate `keep_resnames` or `remove_metals` parameters
318321
3. For multi-chain proteins, consider selecting specific chains before preparation
319-
4. Save the prepared structure using `to_pdb()` if you need to use it later:
322+
4. Save the prepared structure using `to_pdb()` if you need to use it outside of Deep Origin APIs.
320323

321324
```{.python notest}
322325
# Save the prepared structure
@@ -332,7 +335,6 @@ protein.to_pdb("prepared_protein.pdb")
332335
protein = Protein.from_pdb_id("1EBY")
333336
protein.remove_water() # Remove water molecules
334337
protein.remove_hetatm(keep_resnames=['ZN']) # Keep important cofactors
335-
protein.to_pdb("docking_ready.pdb")
336338
```
337339

338340
### Working with Metalloproteins

docs/dd/ref/plots.md

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,74 @@ scatter(
6161
)
6262
```
6363

64+
### Saving Plot to HTML File
65+
66+
You can save the scatter plot to an HTML file instead of displaying it by providing the `output_file` parameter:
67+
68+
```python
69+
import numpy as np
70+
from deeporigin.plots import scatter
71+
72+
# Sample data
73+
x = np.array([1, 2, 3, 4, 5])
74+
y = np.array([2, 4, 6, 8, 10])
75+
smiles_list = [
76+
"CCO", # ethanol
77+
"CC(=O)O", # acetic acid
78+
"c1ccccc1", # benzene
79+
"CCN(CC)CC", # triethylamine
80+
"CC(C)O" # isopropanol
81+
]
82+
83+
# Save scatter plot to HTML file
84+
scatter(
85+
x=x,
86+
y=y,
87+
smiles_list=smiles_list,
88+
x_label="X Coordinate",
89+
y_label="Y Coordinate",
90+
title="Molecule Analysis Plot",
91+
output_file="scatter_plot.html"
92+
)
93+
```
94+
95+
When `output_file` is provided, the plot is saved as an interactive HTML file that can be opened in any web browser. The file includes all interactive features such as hover tooltips with molecule images.
96+
97+
### Setting Axis Limits
98+
99+
You can control the axis limits using individual `x_lim_min`, `x_lim_max`, `y_lim_min`, and `y_lim_max` parameters. This gives you fine-grained control - you can set just the minimum, just the maximum, or both:
100+
101+
```python
102+
import numpy as np
103+
from deeporigin.plots import scatter
104+
105+
# Sample data
106+
x = np.array([1, 2, 3, 4, 5])
107+
y = np.array([2, 4, 6, 8, 10])
108+
smiles_list = [
109+
"CCO", # ethanol
110+
"CC(=O)O", # acetic acid
111+
"c1ccccc1", # benzene
112+
"CCN(CC)CC", # triethylamine
113+
"CC(C)O" # isopropanol
114+
]
115+
116+
# Create scatter plot with custom axis limits
117+
scatter(
118+
x=x,
119+
y=y,
120+
smiles_list=smiles_list,
121+
x_label="X Coordinate",
122+
y_label="Y Coordinate",
123+
title="Molecule Analysis Plot",
124+
x_lim_min=0, # Set x-axis minimum to 0
125+
x_lim_max=6, # Set x-axis maximum to 6
126+
y_lim_max=12 # Set only y-axis maximum to 12 (min auto-scales)
127+
)
128+
```
129+
130+
Each limit parameter is optional and independent. If not provided, that limit will auto-scale based on the data range. This allows you to, for example, set only the maximum value for an axis while letting the minimum auto-scale.
131+
64132
## Features
65133

66134
- **Interactive Hover**: Hover over any point to see the molecular structure image

0 commit comments

Comments
 (0)