diff --git a/src/mol-script/transpilers/pymol/keywords.ts b/src/mol-script/transpilers/pymol/keywords.ts index e26990a41dbdf5e5349a01d4cac4fd2390149c28..556544447c69a2dfede314804519d06604051df7 100644 --- a/src/mol-script/transpilers/pymol/keywords.ts +++ b/src/mol-script/transpilers/pymol/keywords.ts @@ -17,10 +17,41 @@ const ResDict = { }; const Backbone = { - nucleic: ['P', "O3'", "O5'", "C5'", "C4'", "C3'", 'OP1', 'OP2', 'O3*', 'O5*', 'C5*', 'C4*', 'C3*'], + nucleic: ['P', "O3'", "O5'", "C5'", "C4'", "C3'", 'OP1', 'OP2', 'O3*', 'O5*', 'C5*', 'C4*', 'C3*', + "C2'","C1'","O4'","O2'"], protein: ['C', 'N', 'CA', 'O'] }; +function backboneExpr() { + return B.struct.combinator.merge([ + B.struct.modifier.intersectBy( + { 0: B.struct.generator.atomGroups({ + 'residue-test': B.core.set.has([ + B.core.type.set(ResDict.protein), + B.ammp('label_comp_id') + ])}) + , + by : B.struct.generator.atomGroups({ + 'atom-test': B.core.set.has([ + B.core.type.set(Backbone.protein), + B.ammp('label_atom_id')])}) + }), + B.struct.modifier.intersectBy( + { 0: B.struct.generator.atomGroups({ + 'residue-test': B.core.set.has([ + B.core.type.set(ResDict.nucleic), + B.ammp('label_comp_id') + ])}) + , + by : B.struct.generator.atomGroups({ + 'atom-test': B.core.set.has([ + B.core.type.set(Backbone.nucleic), + B.ammp('label_atom_id')])}) + }), + ]) + +} + export const keywords: KeywordDict = { all: { @@ -65,6 +96,15 @@ export const keywords: KeywordDict = { }, sidechain: { '@desc': 'Polymer non-backbone atoms (new in PyMOL 1.6.1)', + abbr:['sc.'], + map: () => { + return B.struct.modifier.exceptBy({ + '0': B.struct.generator.atomGroups({ + 'residue-test': B.core.set.has([ + B.core.type.set(ResDict.nucleic.concat(ResDict.protein)), + B.ammp('label_comp_id')])}), + by: backboneExpr() + })}, }, present: { '@desc': 'All atoms with defined coordinates in the current state (used in creating movies)', @@ -202,15 +242,11 @@ export const keywords: KeywordDict = { }, backbone: { '@desc': 'the C, N, CA, and O atoms of a protein and the equivalent atoms in a nucleic acid.', - map: () => B.struct.generator.atomGroups({ - 'atom-test': B.core.set.has([ - B.core.type.set(Backbone.protein.concat(ResDict.protein)), - B.ammp('label_atom_id') - ]) - }), - }, - proteinxxxxxx: { - '@desc': 'protein................', + abbr: ['bb.'], + map: () => backboneExpr() + }, + 'bFCLHMz55tjm16c9': { + '@desc': 'protein', abbr: ['polymer.protein'], map: () => B.struct.generator.atomGroups({ 'residue-test': B.core.set.has([ @@ -219,8 +255,8 @@ export const keywords: KeywordDict = { ]) }) }, - nucleicxxxxx: { - '@desc': 'protein................', + 'bFCLHMz55tjm16c0': { + '@desc': 'nucleic acid', abbr: ['polymer.nucleic'], map: () => B.struct.generator.atomGroups({ 'residue-test': B.core.set.has([ diff --git a/src/mol-script/transpilers/pymol/properties.ts b/src/mol-script/transpilers/pymol/properties.ts index 7b29db7bf72abc619f242b2aa5b2ed921411945b..5b405187bc6276885b84d07782f8282ea73814b2 100644 --- a/src/mol-script/transpilers/pymol/properties.ts +++ b/src/mol-script/transpilers/pymol/properties.ts @@ -203,5 +203,11 @@ export const properties: PropertyDict = { isNumeric: true, abbr: ['pc.'], regex: reFloat, map: x => parseFloat(x), level: 'atom-test' + }, + elem: { + '@desc': 'str atomic element symbol string ("X" if undefined)', + '@examples': ['elem N'], + regex: /[a-zA-Z0-9]{1,3}/, map: x => B.es(x), + level: 'atom-test', property: B.acp('elementSymbol') } };