m2ms / fragalysis-frontend

The React, Redux frontend built by webpack
Other
1 stars 1 forks source link

Direct links - exact match #448

Open boriskovar-m2ms opened 3 years ago

boriskovar-m2ms commented 3 years ago

Currently direct links works in a way that toggles are applied when molecule name provided in the URL is substring of the molecule name (protein_code) in the data. This behavior is fine but we need also option for exact match. In this case the name of the molecule in the URL must exactly (sort of... on that later) match the name of the molecule (protein_code) in the data and the toggles are applied only on these exact matches. Protein_code has structure targetName-moleculeName and exact match must only match the moleculeName part of the protein_code. Currently the example URL is http://localhost:8080/viewer/react/preview/direct/target/Mpro/mols/X0426_0/L/P/S/X2608/L/P - this is current behavior which shall remain unchanged. If we want only exact matches we should use URL in this format: http://localhost:8080/viewer/react/preview/direct/target/Mpro/mols/X0426_0/exact/L/P/S/X2608/exact/L/P - in this case we are searching exactly for molecules X0426_0 and X2608. If we want to search exactly for X2608 and all molecules which contains X0426_0 as a substring then the URL should look like thise: http://localhost:8080/viewer/react/preview/direct/target/Mpro/mols/X0426_0/L/P/S/X2608/exact/L/P

NOTE: This task is expansion of #431 (with bug fix in #447 ) - both deployed in production therefore merged in the master

ag-m2ms commented 3 years ago

Solution in #448

teriraj commented 3 years ago

please check why this direct link does not work

https://fragalysis-tibor-default.xchem-dev.diamond.ac.uk/viewer/react/preview/direct/target/NUDT7A_CRUDE/mols/NUDT7A_CRUDE-X0156_1/exact/L/P

ag-m2ms commented 3 years ago

Should be fixed

teriraj commented 3 years ago

It works correctly.

phraenquex commented 3 years ago

Not sure this works.

This ought to show something, but it doesn't: https://fragalysis.apps.xchem.diamond.ac.uk/viewer/react/preview/direct/target/Mpro/mols/AAR-POS-d2a4d1df-2/exact/L

Without /exact, it brings up everything as expected: https://fragalysis.apps.xchem.diamond.ac.uk/viewer/react/preview/direct/target/Mpro/mols/AAR-POS-d2a4d1df-2/L

(But no longer has duplicates! So #499 is fixed, awesome.)

boriskovar-m2ms commented 3 years ago

This is because the exact name is actually x0104A:AAR-POS-d2a4d1df-2. So should we detect and strip the first id before ":"? Or should we treat this name as a two IDs and both these urls: https://fragalysis.apps.xchem.diamond.ac.uk/viewer/react/preview/direct/target/Mpro/mols/AAR-POS-d2a4d1df-2/exact/L and https://fragalysis.apps.xchem.diamond.ac.uk/viewer/react/preview/direct/target/Mpro/mols/x0104A/exact/L will produce same result?

phraenquex commented 3 years ago

Oh... okay, so the real problem is that the IDs and search had to be hacked earlier this year - thanks, I understand. Let's close this ticket, but worth revisiting when we get reworking the identifiers. (I forget the ticket number.)