ngl icon indicating copy to clipboard operation
ngl copied to clipboard

pdb versus mmtf 'reduced', versus mmtf 'full' : differences in cartoon representation (aspectRatio)

Open 0gust1 opened this issue 3 years ago • 8 comments

Hi,

I hope my question is not too silly (I'm a webdev, not a biologist)

I'm currently testing the usage of mmtf files instead of pdb ones, and I noticed differences in cartoon representation (and also in surface representation).

With a mmtf file "reduced" and a cartoon representation, the representationParameter aspectRatio seems locked to 1.0, and changing it has no effect.

With a mmtf "full", I have the same render and behavior than the PDB file (aspectRatio parameter works as intended)

Why ? I understand that there data stripped from "full" to "reduced" mmtf files, but I don't understand why it would have an effect of the AspectRatio of rendered ribbons.

Context :
NGL version : [email protected] Structure : https://www.rcsb.org/structure/1IGY
PDB file : 1igy.pdb downloaded from rcsb
MMTF 'reduced' file : curl -O https://mmtf.rcsb.org/v1.0/reduced/1IGY.mmtf.gz
MMTF 'full' file : curl -O https://mmtf.rcsb.org/v1.0/full/1IGY.mmtf.gz

0gust1 avatar Sep 04 '20 14:09 0gust1

Yes, it does seem to be hard-coded:

https://github.com/nglviewer/ngl/blob/master/src/representation/cartoon-representation.ts#L125

    getAspectRatio(polymer) {
        return polymer.isCg() ? 1.0 : this.aspectRatio;
    }

I don't know why that's the case. We could just allow it to be set, but that would change existing behaviour for course-grained structures. We could probably fudge it so that the default value is NaN (which then gets interpreted as 1.0 or 5.0 depending on polymer.isCg)? What do you (and anyone else) think?

fredludlow avatar Sep 16 '20 11:09 fredludlow

It is fixed because there is no way implemented to infer the direction into which extend the cartoon for CA only models.

arose avatar Sep 17 '20 00:09 arose

Thanks @arose - that makes sense. You say no way implemented, is there a way it could be done or does the reduced form just not have enough information in it to do it? (Other than making a guess based on the secondary structure of nearby elements, which sounds complicated and error-prone).

fredludlow avatar Sep 17 '20 08:09 fredludlow

Thanks @arose and @fredludlow !

I had a confirmation from my "chief scientific officer" : the ribbon oval orientation is dependent of both the backbone and secondary structures.

Knowing this, the behavior seems legit. "Today I learned"

0gust1 avatar Sep 17 '20 10:09 0gust1

I'm wondering if what I learnt today could be put somewhere here, or it's maybe common sense for biology/chemistry aware people.

Anyway, you can close the issue as you wish.

0gust1 avatar Sep 17 '20 14:09 0gust1

We could stick it in the docs for CartoonRepresentation, specifically for CartoonRepresentationParameters.aspectRatio (I've long been meaning to udpate the docs - they do build currently locally but I haven't looked into how to update the public version).

If you look at e.g. dihedral-representation.ts the parameters are documented in a typedoc block at the top - we could add the equivalent block to cartoon-representation.ts

fredludlow avatar Sep 18 '20 09:09 fredludlow

Seems a good (an hopefully easy) way for me to try a first contrib !

0gust1 avatar Sep 18 '20 16:09 0gust1

Seems a good (an hopefully easy) way for me to try a first contrib !

Absolutely! :)

fredludlow avatar Sep 23 '20 22:09 fredludlow