molstar icon indicating copy to clipboard operation
molstar copied to clipboard

Wrong info on unobserved residues in structures from ModelServer

Open midlik opened this issue 2 years ago • 3 comments

Mol* doesn't distinguish unobserved residues in the sequence panel, when the structure data come from ModelServer.

Compare: Working: https://molstar.org/viewer/?structure-url-format=mmcif&structure-url=https://www.ebi.ac.uk/pdbe/static/entry/1tqn_updated.cif Not working: https://molstar.org/viewer/?structure-url-format=mmcif&structure-url=https://wwwdev.ebi.ac.uk/pdbe/model-server/v1/1tqn/full

This is probably because Mol* relies on the _pdbx_unobs_or_zero_occ_residues category, but ModelServer doesn't provide it. Should be fixed either in Mol* or in ModelServer.

midlik avatar Oct 27 '23 15:10 midlik

You can use the copy_all_categories flag: https://molstar.org/viewer/?structure-url-format=mmcif&structure-url=https://wwwdev.ebi.ac.uk/pdbe/model-server/v1/1tqn/full?copy_all_categories=true

sbittrich avatar Oct 27 '23 15:10 sbittrich

I think a two things should be done

  1. export _pdbx_unobs_or_zero_occ_residues whenever _entity_poly_seq is exported.

  2. change https://github.com/molstar/molstar/blob/745746f2431314ac8c61930a6641469702e88f6d/src/mol-model-formats/structure/basic/sequence.ts#L17-L18 to if (!data.entity_poly_seq?._rowCount || !data.pdbx_unobs_or_zero_occ_residues?._rowCount) { plus some comment to explain it

As an addition/alternative to 2) you can modify https://github.com/molstar/molstar/blob/745746f2431314ac8c61930a6641469702e88f6d/src/mol-model-formats/structure/basic/properties.ts#L17-L38

Currently it only works when _pdbx_unobs_or_zero_occ_residues is present but we also have enough information to identify missing residues when _entity_poly_seq (which is what is causing the issue described). So in the case when _pdbx_unobs_or_zero_occ_residues is not present but _entity_poly_seq, you can loop over atom_site comp/seq to see for which coordinates are available.

arose avatar Oct 29 '23 20:10 arose