Skip to content

Commit 4c44d74

Browse files
Tweaks (#174)
* Dockerfile casing * Dockerfile casing * Dockerfile casing * Add a button to enable download of docking configurations * Add pocket center to the pocket properties * Add residues to the pocket details
1 parent 8cf36d1 commit 4c44d74

8 files changed

Lines changed: 39 additions & 9 deletions

File tree

administration/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# java-tools
33
#
44

5-
FROM debian:bookworm-20231009 as java-tools
5+
FROM debian:bookworm-20231009 AS java-tools
66

77
RUN apt-get update \
88
&& apt-get -y --no-install-recommends install openjdk-17-jdk

executor-docking/run_task.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -194,6 +194,9 @@ def execute_directory_task(docking_directory: str, taskId: int):
194194
stream.write(result_json)
195195
finally:
196196
stream.flush()
197+
198+
# copy the docking parameters file to the public directory
199+
shutil.copy(os.path.join(docking_directory, str(taskId), "docking_parameters.json"), os.path.join(docking_directory, str(taskId), "public", "docking_parameters.json"))
197200

198201
# update the status file, reload it first to make sure we don't overwrite any changes
199202
status = _load_json(status_file)

executor-p2rank/Dockerfile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# java-tools
33
#
44

5-
FROM debian:bookworm-20231009 as java-tools
5+
FROM debian:bookworm-20231009 AS java-tools
66

77
RUN apt-get update \
88
&& apt-get -y --no-install-recommends install openjdk-17-jdk
@@ -21,7 +21,7 @@ RUN chmod +x ./gradlew && ./gradlew installDist \
2121
# * /opt/alignment-based-conservation-dependencies
2222
#
2323

24-
FROM debian:bookworm-20231009 as alignment-based-conservation
24+
FROM debian:bookworm-20231009 AS alignment-based-conservation
2525

2626
RUN apt-get update \
2727
&& apt-get -y --no-install-recommends install \
@@ -67,7 +67,7 @@ RUN chmod a+x /opt/alignment-based-conservation/conservation_alignment_based.py
6767
# * /opt/hmm-based-conservation-dependencies
6868
#
6969

70-
FROM debian:bookworm-20231009 as hmm-based-conservation
70+
FROM debian:bookworm-20231009 AS hmm-based-conservation
7171

7272
RUN apt-get update \
7373
&& apt-get -y --no-install-recommends install \

frontend/client/viewer/components/data-table-row-details.tsx

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,14 @@ export default function DataTableRowDetails(props: { pocket: PocketData; setTab:
3939
name: "Number of residues",
4040
value: pocket.residues.length
4141
},
42+
{
43+
name: "Pocket center",
44+
value: `(${pocket.center[0]}, ${pocket.center[1]}, ${pocket.center[2]})`
45+
},
46+
{
47+
name: "Residues",
48+
value: pocket.residues.join(", ")
49+
},
4250
];
4351

4452
if (pocket.avgAlphaFold) shownProperties.push({

frontend/client/visualize/docking/main.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -218,10 +218,11 @@ async function createMolstarViewer() {
218218
export async function getDockingTaskContent(id: string, database: string, hash: string, structureName: string): Promise<DockingTaskProps> {
219219
const apiEndpoint = getApiEndpoint(database, id, "docking");
220220
const response = await fetch(`${apiEndpoint}/${hash}/public/out_vina.pdbqt`).then(res => res.text()).catch(err => console.log(err));
221+
const dockingConfigurationURL = `${apiEndpoint}/${hash}/public/docking_parameters.json`;
221222

222223
if (response === undefined) {
223-
return { ligandPDBQT: "Error", hash: hash, id: id, database: database, structureName: structureName };
224+
return { ligandPDBQT: "Error", hash: hash, id: id, database: database, structureName: structureName, dockingConfigurationURL: dockingConfigurationURL };
224225
}
225226

226-
return { ligandPDBQT: response, hash: hash, id: id, database: database, structureName: structureName };
227+
return { ligandPDBQT: response, hash: hash, id: id, database: database, structureName: structureName, dockingConfigurationURL: dockingConfigurationURL };
227228
}

frontend/client/visualize/docking/right-panel.tsx

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ function Row(props: { row: Model; models: number[]; handleClick: (models: number
6565
}
6666

6767
export function DockingTaskRightPanel({ pdbqtModels, dp, plugin, ligandRepresentations }: { pdbqtModels: Model[], dp: DockingTaskProps, plugin: PluginUIContext, ligandRepresentations: StateObjectSelector[]; }) {
68-
const handleDownload = () => {
68+
const handleResultDownload = () => {
6969
const element = document.createElement("a");
7070
const file = new Blob([dp.ligandPDBQT], { type: 'text/plain' });
7171
element.href = URL.createObjectURL(file);
@@ -74,6 +74,21 @@ export function DockingTaskRightPanel({ pdbqtModels, dp, plugin, ligandRepresent
7474
element.click();
7575
};
7676

77+
const handleConfigurationDownload = async () => {
78+
await fetch(dp.dockingConfigurationURL)
79+
.then(response => response.text())
80+
.then(content => {
81+
const element = document.createElement("a");
82+
const file = new Blob([content], { type: 'text/plain' });
83+
element.href = URL.createObjectURL(file);
84+
element.download = `docking-configuration-${new Date().toISOString()}.json`;
85+
document.body.appendChild(element);
86+
element.click();
87+
document.body.removeChild(element);
88+
})
89+
.catch(error => console.error("Error downloading docking configuration:", error));
90+
};
91+
7792
const [models, setModels] = React.useState<number[]>([1]);
7893

7994
const handleClick = (model: number) => {
@@ -148,7 +163,9 @@ export function DockingTaskRightPanel({ pdbqtModels, dp, plugin, ligandRepresent
148163
</TableBody>
149164
</Table>
150165
</TableContainer>
151-
<Button style={{ marginTop: "1em" }} variant="contained" onClick={handleDownload}>Download results</Button>
166+
<Button style={{ marginTop: "1em" }} variant="contained" onClick={handleConfigurationDownload}>Download docking configuration</Button>
167+
&nbsp;
168+
<Button style={{ marginTop: "1em" }} variant="contained" onClick={handleResultDownload}>Download results</Button>
152169
</>
153170
);
154171
}

frontend/client/visualize/docking/types.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ export interface DockingTaskProps {
44
id: string;
55
hash: string;
66
structureName: string;
7+
dockingConfigurationURL: string;
78
}
89

910
export type Hetatm = {

gateway/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ RUN npm run build
2525
#
2626
# Prepare passwords.
2727
#
28-
FROM debian:bookworm-20231009 as htpasswd
28+
FROM debian:bookworm-20231009 AS htpasswd
2929

3030
RUN apt-get update && apt-get -y install apache2-utils
3131

0 commit comments

Comments
 (0)