diff --git a/src/mol-model/structure/structure/unit/pair-restraints/extract-cross-links.ts b/src/mol-model/structure/structure/unit/pair-restraints/extract-cross-links.ts index 85ce85c8e3b63fda7679d859a78668df7cce348f..146528327e71ee8ff877bcb20bc5c18ea7cc9999 100644 --- a/src/mol-model/structure/structure/unit/pair-restraints/extract-cross-links.ts +++ b/src/mol-model/structure/structure/unit/pair-restraints/extract-cross-links.ts @@ -1,5 +1,5 @@ /** - * Copyright (c) 2018 mol* contributors, licensed under MIT, See LICENSE file for more info. + * Copyright (c) 2018-2019 mol* contributors, licensed under MIT, See LICENSE file for more info. * * @author Alexander Rose <alexander.rose@weirdbyte.de> */ @@ -89,6 +89,7 @@ function createCrossLinkRestraint(unitA: Unit, indexA: StructureElement.UnitInde function extractCrossLinkRestraints(structure: Structure): PairRestraints<CrossLinkRestraint> { const pairs: CrossLinkRestraint[] = [] + if (!structure.models.some(m => IHMCrossLinkRestraint.fromModel(m))) return new PairRestraints(pairs) const n = structure.units.length for (let i = 0; i < n; ++i) { @@ -96,7 +97,9 @@ function extractCrossLinkRestraints(structure: Structure): PairRestraints<CrossL extractIntra(pairs, unitA) for (let j = i + 1; j < n; ++j) { const unitB = structure.units[j] - extractInter(pairs, unitA, unitB) + if (unitA.model === unitB.model) { + extractInter(pairs, unitA, unitB) + } } }