nglviewer / ngl

WebGL protein viewer
http://nglviewer.org/ngl/
MIT License
663 stars 167 forks source link

Compatible Chain IDs #36

Closed BernierCR closed 8 years ago

BernierCR commented 8 years ago

Hello, great project. I have an issue though.

In mmCIF format, you are using label_asym_id for the chain names. On it's own, that seems reasonable. However, the PDB and PyMOL, and maybe others use auth_asym_id for the chain names. Do you think NGL should use auth_asym_id as well in the interest of compatibility? You know a lot more about your program and these file formats than I do. I'm sure you will come up with a reasonable solution.

arose commented 8 years ago

Hi, thanks for your report.

Yes, I think NGL should use the author supplied names when possible. It is currently not coherent, e.g. auth_seq_id is used but not auth_asym_id. I will look into changing it. There needs to be a fallback if auth_asym_id is not there as it is not required, but label_asym_id is required. Moreover, some data in the mmcif file is linked by the label_asym_id (_pdbx_struct_assembly_gen.asym_id_list), so that field need to be read anyway.

BernierCR commented 8 years ago

Hi, thanks for your prompt reply.

I put in a dirty hack in my copy for now, to allow my development to continue. I'm not sure if or when I will run into issues because of that. I look forward to your proper fix whenever you get a chance. Next on my list is to extend it's API to support a more convenient to me syntax of custom coloring residues. I can do a pull request for that, but I understand if you don't accept it. That's the beauty of JavaScript, I don't need anything officially added to do it. I can extend at run time.

This project is a lifesaver. I have been using Jmol, but Java is dead. Chrome dropped support, Firefox will be dropping Java support soon, and may other browsers don't have Java support either. JSmol is too slow for large molecules without WebGL. Unless they get serious about making their WebGL version work, NGL Viewer is the best option for sure.

arose commented 8 years ago

Fixed this in commit 8afe455481ac9e39e59578eaf3f7bd8bfa045e80. Testing appreciated. With that auth_asym_id is used instead of label_asym_id as the chainname. Additionally I made sure that label_asym_id in _pdbx_struct_assembly_gen.asym_id_list and in other places is mapped to the corresponding auth_asym_id during parsing.

arose commented 8 years ago

Next on my list is to extend it's API to support a more convenient to me syntax of custom coloring residues. I can do a pull request for that, but I understand if you don't accept it.

Please do make a PR or open an issue. I am very happy to discuss the API!

BernierCR commented 8 years ago

OK great. I'm working on some other parts of my program right now. When I get back to NGL, I will switch to your dev version, test your changes, and develop my api feature.