diff --git a/src/mol-plugin/skin/base/components/sequence.scss b/src/mol-plugin/skin/base/components/sequence.scss index 31ae7767d76b4585ea361488ece56808370fb41b..3176df95901db1831da4675139c02c153ede2d21 100644 --- a/src/mol-plugin/skin/base/components/sequence.scss +++ b/src/mol-plugin/skin/base/components/sequence.scss @@ -4,7 +4,6 @@ top: 0; left: 0; bottom: 0; - font-size: 90%; background: $sequence-background; } diff --git a/src/mol-plugin/ui/sequence/polymer.ts b/src/mol-plugin/ui/sequence/polymer.ts index 077b21596a8e4fc9f785fee7e05e1dfbce83b359..dc02ba205c75944ea53ae6e2d63457e17a399656 100644 --- a/src/mol-plugin/ui/sequence/polymer.ts +++ b/src/mol-plugin/ui/sequence/polymer.ts @@ -14,16 +14,13 @@ export type StructureUnit = { structure: Structure, unit: Unit } export class PolymerSequenceWrapper extends SequenceWrapper<StructureUnit> { private readonly location = StructureElement.create() - private entityId: string - private label_asym_id: string - eachResidue(loci: Loci, apply: (interval: Interval) => boolean) { let changed = false const { structure, unit } = this.data if (!StructureElement.isLoci(loci)) return false if (!Structure.areParentsEquivalent(loci.structure, structure)) return false - const { location, label_asym_id } = this + const { location } = this for (const e of loci.elements) { let rIprev = -1 location.unit = e.unit @@ -36,7 +33,6 @@ export class PolymerSequenceWrapper extends SequenceWrapper<StructureUnit> { // avoid checking for the same residue multiple times if (rI !== rIprev) { if (SP.unit.id(location) !== unit.id) return - if (SP.chain.label_asym_id(location) !== label_asym_id) return if (apply(getSeqIdInterval(location))) changed = true rIprev = rI @@ -58,10 +54,6 @@ export class PolymerSequenceWrapper extends SequenceWrapper<StructureUnit> { l.unit = data.unit l.element = data.unit.elements[0] - this.entityId = SP.entity.id(l) - this.label_asym_id = SP.chain.label_asym_id(l) - - this.label = `${this.label_asym_id}|${this.entityId}` this.sequence = data.unit.model.sequence.byEntityKey[SP.entity.key(l)].sequence this.markerArray = new Uint8Array(this.sequence.sequence.length) } diff --git a/src/mol-plugin/util/interactivity.ts b/src/mol-plugin/util/interactivity.ts index f44f6e6b4fbab0f3d316999f0c8bd35b9bc27877..61fff02d163329106e743c378161839bf6f3d84a 100644 --- a/src/mol-plugin/util/interactivity.ts +++ b/src/mol-plugin/util/interactivity.ts @@ -93,9 +93,13 @@ namespace Interactivity { normalizedLoci(interactivityLoci: Loci) { let { loci, repr } = interactivityLoci if (this.props.granularity !== 'element' && Link.isLoci(loci)) { + // convert Link.Loci to a StructureElement.Loci so granularity can be applied loci = Link.toStructureElementLoci(loci) } loci = Granularity[this.props.granularity](loci) + if (StructureElement.isLoci(loci) && loci.structure.parent) { + loci = StructureElement.Loci.remap(loci, loci.structure.parent) + } return { loci, repr } } diff --git a/src/mol-plugin/util/structure-element-selection.ts b/src/mol-plugin/util/structure-element-selection.ts index 6e72ccf6be7c834e7aaf7a95d3e4cb71468ee486..80e981e8a98518f93130f0c4ed5bc99718ab77e4 100644 --- a/src/mol-plugin/util/structure-element-selection.ts +++ b/src/mol-plugin/util/structure-element-selection.ts @@ -167,6 +167,7 @@ function SelectionEntry(s: Structure): SelectionEntry { }; } +/** remap `selection-entry` to be related to `structure` if possible */ function remapSelectionEntry(e: SelectionEntry, s: Structure): SelectionEntry { return { selection: StructureElement.Loci.remap(e.selection, s)