mirror of
https://github.com/molstar/molstar.git
synced 2026-06-04 13:30:24 +08:00
Handle CCD bonds with Deuterium atoms
This commit is contained in:
@@ -22,6 +22,7 @@ Note that since we don't clearly distinguish between a public and private interf
|
|||||||
- MolViewSpec
|
- MolViewSpec
|
||||||
- Add `VolumeStreamingExtension` (`molstar_volume_streaming` custom property)
|
- Add `VolumeStreamingExtension` (`molstar_volume_streaming` custom property)
|
||||||
- Fix focusing empty selections
|
- Fix focusing empty selections
|
||||||
|
- Handle CCD bonds with Deuterium atoms
|
||||||
|
|
||||||
## [v5.7.0] - 2026-02-28
|
## [v5.7.0] - 2026-02-28
|
||||||
- Text label improvements
|
- Text label improvements
|
||||||
|
|||||||
@@ -49,3 +49,6 @@
|
|||||||
* Assembly symmetries
|
* Assembly symmetries
|
||||||
* 5M30 (Assembly 1, C3 local and pseudo)
|
* 5M30 (Assembly 1, C3 local and pseudo)
|
||||||
* 1RB8 (Assembly 1, I global)
|
* 1RB8 (Assembly 1, I global)
|
||||||
|
* Deuterium atoms
|
||||||
|
* 3CWH (XUL with D and DOD)
|
||||||
|
* 8TT8 (HOH and other with D)
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
/**
|
/**
|
||||||
* Copyright (c) 2017-2025 Mol* contributors, licensed under MIT, See LICENSE file for more info.
|
* Copyright (c) 2017-2026 Mol* contributors, licensed under MIT, See LICENSE file for more info.
|
||||||
*
|
*
|
||||||
* @author David Sehnal <david.sehnal@gmail.com>
|
* @author David Sehnal <david.sehnal@gmail.com>
|
||||||
* @author Alexander Rose <alexander.rose@weirdbyte.de>
|
* @author Alexander Rose <alexander.rose@weirdbyte.de>
|
||||||
@@ -213,11 +213,14 @@ function findBonds(unit: Unit.Atomic, props: BondComputationProps): IntraUnitBon
|
|||||||
lastResidue = raI;
|
lastResidue = raI;
|
||||||
|
|
||||||
const aeI = getElementIdx(elemA);
|
const aeI = getElementIdx(elemA);
|
||||||
const atomIdA = label_atom_id.value(aI);
|
const isHa = isHydrogen(aeI);
|
||||||
|
let atomIdA = label_atom_id.value(aI);
|
||||||
|
if (isHa && atomIdA.startsWith('D') && compId !== 'DOD') {
|
||||||
|
atomIdA = 'H' + atomIdA.substring(1);
|
||||||
|
}
|
||||||
const componentPairs = componentMap ? componentMap.get(atomIdA) : void 0;
|
const componentPairs = componentMap ? componentMap.get(atomIdA) : void 0;
|
||||||
|
|
||||||
const { indices, count, squaredDistances } = query3d.find(x[aI], y[aI], z[aI], maxRadius);
|
const { indices, count, squaredDistances } = query3d.find(x[aI], y[aI], z[aI], maxRadius);
|
||||||
const isHa = isHydrogen(aeI);
|
|
||||||
const thresholdA = getElementThreshold(aeI);
|
const thresholdA = getElementThreshold(aeI);
|
||||||
const altA = label_alt_id.value(aI);
|
const altA = label_alt_id.value(aI);
|
||||||
const metalA = MetalsSet.has(aeI);
|
const metalA = MetalsSet.has(aeI);
|
||||||
@@ -248,7 +251,11 @@ function findBonds(unit: Unit.Atomic, props: BondComputationProps): IntraUnitBon
|
|||||||
const rbI = residueIndex[bI];
|
const rbI = residueIndex[bI];
|
||||||
// handle "component dictionary" bonds.
|
// handle "component dictionary" bonds.
|
||||||
if (raI === rbI && componentPairs) {
|
if (raI === rbI && componentPairs) {
|
||||||
const e = componentPairs.get(label_atom_id.value(bI)!);
|
let atomIdB = label_atom_id.value(bI)!;
|
||||||
|
if (isHb && atomIdB.startsWith('D') && compId !== 'DOD') {
|
||||||
|
atomIdB = 'H' + atomIdB.substring(1);
|
||||||
|
}
|
||||||
|
const e = componentPairs.get(atomIdB);
|
||||||
if (e) {
|
if (e) {
|
||||||
atomA[atomA.length] = _aI;
|
atomA[atomA.length] = _aI;
|
||||||
atomB[atomB.length] = _bI;
|
atomB[atomB.length] = _bI;
|
||||||
@@ -284,7 +291,7 @@ function findBonds(unit: Unit.Atomic, props: BondComputationProps): IntraUnitBon
|
|||||||
if (flag) {
|
if (flag) {
|
||||||
atomA[atomA.length] = _aI;
|
atomA[atomA.length] = _aI;
|
||||||
atomB[atomB.length] = _bI;
|
atomB[atomB.length] = _bI;
|
||||||
order[order.length] = getIntraBondOrderFromTable(compId, atomIdA, label_atom_id.value(bI));
|
order[order.length] = getIntraBondOrderFromTable(compId, label_atom_id.value(aI), label_atom_id.value(bI));
|
||||||
flags[flags.length] = (isMetal ? BondType.Flag.MetallicCoordination : BondType.Flag.Covalent) | BondType.Flag.Computed;
|
flags[flags.length] = (isMetal ? BondType.Flag.MetallicCoordination : BondType.Flag.Covalent) | BondType.Flag.Computed;
|
||||||
key[key.length] = -1;
|
key[key.length] = -1;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user