m2ms / fragalysis-frontend

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

Missing .mtz files cause problems #1257

Open tdudgeon opened 8 months ago

tdudgeon commented 8 months ago

The target being processed by Jasmin Aschenbrenner is giving problems.

Traceback (most recent call last):
  File "/dls/science/groups/i04-1/conor_dev/xchem-align/env_xchem_align/lib/python3.10/runpy.py", line 196, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "/dls/science/groups/i04-1/conor_dev/xchem-align/env_xchem_align/lib/python3.10/runpy.py", line 86, in _run_code
    exec(code, run_globals)
  File "/dls/science/groups/i04-1/conor_dev/xchem-align/src/xchemalign/aligner.py", line 776, in <module>
    main()
  File "/dls/science/groups/i04-1/conor_dev/xchem-align/src/xchemalign/aligner.py", line 770, in main
    a.run()
  File "/dls/science/groups/i04-1/conor_dev/xchem-align/src/xchemalign/aligner.py", line 219, in run
    new_meta = self._perform_alignments(input_meta)
  File "/dls/science/groups/i04-1/conor_dev/xchem-align/src/xchemalign/aligner.py", line 317, in _perform_alignments
    datasets, reference_datasets, new_datasets = get_datasets_from_crystals(crystals, self.base_dir)
  File "/dls/science/groups/i04-1/conor_dev/xchem-align/src/xchemalign/aligner.py", line 118, in get_datasets_from_crystals
    output_path
TypeError: unsupported operand type(s) for /: 'PosixPath' and 'NoneType'

The corresponding code looks like this:

    for dtag, crystal in crystals.items():
        dataset = dt.Dataset(
            dtag=dtag,
            pdb=str(output_path / crystal[Constants.META_XTAL_FILES][Constants.META_XTAL_PDB][Constants.META_FILE]),
            xmap="",
            mtz=str(
                output_path
                / crystal[Constants.META_XTAL_FILES].get(Constants.META_XTAL_MTZ, {}).get(Constants.META_FILE)
            ),

Clearly a .mtz file is expected to be present, but in this case the 4 reference structures do not have .mtz files.

So either: the .mtz files should be required and this error is correct (but could be handled better)

or: the code need to be tolerant of missing .mtz files.

ConorFWild commented 8 months ago

There should always be an mtz file? Even for reference datasets we should have one because having a pdb file without an mtz that provides the evidence for it is not great?

This needs a clearer error though.

@phraenquex Happy with that assessment?

phraenquex commented 7 months ago

Sorry @ConorFWild @tdudgeon, only just saw.

In general no, there need be no mtz file - it's just a bunch of coordinates to reference against. Someone could choose a structure from the PDB, if they wanted to.

Any reason not to make it behave just like any other compound that's missing an mtz file?

tdudgeon commented 7 months ago

The problem is fixed, but the solution needs tidying up so that the string "None" is not passed through to LNA.

phraenquex commented 7 months ago

@ConorFWild this is for you - @tdudgeon says it's a 5min change.

phraenquex commented 7 months ago

@tdudgeon please try to fix once @Waztom has given you rights to the repo.

(If not easy, relabel as Yellow.)

Waztom commented 7 months ago

@tdudgeon have given you write access to ligand_neighbourhood_alignment

tdudgeon commented 7 months ago

I took a look and it's not obvious to me what needs to change in LNA so I must leave that to @ConorFWild

ConorFWild commented 7 months ago

Issue addressed in commit c6e26d3