diff --git a/CHANGELOG.md b/CHANGELOG.md index 6b1af7997c7adb668c82012dec8cbece7eb37c92..8ea385793efcac96000e292b2bb3de5a9d3ebb8d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,7 @@ Note that since we don't clearly distinguish between a public and private interf ## [Unreleased] +- Excluded common protein caps `NME` and `ACE` from the ligand selection query ## [v3.25.1] - 2022-11-20 diff --git a/package.json b/package.json index 130d63d20e01683b702950f588107d0f9035775f..04031ba89bb681da406ca1f0fd4f631647457042 100644 --- a/package.json +++ b/package.json @@ -92,7 +92,8 @@ "Panagiotis Tourlas <panagiot_tourlov@hotmail.com>", "Adam Midlik <midlik@gmail.com>", "Koya Sakuma <koya.sakuma.work@gmail.com>", - "Gianluca Tomasello <giagitom@gmail.com>" + "Gianluca Tomasello <giagitom@gmail.com>", + "Jason Pattle <jpattle@exscientia.co.uk>" ], "license": "MIT", "devDependencies": { diff --git a/src/mol-model/structure/model/types.ts b/src/mol-model/structure/model/types.ts index 216a92baa9b50480ab8c61d29f01f53db6d2ef66..9795bdb628d3948ed0a74b01d8239125366eafdd 100644 --- a/src/mol-model/structure/model/types.ts +++ b/src/mol-model/structure/model/types.ts @@ -285,6 +285,10 @@ export const AminoAcidNamesD = new Set([ ]); export const AminoAcidNames = SetUtils.unionMany(AminoAcidNamesL, AminoAcidNamesD); +export const CommonProteinCaps = new Set([ + 'NME', 'ACE' +]); + export const RnaBaseNames = new Set([ 'A', 'C', 'T', 'G', 'I', 'U', 'N' // unknown RNA base from CCD diff --git a/src/mol-plugin-state/helpers/structure-selection-query.ts b/src/mol-plugin-state/helpers/structure-selection-query.ts index 8f7edc975b02a2b3b3f4f6df2ec026f7ca552b65..169781fa6360b7c858963a574d27c5e18d5d0165 100644 --- a/src/mol-plugin-state/helpers/structure-selection-query.ts +++ b/src/mol-plugin-state/helpers/structure-selection-query.ts @@ -7,7 +7,7 @@ import { CustomProperty } from '../../mol-model-props/common/custom-property'; import { QueryContext, Structure, StructureQuery, StructureSelection, StructureProperties, StructureElement } from '../../mol-model/structure'; -import { BondType, NucleicBackboneAtoms, ProteinBackboneAtoms, SecondaryStructureType, AminoAcidNamesL, RnaBaseNames, DnaBaseNames, WaterNames, ElementSymbol, PolymerNames } from '../../mol-model/structure/model/types'; +import { BondType, NucleicBackboneAtoms, ProteinBackboneAtoms, SecondaryStructureType, AminoAcidNamesL, RnaBaseNames, DnaBaseNames, WaterNames, ElementSymbol, PolymerNames, CommonProteinCaps } from '../../mol-model/structure/model/types'; import { PluginContext } from '../../mol-plugin/context'; import { MolScriptBuilder as MS } from '../../mol-script/language/builder'; import { Expression } from '../../mol-script/language/expression'; @@ -350,14 +350,23 @@ const ligand = StructureSelectionQuery('Ligand', MS.struct.modifier.union([ ]) ]), ]), - by: MS.struct.modifier.union([ + by: MS.struct.combinator.merge([ + MS.struct.modifier.union([ + MS.struct.generator.atomGroups({ + 'entity-test': MS.core.rel.eq([MS.ammp('entityType'), 'polymer']), + 'chain-test': MS.core.rel.eq([MS.ammp('objectPrimitive'), 'atomistic']), + 'residue-test': MS.core.set.has([ + MS.set(...SetUtils.toArray(PolymerNames)), MS.ammp('label_comp_id') + ]) + }), + ]), MS.struct.generator.atomGroups({ - 'entity-test': MS.core.rel.eq([MS.ammp('entityType'), 'polymer']), 'chain-test': MS.core.rel.eq([MS.ammp('objectPrimitive'), 'atomistic']), 'residue-test': MS.core.set.has([ - MS.set(...SetUtils.toArray(PolymerNames)), MS.ammp('label_comp_id') - ]) - }) + MS.set(...SetUtils.toArray(CommonProteinCaps)), + MS.ammp('label_comp_id'), + ]), + }), ]) }) ]), { category: StructureSelectionCategory.Type });