diff --git a/src/mol-theme/label.ts b/src/mol-theme/label.ts index 3749522e32e5279e34d7a381dacb4c7b6ecde563..63d4afdf7c0e000b4493d5133bee350fdd8104b5 100644 --- a/src/mol-theme/label.ts +++ b/src/mol-theme/label.ts @@ -177,11 +177,13 @@ function _atomicElementLabel(location: StructureElement.Location<Unit.Atomic>, g const comp_id = Props.residue.label_comp_id(location) const atom_id = Props.atom.label_atom_id(location) const alt_id = Props.atom.label_alt_id(location) + const occupancy = Props.atom.occupancy(location); const microHetCompIds = Props.residue.microheterogeneityCompIds(location) const compId = granularity === 'residue' && microHetCompIds.length > 1 ? `(${microHetCompIds.join('|')})` : comp_id + const label: string[] = [] switch (granularity) { @@ -205,6 +207,10 @@ function _atomicElementLabel(location: StructureElement.Location<Unit.Atomic>, g } } + if (label.length > 0 && occupancy !== 1) { + label[0] = `${label[0]} <small>[occupancy</small> <b>${Math.round(100 * occupancy) / 100}</b><small>]</small>`; + } + return label.reverse() }