Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
295 commits
Select commit Hold shift + click to select a range
e97884c
feat: add calc method to crosslinking validation step
AnnaPolensky Jan 26, 2026
9a5fca7
feat: add lower bound on allowed deviation of crosslink length
AnnaPolensky Jan 27, 2026
e9d2e13
feat: Add a new tab to settings where one can upload and delete predi…
Elena-kal Jan 28, 2026
f7fe67d
Implement display of failed rows (Issue #194)
NeleRiediger Jan 28, 2026
f4fdb2a
test: add tests for crosslinking validation based on Angstrom deviation
AnnaPolensky Jan 28, 2026
5e1a4ee
refactor: extract determination of relevant atom of amino acid into p…
AnnaPolensky Jan 28, 2026
97aa58a
refactor: only keep rows in result df which contain crosslinks that w…
AnnaPolensky Jan 28, 2026
659d8d1
fix: spelling mistake
AnnaPolensky Jan 28, 2026
bd205ee
fix: broken tests
AnnaPolensky Jan 28, 2026
cf17f05
fix: revert unnecessary changes to steps.py
AnnaPolensky Jan 29, 2026
32d9e34
chore: update docstrings
AnnaPolensky Jan 29, 2026
b57ced3
add text field for organism id and validation of those inputs
NeleRiediger Jan 29, 2026
5f31900
refactor uniprot batch request to meet the changed requirements
NeleRiediger Jan 29, 2026
dc62444
refactor some variable names, update docstrings and make types explicit
NeleRiediger Jan 29, 2026
0645662
format backend code with black
NeleRiediger Jan 29, 2026
5b192cd
feat: Add warning when protein structure is replaced in Node, replace…
Elena-kal Jan 30, 2026
0f4f485
fix: Delete unused svg
Elena-kal Jan 30, 2026
f77958a
update tests
NeleRiediger Jan 30, 2026
c491226
refactor: address code review feedback (mostly naming)
AnnaPolensky Jan 31, 2026
917df71
refactor: address code review feedback (mostly naming)
AnnaPolensky Jan 31, 2026
9c9a6f1
chore: add more docstrings
AnnaPolensky Jan 31, 2026
2709474
fix: fix broken tests
AnnaPolensky Jan 31, 2026
3ff37f6
test: add more tests for crosslinking validation
AnnaPolensky Jan 31, 2026
cfe2ef8
fix: Change how correct file upload is enforced, add an info text if …
Elena-kal Feb 1, 2026
69c8e47
fix: format with black
Elena-kal Feb 1, 2026
72d2f04
refactor: address code review feedback, especially use np.linalg.norm…
AnnaPolensky Feb 2, 2026
91f834c
fix: check that expected file with expected columns exist in get and …
Elena-kal Feb 2, 2026
e43e3a0
Merge pull request #212 from cschlaffner/191-validate-cross-links-bas…
AnnaPolensky Feb 2, 2026
558e0fb
Merge pull request #216 from cschlaffner/187-protein-structures-in-se…
Elena-kal Feb 2, 2026
bc66bfd
fix: wrong output key
AnnaPolensky Feb 2, 2026
3b668c3
refactor: remove redundant and unnecessary testing
NeleRiediger Feb 2, 2026
b941917
fix: .xlsx files can be imported without entering an organism id
NeleRiediger Feb 2, 2026
a5ec3b2
add more explicit error handling for better usability
NeleRiediger Feb 2, 2026
2c6be8c
refactor: change crosslinking spelling in importing step display
NeleRiediger Feb 2, 2026
f5d63f0
refactor: introduce enums for error codes and loookup modes
NeleRiediger Feb 2, 2026
16fb613
format backend code with black
NeleRiediger Feb 2, 2026
d27ea0a
fix icon prot_structure.svg color
3dot141592 Feb 3, 2026
1fdcf0e
feat: add new importing step that loads data from disk into dataframe…
Elena-kal Feb 3, 2026
573f448
feat: add tests for get_all_available_entry_ids and get_prot_structur…
Elena-kal Feb 3, 2026
914ce70
fix: fix cif data in tests
Elena-kal Feb 3, 2026
2f35361
Merge branch 'crosslinking' into refactor-crosslinking-import
NeleRiediger Feb 3, 2026
aba6504
Merge pull request #214 from cschlaffner/refactor-crosslinking-import
NeleRiediger Feb 3, 2026
a88ece2
feat: import crosslinking files with multiple organism ids
NeleRiediger Feb 4, 2026
00c33ab
fix: change tests for changed code and add some new testing
NeleRiediger Feb 4, 2026
68d5024
fix: rename variables and classes, add tests, improve file handling
Elena-kal Feb 4, 2026
7e4d555
feat: add success message
Elena-kal Feb 4, 2026
ab9c3ef
fix: format with black
Elena-kal Feb 5, 2026
4aac214
Merge branch 'crosslinking' into 230-importing-step-load-from-disk
Elena-kal Feb 5, 2026
9c75f77
Merge pull request #234 from cschlaffner/230-importing-step-load-from…
Elena-kal Feb 5, 2026
0b27f50
Merge branch 'crosslinking' into 225-add-success-message-for-af-prot-…
Elena-kal Feb 5, 2026
fe6f505
Merge pull request #237 from cschlaffner/225-add-success-message-for-…
Elena-kal Feb 5, 2026
cbfbfce
Changes by elenakalbitzer
AnnaPolensky Feb 5, 2026
008e12e
refactor: remove usage of AlphafoldFetch in crosslinking validation
AnnaPolensky Feb 5, 2026
4d8fa54
feat: add 2 histograms to crosslinking validation with angstrom devia…
AnnaPolensky Feb 7, 2026
01971a0
refactor: remove peptide_position1 and peptide_postion2 (regarding cr…
AnnaPolensky Feb 7, 2026
5f61a3f
feat: duplicate crosslink rows when peptide matches several positions…
AnnaPolensky Feb 7, 2026
d2f2448
test: add tests for duplicating crosslink rows when peptide matches s…
AnnaPolensky Feb 8, 2026
ad16167
fix: fix bug where duplicated rows would get deleted from the crossli…
AnnaPolensky Feb 8, 2026
2564302
chore: add docstring
AnnaPolensky Feb 8, 2026
8f2c3b1
Merge pull request #241 from cschlaffner/220-refactor-alphafold-input…
Elena-kal Feb 9, 2026
9926a6b
add clarification if organism id is actually required
NeleRiediger Feb 9, 2026
c11cbe7
add more precise error messages for organism id validation
NeleRiediger Feb 9, 2026
1a44548
format backend code with black
NeleRiediger Feb 9, 2026
30758d2
fix tests
NeleRiediger Feb 9, 2026
15ce74d
style: fix typos, rename variable, improve error message wording
AnnaPolensky Feb 9, 2026
a8c3f33
fix: suggestion form review to check if file suffix is lower case
NeleRiediger Feb 10, 2026
9615c06
Merge branch '235-multiple-organism-id-input-for-crosslinking-import'…
NeleRiediger Feb 10, 2026
d38f860
Resolve merge conflict
Elena-kal Feb 11, 2026
9f913a6
Add newline
Elena-kal Feb 11, 2026
9df25e0
Merge pull request #252 from cschlaffner/dev
Elena-kal Feb 11, 2026
9a4a600
feat: one histogram for each crosslinker
AnnaPolensky Feb 12, 2026
6c8edd2
merge: merge crosslinking into 232-crosslinker-position-validation
AnnaPolensky Feb 12, 2026
33b51db
fix: broken tests and address code review feedback
AnnaPolensky Feb 12, 2026
0f56dde
fix: fix broken tests
AnnaPolensky Feb 12, 2026
c5be8cf
feat: add upload of multimer structure predictions and refactor of mo…
Elena-kal Feb 12, 2026
2344a65
fix: add new import step into get_all_possible_step_names test
Elena-kal Feb 12, 2026
bac3314
Merge pull request #245 from cschlaffner/232-crosslinker-position-val…
AnnaPolensky Feb 13, 2026
9ca18c2
feat: add upload and delete page in settings for multimers and update…
Elena-kal Feb 13, 2026
19de76e
feat: add import from disk step
Elena-kal Feb 14, 2026
355e4b9
fix: add tests and fix bugs
Elena-kal Feb 14, 2026
4f3cb9b
fix: format with black
Elena-kal Feb 14, 2026
4be236f
fix: add doc strings
Elena-kal Feb 14, 2026
b279ce8
feat: add vertical lines for crosslinker length and accepted deviatio…
AnnaPolensky Feb 15, 2026
87c8b18
test: add tests for testing the plot method of crosslinking validatio…
AnnaPolensky Feb 15, 2026
029ea1a
test: add tests for testing the create_histograms with one_bin_per_in…
AnnaPolensky Feb 15, 2026
ab7ce59
merge: merge crosslinking into 233-density-plot-or-histogram-for-cros…
AnnaPolensky Feb 15, 2026
c3a2727
refactor: move add_vertical_line_with_annotation_in_legend to plots.py
AnnaPolensky Feb 15, 2026
bd2ac89
test: fix tests
AnnaPolensky Feb 15, 2026
31beb7c
chore: move tests to right file
AnnaPolensky Feb 15, 2026
cb608b6
feat: add step for generating a json alphafold multimer query
AnnaPolensky Feb 16, 2026
32c657f
feat: add download tab to outputs
AnnaPolensky Feb 16, 2026
aa0edfa
fix: minor changes from review
Elena-kal Feb 16, 2026
81d1741
style: address code review feedback
AnnaPolensky Feb 16, 2026
62a2cd3
fix: update test
Elena-kal Feb 16, 2026
aa33562
fix: add some explanations for entry fields
Elena-kal Feb 17, 2026
ad1f0dc
fix: entry ids are treated case insensitively and according warnings …
Elena-kal Feb 17, 2026
c532c3e
fix: minor bug
Elena-kal Feb 17, 2026
25bb9a4
Merge pull request #255 from cschlaffner/253-multimer-prediction-upload
Elena-kal Feb 17, 2026
e706ea4
fix: refactor naming to make it more general for multimer structure use
Elena-kal Feb 22, 2026
baa7434
feat: add validation for multimer step (with a not working calc and p…
Elena-kal Feb 22, 2026
d90539c
fix: prevent visibility toggling by legend clicks in histogram
AnnaPolensky Feb 27, 2026
cfa88ab
merge: merge crosslinking into 263-step-for-alphafold-multimer-query-…
AnnaPolensky Feb 27, 2026
626729e
style: run black
AnnaPolensky Feb 27, 2026
c17f312
Merge pull request #256 from cschlaffner/233-density-plot-or-histogra…
AnnaPolensky Feb 27, 2026
4b64570
feat: add validation logic for multimer structures
Elena-kal Feb 27, 2026
fe19dc6
fix: fix broken all_steps after merge
AnnaPolensky Mar 1, 2026
158f134
feat: add and adjust tests
Elena-kal Mar 1, 2026
ce49260
feat: add download_methods
AnnaPolensky Mar 1, 2026
237f903
feat: add download button for generated alphafold json queries
AnnaPolensky Mar 1, 2026
1268988
refactor: tidy up code
AnnaPolensky Mar 2, 2026
081a912
test: add tests for alphafold multimer query json generation
AnnaPolensky Mar 2, 2026
0a817b5
feat: make sure that at least 2 protein ids or 2 copies of one protei…
AnnaPolensky Mar 2, 2026
d791ed8
feat: add input to use a specific seed and allow not only space- but …
AnnaPolensky Mar 2, 2026
068329e
fix: fix broken test
AnnaPolensky Mar 2, 2026
ed7bb2a
fix: also accept input separated with comma and space, add success me…
AnnaPolensky Mar 3, 2026
288e01a
feat: add input field for file name of prediction query file
AnnaPolensky Mar 3, 2026
2cdf9dd
fix: step only turns green if file was generated
AnnaPolensky Mar 3, 2026
c043e76
fix: address code review feedback
AnnaPolensky Mar 3, 2026
dedfba1
refactor: rename alphafold-multimer-query-json-generation to alphafol…
AnnaPolensky Mar 4, 2026
4435de6
Merge branch 'crosslinking' into 267-cl-validation-for-multimer-struc…
Elena-kal Mar 4, 2026
6ecc430
fix: format with black
Elena-kal Mar 4, 2026
6cb9779
fix: changes proposed by reviews amd fixed a few tests
Elena-kal Mar 4, 2026
e7c619a
fix: fixes wrong variable naming
Elena-kal Mar 4, 2026
b8726fc
fix: renamed amino_acid_sequence_df
Elena-kal Mar 4, 2026
09d50da
fix: fix type bug and refactor a bit
Elena-kal Mar 6, 2026
fc7f7a7
fix: function naming
Elena-kal Mar 6, 2026
8d7e241
fix: improve doc string
Elena-kal Mar 6, 2026
e590a08
fix typo
Elena-kal Mar 9, 2026
3d1bf6c
Merge pull request #270 from cschlaffner/267-cl-validation-for-multim…
Elena-kal Mar 9, 2026
36eb3cc
Merge branch '179-refactor-step-to-allow-selection-of-step-to-retriev…
AnnaPolensky Mar 24, 2026
23ce0c3
feat: Add link_type to checked_crosslinks_df and show link_type in pl…
Elena-kal Mar 25, 2026
585a48f
feat: add tests for new column and plot label change
Elena-kal Mar 25, 2026
bacb0c2
fix: adapt crosslinking branch to refactoring from 179
AnnaPolensky Mar 25, 2026
149a7bc
Merge branch '179-refactor-step-to-allow-selection-of-step-to-retriev…
AnnaPolensky Mar 25, 2026
89e030b
merge: merge crosslinking into 263
AnnaPolensky Mar 25, 2026
290b2a1
Merge branch 'crosslinking' into 281-intra-inter-labels
Elena-kal Mar 26, 2026
37c9630
Change metadata_df of predicted structure to structure_metadata_df
Elena-kal Mar 27, 2026
1f3f162
Change metadata_df naming in tests
Elena-kal Mar 28, 2026
98ef809
fix: format with black
Elena-kal Mar 28, 2026
d14e2c0
fix test
Elena-kal Mar 29, 2026
4d1c92a
fix test 2
Elena-kal Mar 29, 2026
e494242
refactor: add broken refactoring of download outputs
AnnaPolensky Mar 30, 2026
a0c8644
refactor: add working refactoring of download outputs
AnnaPolensky Mar 30, 2026
84ff4f8
refactor: add useCertainStepOutputs hook
AnnaPolensky Mar 30, 2026
1fdd897
refactor: remove 'any' type hint
AnnaPolensky Mar 30, 2026
464da38
fix: fix broken tests
AnnaPolensky Mar 30, 2026
a6e791f
style: remove unused parts of the first downloads implementation
AnnaPolensky Mar 30, 2026
79a1059
style: remove unused parts of the first downloads implementation - pa…
AnnaPolensky Mar 30, 2026
de2604f
chore: fix docstring
AnnaPolensky Mar 31, 2026
af0199d
Merge pull request #271 from cschlaffner/263-step-for-alphafold-multi…
AnnaPolensky Mar 31, 2026
97a39a0
fix: fix broken change between different output tabs
AnnaPolensky Apr 1, 2026
c584708
Merge pull request #322 from cschlaffner/316-rename-metadata-df-of-st…
Elena-kal Apr 3, 2026
a4adc07
fix: first upload in settings when alphafold folder does not exist yet
Elena-kal Apr 10, 2026
7e9b5e1
fix: import via settings for multimers
Elena-kal Apr 10, 2026
467b196
Merge pull request #323 from cschlaffner/281-intra-inter-labels
Elena-kal Apr 10, 2026
51669f0
add workflow to gitignore
Elena-kal Apr 11, 2026
cc307f2
change order of workflow in git ignore
Elena-kal Apr 11, 2026
c47552a
add cl monomer workflow
Elena-kal Apr 11, 2026
35aed9e
Merge pull request #343 from cschlaffner/325-workflow-template-for-cl…
Elena-kal Apr 15, 2026
f981762
feat: account for chain id and protein id in crosslinking validation
Elena-kal Apr 20, 2026
1d7e940
feat: add job request json upload to all multimer imports
Elena-kal Apr 20, 2026
54e57f6
fix: import of job request json file
Elena-kal Apr 20, 2026
4063321
update tests for job request json upload
Elena-kal Apr 20, 2026
24d3779
fix multimer validation step and refactor
Elena-kal Apr 21, 2026
d633530
update and add tests
Elena-kal Apr 21, 2026
214adba
fix two bugs and the tests
Elena-kal Apr 21, 2026
0bfe813
feat: add first draft for visualization (#268)
NeleRiediger Apr 21, 2026
f7ce624
format with black
Elena-kal Apr 21, 2026
729550e
fix bug regarding panda types
Elena-kal Apr 21, 2026
495f188
add missing CL Icons
3dot141592 Apr 21, 2026
dc0fb58
fix bug regarding chain mapping
Elena-kal Apr 24, 2026
4a221b9
Merge branch 'crosslinking' into 351-correct-multimer-validation
Elena-kal Apr 24, 2026
f3bd717
fix tests and chain ids naming in visualization
Elena-kal Apr 24, 2026
c740b27
format with black
Elena-kal Apr 24, 2026
b88b58d
fix multimer import test
Elena-kal Apr 24, 2026
64d2fba
Merge pull request #357 from cschlaffner/351-correct-multimer-validation
Elena-kal Apr 24, 2026
f13f558
Merge pull request #358 from cschlaffner/326-CL-input-handles
Elena-kal Apr 24, 2026
ca6cb9c
Merge pull request #370 from cschlaffner/dev
Elena-kal Apr 24, 2026
e6c7f60
feat: show whole plot title and add padding to show proper axes labeling
AnnaPolensky Apr 26, 2026
9f6f119
Fix import
3dot141592 Apr 27, 2026
d7d09e7
Merge branch 'crosslinking' into crosslinking-import-runner-fix
Elena-kal Apr 27, 2026
930d2a2
Merge pull request #379 from cschlaffner/crosslinking-import-runner-fix
Elena-kal Apr 27, 2026
301491a
fix: show tick for crosslinker length and allowed deviation
AnnaPolensky Apr 27, 2026
5a96fb4
fix: fix wrong use of ranges for 2std cl diagram
AnnaPolensky Apr 27, 2026
8528383
fix: change modify-form to reset ALL input fields after successful ca…
NeleRiediger Apr 29, 2026
69ed273
Merge pull request #387 from cschlaffner/381-fix-selected-files-reset…
NeleRiediger Apr 29, 2026
ce08a47
Add accepted file endings in forms for cl imports
Elena-kal Apr 29, 2026
b4ba145
feat: add broken histogram with partly logarithmic scaling for crossl…
AnnaPolensky Apr 30, 2026
8cd789b
remove unnecessary repetitive add_field function
Elena-kal Apr 30, 2026
b08f957
Add default value handling for cl and a defaults_operator for future …
Elena-kal Apr 30, 2026
5be6f23
fix bug in setting of cl defaults
Elena-kal Apr 30, 2026
570ff5b
add CL icon for cl default settings
Elena-kal Apr 30, 2026
141ccb4
add tests for cl default handling
Elena-kal Apr 30, 2026
3e30b02
(AI) rework histogram for proper log scale + manual creation using ba…
jorisfu Apr 30, 2026
41846da
chore: minor code cleanup and colours
jorisfu May 1, 2026
ce45353
fix: fix cl plot function so that it also works if all cls are valid …
AnnaPolensky May 4, 2026
f4b2deb
chore: add/update docstrings of cl validation diagrams
AnnaPolensky May 4, 2026
9351aee
chore: small code cleanup
AnnaPolensky May 4, 2026
bcfdcb3
fix: fix cl validation plot tests
AnnaPolensky May 4, 2026
1785ff4
refactor: increase width of plots and rename "(in)valid CLs" to "pred…
AnnaPolensky May 4, 2026
eb93a27
chore: clean float format
jorisfu May 4, 2026
5f5a40e
format
Elena-kal May 4, 2026
185bb51
format
Elena-kal May 4, 2026
69cd20e
Adjust handling of CL defaults according to review
Elena-kal May 4, 2026
9516ac4
Merge pull request #389 from cschlaffner/388-file-ending-specified-fo…
Elena-kal May 5, 2026
f91c97e
feat: overwrite default labels with crosslinker description and add l…
NeleRiediger May 5, 2026
0467dfa
fix: handle x < 0 split case
jorisfu May 5, 2026
b4e0b80
fix: spelling
jorisfu May 5, 2026
bea130b
revert dockerfile change
jorisfu May 5, 2026
2c3b130
fix: select correct crosslinker group for label based on both connect…
NeleRiediger May 5, 2026
6fa83f3
refactor: change spelling to 'crosslink...' everywhere
NeleRiediger May 5, 2026
3bf42ce
fix: backend formatting
NeleRiediger May 5, 2026
429612b
fix bug which prevents showing predictions in tables in frontend
Elena-kal May 6, 2026
7fd00cd
refactor: update x-axis annotation and add vertical line to right sub…
AnnaPolensky May 6, 2026
9a3cede
chore: run black and add comments
AnnaPolensky May 6, 2026
4c43e8b
Merge remote-tracking branch 'origin/dev' into crosslinking
tE3m May 7, 2026
5ecce65
fix tests
Elena-kal May 7, 2026
ba3e4e3
fix crosslink spelling
Elena-kal May 7, 2026
af1778a
fix update bug
Elena-kal May 7, 2026
ec85ed2
format
Elena-kal May 7, 2026
0a49b39
Merge pull request #402 from cschlaffner/401-fix-crosslinking-spelling
NeleRiediger May 7, 2026
01b0e0e
feat: add crosslinker colors to settings
NeleRiediger May 11, 2026
f484e1b
fix: fix reset to default colors
NeleRiediger May 11, 2026
5349900
feat: add icon to new settings tab
NeleRiediger May 11, 2026
91e7244
fix bugs pointed out in review
Elena-kal May 13, 2026
8418466
add required to uniprot ids field
Elena-kal May 13, 2026
f126c7f
Merge pull request #396 from cschlaffner/376-default-values-for-cl-va…
Elena-kal May 13, 2026
3902228
merge: merge crosslinking into 371
AnnaPolensky May 14, 2026
f0cce1d
Merge pull request #395 from cschlaffner/371-bug-fix-display-of-verti…
AnnaPolensky May 14, 2026
73c1438
fix: fix frontend crash after alphafold query generation
AnnaPolensky May 14, 2026
efdd788
fix: fix broken test due to file name change of downloadable jsons
AnnaPolensky May 14, 2026
aead6b4
fix: minor changes because of linter warnings
NeleRiediger May 18, 2026
1ea8216
Merge pull request #400 from cschlaffner/394-add-descriptions-for-cro…
NeleRiediger May 18, 2026
f01dac1
fix: user-facing strings
NeleRiediger May 18, 2026
cf0f1ac
fix: rebase and close open ends
NeleRiediger May 18, 2026
1253dbe
Merge pull request #413 from cschlaffner/399-selectable-crosslinker-c…
NeleRiediger May 18, 2026
784b777
fix: edit svg to take current color
NeleRiediger May 18, 2026
6ccf351
Merge pull request #425 from cschlaffner/415-fix-icon-of-cl-default-s…
NeleRiediger May 19, 2026
3e8802b
chore: fix typo in query generation form
AnnaPolensky May 19, 2026
1026359
Merge pull request #421 from cschlaffner/409-bug-fix-broken-alphafold…
AnnaPolensky May 19, 2026
4e45ced
fix: fix failing test (hopefully)
NeleRiediger May 19, 2026
3d7aeb2
Merge pull request #428 from cschlaffner/427-fix-uniprot-test
NeleRiediger May 19, 2026
3a70a5c
Merge pull request #410 from cschlaffner/403-fix-show-predictions-wit…
Elena-kal May 20, 2026
fab59c9
fix: matplotlib images are loaded again in the frontend
AnnaPolensky May 27, 2026
d3cde75
Merge pull request #442 from cschlaffner/bug-png-display
AnnaPolensky May 27, 2026
f6b2be0
404 Extend CL validation and imports (#423)
jorisfu May 28, 2026
5f8afd4
fix spelling of cross-link
Elena-kal May 28, 2026
6e99e50
Merge remote-tracking branch 'origin/dev' into crosslinking
tE3m May 28, 2026
1eb2c9b
(incomplete) begin work on fix
jorisfu May 29, 2026
841e64a
(AI) fix: filtering/sorting not working and proper fallback logic
jorisfu May 29, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions backend/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
!user_data/workflows/only_import.yaml
!user_data/workflows/only_import_and_filter_proteins.yaml
!user_data/workflows/standard.yaml
!user_data/workflows/cl_monomer.yaml
!user_data/workflows/.test-run-empty.yaml
!user_data/example_dataset

Expand Down
65 changes: 65 additions & 0 deletions backend/main/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,16 @@
path("api/save_workflow/", views.save_workflow, name="save_workflow"),
path("api/get_step_form/", views.get_step_form, name="get_step_form"),
path("api/get_step_plots/", views.get_step_plots, name="get_step_plots"),
path(
"api/get_step_visualizations/",
views.get_step_visualizations,
name="get_step_visualizations",
),
path(
"api/get_downloads_from_step/",
views.get_downloads_from_step,
name="get_downloads_from_step",
),
path(
"api/get_current_step_output_labels/",
views.get_current_step_output_labels,
Expand Down Expand Up @@ -76,6 +86,61 @@
path("api/get_databases", views_settings.get_databases, name="get_databases"),
path("api/upload_database", views_settings.database_upload, name="database_upload"),
path("api/delete_database", views_settings.database_delete, name="database_delete"),
path(
"api/get_monomer_structure",
views_settings.get_monomer_structure,
name="get_monomer_structure",
),
path(
"api/upload_monomer_structure",
views_settings.upload_monomer_structure,
name="upload_monomer_structure",
),
path(
"api/delete_monomer_structure",
views_settings.delete_monomer_structure,
name="delete_monomer_structure",
),
path(
"api/get_multimer_structure",
views_settings.get_multimer_structure,
name="get_multimer_structure",
),
path(
"api/upload_multimer_structure",
views_settings.upload_multimer_structure,
name="upload_multimer_structure",
),
path(
"api/delete_multimer_structure",
views_settings.delete_multimer_structure,
name="delete_multimer_structure",
),
path(
"api/get_cl_defaults",
views_settings.get_cl_defaults,
name="get_cl_defaults",
),
path(
"api/update_cl_default",
views_settings.update_cl_default,
name="update_cl_default",
),
path(
"api/delete_cl_default",
views_settings.delete_cl_default,
name="delete_cl_default",
),
path(
"api/get_cl_colors",
views_settings.get_cl_colors,
name="get_cl_colors",
),
path(
"api/update_cl_colors",
views_settings.update_cl_colors,
name="update_cl_colors",
),
path(
"api/load_ptm_settings",
views_settings.load_ptm_settings,
Expand Down
70 changes: 69 additions & 1 deletion backend/main/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import traceback
from zipfile import ZipFile
import re
import traceback
import logging

from plotly.io import to_json
Expand Down Expand Up @@ -41,6 +42,7 @@
parameters_from_post,
sanitize_name,
_dataframe_as_datagrid_rows,
create_visualization,
)
from backend.protzilla.all_steps import get_all_possible_steps

Expand Down Expand Up @@ -686,6 +688,70 @@ def get_step_plots(request):
)


def get_downloads_from_step(request: HttpRequest):
if request.method != "POST":
return JsonResponse(
{"success": False, "message": "Invalid request method"}, status=405
)

data = json.loads(request.body)
run_name = data.get("run_name")
step_id = data.get("step_id")
output_key = data.get("output_key")

run = Run(run_name)
step = run.steps.get_step_by_id(step_id)
downloads = step.output.get(output_key)
if downloads is None:
downloads = {}
if not isinstance(downloads, dict):
return JsonResponse(
{
"success": False,
"message": f"Requested output must be dict object, is {str(type(downloads))}",
},
status=405,
)
return JsonResponse(
{
"success": True,
"message": "Got the available download(s) for the step",
"data": {"json_downloads": downloads},
}
)


def get_step_visualizations(request):
if request.method == "POST":
data = json.loads(request.body)
run_name = data.get("run_name")
step_id = data.get("step_id")
output_key = data.get("output_key")

run = Run(run_name)
step = run.steps.get_step_by_id(step_id)
visualization_dict = step.output.get(output_key)
if visualization_dict is None:
return JsonResponse(
{
"success": False,
"message": "Got no available visualization for the step",
"data": {},
}
)
return JsonResponse(
{
"success": True,
"message": "Got the available visualization for the step",
"data": create_visualization(**visualization_dict),
}
)
else:
return JsonResponse(
{"success": False, "message": "Invalid request method"}, status=405
)


def get_png_from_step(request: HttpRequest):
"""
API call. Returns a base64-encoded PNG of a step output to the front-end
Expand Down Expand Up @@ -713,7 +779,9 @@ def get_png_from_step(request: HttpRequest):
)

content = output.decode("utf-8")
return JsonResponse({"success": True, "message": "OK", "data": content})
return JsonResponse(
{"success": True, "message": "OK", "data": {"base64image": content}}
)


def get_current_step_table_data(request):
Expand Down
128 changes: 127 additions & 1 deletion backend/main/views_helper.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import re
from pathlib import Path
from typing import Any

import numpy as np
import pandas as pd
Expand Down Expand Up @@ -203,3 +202,130 @@ def _dataframe_as_datagrid_rows(_data: pd.DataFrame) -> list[dict] | None:
return cleaned_data.to_dict(orient="records")
else:
return None


# ------------------------- helper for get_step_visualization: -------------------------


def create_visualization(
cif_df: pd.DataFrame,
structure_entry_id: str,
crosslinking_df: pd.DataFrame | None = None,
) -> dict:
"""
Create visualization data, by packaging a mmCIF string (converted from a CIF DataFrame) with its structure entry ID.
Optionally include crosslinks.

:param cif_df: DataFrame containing mmCIF atom_site information.
:param structure_entry_id: Protein identifier to include in the mmCIF header.
:param crosslinking_df: Optional DataFrame containing crosslink positions.
:return: Dictionary containing:
- "structureEntryId" (str)
- "cifString" (str)
- "crosslinks" (optional, list of dicts)
"""
try:
cif_string = convert_cif_df_to_mmcif_for_visualization(
cif_df, structure_entry_id
)
except (ValueError, TypeError):
cif_string = ""

result = {"structureEntryId": structure_entry_id, "cifString": cif_string}

if crosslinking_df is not None:
result["crosslinks"] = extract_relevant_crosslink_information(crosslinking_df)

return result


def convert_cif_df_to_mmcif_for_visualization(
cif_df: pd.DataFrame, structure_entry_id: str
) -> str:
"""
Convert a DataFrame containing mmCIF atom_site information back into a mmCIF string.

:param cif_df: DataFrame with CIF columns
:param structure_entry_id: Optional entry ID for the CIF block
:return: A string representing the mmCIF file
"""
if cif_df is None or cif_df.empty:
raise ValueError("CIF-DataFrame is empty, cannot create mmCIF content.")

lines = [
f"data_{structure_entry_id}",
"#",
f"_entry.id {structure_entry_id}",
"#",
"loop_",
]

for column in cif_df.columns:
lines.append(column)

for _, row in cif_df.iterrows():
row_items = []
for column in cif_df.columns:
value = row[column]
if value is None:
value_str = "."
else:
value_str = str(value)
if " " in value_str or any(char in value_str for char in "();,"):
value_str = f"'{value_str}'"
row_items.append(value_str)
lines.append(" ".join(row_items))

cif_string = "\n".join(lines)
return cif_string


def extract_relevant_crosslink_information(
crosslinking_df: pd.DataFrame,
) -> list[dict[str, int]]:
"""
For each crosslink extract its relevant information from a DataFrame.
This includes information on where the crosslinker binds on both its ends,
such as the chain and the absolute crosslinker position within the chain.
As well as a boolean for its validity and wether it is an intra or inter crosslink.

:param crosslinking_df: DataFrame with columns
'crosslinker_position1',
'crosslinker_position2',
'Chain_id1',
'Chain_id2',
'valid_crosslink',
'Is_intra_crosslink',
:return: List of dicts with keys
'crosslinkerPosition1',
'crosslinkerPosition2',
'ChainId1',
'ChainId2',
'isValid',
'isIntraCrosslink',
"""
crosslinks = []
for _, row in crosslinking_df.iterrows():
position1 = row.get("crosslinker_position1")
position2 = row.get("crosslinker_position2")
# When the validation is extended to treat multimeres with more than one chain correctly,
# it should ideally store chain_id1 and chain_id2 into the crosslinking_df.
# Since we already need those chain ids to calculate correct distances in the validation,
# it would be unnecessary to determine those again in the visualization.
# Therefore we use placeholders for now and need to change the following, when the validation is extended:
chain_id1 = row.get("Chain_id1")
chain_id2 = row.get("Chain_id2")
is_valid = row.get("valid_crosslink")
is_intra_crosslink = row.get("Is_intra_crosslink")
if pd.notnull(position1) and pd.notnull(position2) and pd.notnull(is_valid):
crosslinks.append(
{
"crosslinkerPosition1": int(position1),
"crosslinkerPosition2": int(position2),
"chainId1": str(chain_id1),
"chainId2": str(chain_id2),
"isValid": bool(is_valid),
"isIntraCrosslink": bool(is_intra_crosslink),
}
)
return crosslinks
Loading
Loading