Browse Source

rename Structure.links to .interUnitBonds

Alexander Rose 5 years ago
parent
commit
a476c2a167

+ 1 - 1
src/apps/structure-info/model.ts

@@ -87,7 +87,7 @@ export function printLinks(structure: Structure, showIntra: boolean, showInter:
 
     if (showInter) {
         console.log('\nInter Unit Links\n=============');
-        const links = structure.links;
+        const links = structure.interUnitBonds;
         for (const unit of structure.units) {
             if (!Unit.isAtomic(unit)) continue;
 

+ 1 - 1
src/mol-model/structure/query/queries/filters.ts

@@ -238,7 +238,7 @@ function checkConnected(ctx: IsConnectedToCtx, structure: Structure) {
     const { queryCtx, input, target, disjunct } = ctx;
     const atomicLink = queryCtx.atomicLink;
 
-    const interLinks = input.links;
+    const interLinks = input.interUnitBonds;
     for (const unit of structure.units) {
         if (!Unit.isAtomic(unit)) continue;
 

+ 1 - 1
src/mol-model/structure/query/queries/generators.ts

@@ -280,7 +280,7 @@ export function linkedAtomicPairs(linkTest?: QueryPredicate): StructureQuery {
     return function query_linkedAtomicPairs(ctx) {
         const structure = ctx.inputStructure;
 
-        const interLinks = structure.links;
+        const interLinks = structure.interUnitBonds;
         // Note: each link is called twice, that's why we need the unique builder.
         const ret = StructureSelection.UniqueBuilder(ctx.inputStructure);
 

+ 1 - 1
src/mol-model/structure/query/queries/modifiers.ts

@@ -332,7 +332,7 @@ function includeConnectedStep(ctx: QueryContext, wholeResidues: boolean, structu
 
 function expandConnected(ctx: QueryContext, structure: Structure) {
     const inputStructure = ctx.inputStructure;
-    const interLinks = inputStructure.links;
+    const interLinks = inputStructure.interUnitBonds;
     const builder = new StructureUniqueSubsetBuilder(inputStructure);
 
     // Note: each link is visited twice so that link.atom-a and link.atom-b both get the "swapped values"

+ 1 - 1
src/mol-model/structure/structure/carbohydrates/compute.ts

@@ -276,7 +276,7 @@ export function computeCarbohydrates(structure: Structure): Carbohydrates {
         const unit = structure.units[i]
         if (!Unit.isAtomic(unit)) continue
 
-        structure.links.getLinkedUnits(unit).forEach(pairBonds => {
+        structure.interUnitBonds.getLinkedUnits(unit).forEach(pairBonds => {
             pairBonds.linkedElementIndices.forEach(indexA => {
                 pairBonds.getBonds(indexA).forEach(bondInfo => {
                     const { unitA, unitB } = pairBonds

+ 5 - 5
src/mol-model/structure/structure/structure.ts

@@ -40,7 +40,7 @@ class Structure {
     private _props: {
         parent?: Structure,
         lookup3d?: StructureLookup3D,
-        links?: InterUnitBonds,
+        interUnitBonds?: InterUnitBonds,
         crossLinkRestraints?: PairRestraints<CrossLinkRestraint>,
         unitSymmetryGroups?: ReadonlyArray<Unit.SymmetryGroup>,
         unitSymmetryGroupsIndexMap?: IntMap<number>,
@@ -200,10 +200,10 @@ class Structure {
         return this._props.lookup3d;
     }
 
-    get links() {
-        if (this._props.links) return this._props.links;
-        this._props.links = computeInterUnitBonds(this);
-        return this._props.links;
+    get interUnitBonds() {
+        if (this._props.interUnitBonds) return this._props.interUnitBonds;
+        this._props.interUnitBonds = computeInterUnitBonds(this);
+        return this._props.interUnitBonds;
     }
 
     get crossLinkRestraints() {

+ 2 - 2
src/mol-model/structure/structure/unit/links.ts

@@ -123,7 +123,7 @@ namespace Link {
             if (idx < 0) return LinkType.create(LinkType.Flag.None);
             return LinkType.create(links.edgeProps.flags[idx]);
         } else {
-            const bond = structure.links.getBondFromLocation(link);
+            const bond = structure.interUnitBonds.getBondFromLocation(link);
             if (bond) return LinkType.create(bond.flag);
             return LinkType.create(LinkType.Flag.None);
         }
@@ -136,7 +136,7 @@ namespace Link {
             if (idx < 0) return 0;
             return links.edgeProps.order[idx];
         } else {
-            const bond = structure.links.getBondFromLocation(link);
+            const bond = structure.interUnitBonds.getBondFromLocation(link);
             if (bond) return bond.order;
             return 0;
         }

+ 2 - 2
src/mol-repr/structure/visual/util/link.ts

@@ -142,11 +142,11 @@ export namespace LinkIterator {
     }
 
     export function fromStructure(structure: Structure): LocationIterator {
-        const groupCount = structure.links.bondCount
+        const groupCount = structure.interUnitBonds.bondCount
         const instanceCount = 1
         const location = Link.Location()
         const getLocation = (groupIndex: number) => {
-            const bond = structure.links.bonds[groupIndex]
+            const bond = structure.interUnitBonds.bonds[groupIndex]
             location.aUnit = bond.unitA
             location.aIndex = bond.indexA as StructureElement.UnitIndex
             location.bUnit = bond.unitB

+ 1 - 1
src/perf-tests/structure.ts

@@ -375,7 +375,7 @@ export namespace PropertyAccess {
     export async function runLinks() {
         const { structures } = await readCIF('e:/test/quick/3j3q_full.bcif');
         console.time('links');
-        structures[0].links
+        structures[0].interUnitBonds
         console.timeEnd('links');
     }