diff --git a/src/mol-model/structure/query/queries/modifiers.ts b/src/mol-model/structure/query/queries/modifiers.ts index e736b62fc..a0a9b5c45 100644 --- a/src/mol-model/structure/query/queries/modifiers.ts +++ b/src/mol-model/structure/query/queries/modifiers.ts @@ -545,6 +545,12 @@ export function surroundingLigands({ query, radius, includeWater }: SurroundingL continue; } + // Water is handled exclusively by the `includeWater` 3D-lookup branch below. + // A single water pulled in via a struct_conn metalc/covale edge would + // otherwise match every other water in the chain (all share label_seq_id + // and label_comp_id) and leak the entire chain. + if (StructureProperties.entity.type(l) === 'water') continue; + residuesIt.setSegment(chainSegment); while (residuesIt.hasNext) { const residueSegment = residuesIt.move(); diff --git a/src/servers/model/CHANGELOG.md b/src/servers/model/CHANGELOG.md index fc3c98925..395c69d28 100644 --- a/src/servers/model/CHANGELOG.md +++ b/src/servers/model/CHANGELOG.md @@ -1,5 +1,6 @@ # 0.9.13 * /surroundingLigands: honor `omit_water=true|false` for REST GET requests (boolean parser previously coerced both to `false`) +* /surroundingLigands: stop leaking the asymmetric unit's water chain into the result when `omit_water=true` (water residues pulled in via struct_conn covale/metalc edges no longer match every other water in the chain) # 0.9.12 * add `health-check` endpoint + `healthCheckPath` config prop to report service health