Skip to content

update wrapper to specify the html file paths for cluster HTML output - #395

Open
amyjaynethompson wants to merge 2 commits into
mainfrom
fix_multiplex_html_paths
Open

amyjaynethompson wants to merge 2 commits into
mainfrom
fix_multiplex_html_paths

Conversation

@amyjaynethompson

Copy link
Copy Markdown
Contributor

The xia2.multiplex html output files (xia2.multiplex.html and xia2.multiplex_clustering.html) contain within them a function that assembles a command that a user can copy-paste into a terminal to reprocess custom sub-groups. This happens when the user selects custom subgroups in either of these html files. The HTML derives this path from looking at the location of the file - this breaks down when using attachments on SynchWeb and the following results:
image
In xia2 PR #953 , a variable was added to this HTML file that could overwrite the logic and specify a custom file path. In this PR, the multiplex wrapper edits this variable to point to the data in the processed directory. This means that the user could interact with these files on SynchWeb while remotely connected to Diamond, and copy paste the file path for reprocessing.

Comment on lines +99 to +116
# Step 3.5: Ammend paths in HTML for synchweb interactivity

for attachment in attachments:
html_path = pathlib.Path(attachment["file_path"]) / attachment["file_name"]
# pipeline-final is in file_path, but we want the /processed for data processing
parts = list(html_path.parts)
if "pipeline-final" in parts:
parts.remove("pipeline-final")
desired_path = pathlib.Path(*parts)
if attachment["file_name"] == "xia2.multiplex.html":
path_to_insert = desired_path.parent / "xia2-multiplex-working.phil"
self.fix_paths_in_html_output(html_path, path_to_insert)
elif attachment["file_name"] == "xia2.multiplex_clustering.html":
path_to_insert = (
desired_path.parent.parent / "xia2-multiplex-working.phil"
)
self.fix_paths_in_html_output(html_path, path_to_insert)

@pblowey pblowey Oct 23, 2026 •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems to be a long-winded way of getting to a file path, which I think will always be results_directory / xia2-multiplex-working.phil

I think it would be better to just have some logic when you are constructing the attachments list in the first place to look out for the two html files of interest and fix the paths then using results_directory / xia2-multiplex-working.phil

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree it was a bit long-winded - have simplified significantly in the recent commit.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants