Closed ghutchis closed 9 years ago
The code is we use is:
<div class='viewer_3Dmoljs' data-href='/static/data/FILE.mol2' data-type='mol2' data-backgroundcolor='0xffffff' data-style='stick'></div>
and
<div class='viewer_3Dmoljs' data-href='/static/data/FILE.sdf' data-type='sdf' data-backgroundcolor='0xffffff' data-style='stick'></div>
I can't reproduce this. Are you using the latest and greatest 3Dmol.js?
Showing hydrogens is the default for everything but pdb files (cause I don't like it for pdb files). Hiding hydrogens wasn't working for sdf and mol2s though I just committed a fix.
We're using the No-jQuery verison of 3dMol, because it's conflicting with jQuery if we import it ourselves separately.
Testing it with the latest build of 3Dmol.js from http://3dmol.csb.pitt.edu/build/3Dmol.js
fixes the issue, but it breaks jQuery otherwise due to namespace conflicts.
Why not use the nojquery version? Are you saying that the most recent nojquery version doesn't work but the jquery included one does?
Switching from the CDN noquery version the hydrogens show.
That fixed it! We changed from
<script src="http://cdn.jsdelivr.net/3dmol.js/latest/3Dmol-nojquery-min.js"></script>
to
<script src="http://3Dmol.csb.pitt.edu/build/3Dmol-nojquery.js"></script>
for our CDN and that fixed everything.
Linking to 3dmol.csb.pitt.edu gives the the very latest version. The jsdeliver version is only updated when I tag a release. My recommendation would be to link to the 3dmol version for now as you develop the site. That way if there are any bug fixes or features you need you can pick them up right away. Once your site is in a happy place, I can tag a release, and you can switch to the more stable jsdeliver, CDN hosted version.
When we use 3DMol for the same file in either Mol2 or SDF format, we see two very different geometries. Also, with Mol2 files, hydrogens aren't shown, but they are with SDF. https://gist.github.com/ghutchis/4243c0242423770d58a3
1) Is it possible to make showing explicit hydrogens a setting (i.e., so it can be the default for us even with Mol2 files)? 2) Why is the geometry so different with Mol2 - the Cartesian coordinates are the same and Open Babel generates the same InChI as far as I can tell..