m2ms / fragalysis-frontend

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

Add crystal ID to combined.sdf for download #895

Open phraenquex opened 2 years ago

phraenquex commented 2 years ago

Should be a very easy fix, for someone that knows where to look.
@alanbchristie will bug @duncanpeacock for pointers.

Here's one version of the user request:

I was also wondering whether it might be possible in the Mpro_combined.sdf file that accompanies every set of downloaded Fragalysis structures to include the CID/crystal ID of the ligand in the SDF comments block, so that it is straightforward to automate the finding of assay data for each crystal structure?

Priority is high - this bug ticket dropped off the list back when downloads (Epic 4) were released.

tdudgeon commented 2 years ago

What's needed here is for the SDF that is downloaded to contain a field with the fragment code (e.g. Mpro-x0072_0A). Probably this should be the title line (first line in the record) so that it can also happen for the molfiles (this is needed for the fragmenstein workflows).

It seems that the download dialog in Fragalysis allows to specify to create a single SDF with all fragments as well as individual files for each fragment. Both types would benefit from this field.

However note:

  1. the combined SDF seems to be missing from all targets except MPro so this needs fixing first
  2. as has been discussed previously adding this field would be better done by XChemReview so that all files in Fragalysis automatically have this. If we have to it in Fragalysis we will need to do so by parsing the SDF and adding the field which will be quite ugly. A compromise might be to do it during target upload.
phraenquex commented 2 years ago

Thanks @tdudgeon The point of the ticket was meant to be, to fix the backend to ensure the downloaded file is always generated, and always correct.

From the comment above, it dawns on me that the original download spec (Epic 4) took the lazy route: the backend merely serves up what was generated from XChemReview. I didn't notice this, and it was definitely not what I had expected.

The proper spec is: the fragalysis backend should ensure the file is correct. If its missing the crystalIDs, it should stick them in. If the file hasn't been generated, it should do so from the individual sdfs.

It's not "ugly", it's the right place to do it; we can't rely on the upload to get it right, it's (a) far too fragile and (b) doesn't fix historic data.

Please scope out how much work is involved, so we can prioritise accordingly.

rsanchezgarc commented 2 years ago

@alanbchristie I cannot check if this has been fixed because none of the mol files or sdf files are being downloaded. Only the bound pdbs. This is a major issue. You have an example here:

https://fragalysis.xchem.diamond.ac.uk/viewer/react/download/tag/8c9c77b5-6ad5-438c-9bda-bece4425142c

alanbchristie commented 2 years ago

Apologies - the merge to master (which I was convinced had taken place) had not been done. I'm merging these changes in now to create a new latest backend.