Skip to content
Snippets Groups Projects
Commit 278dcb88 authored by yakomaxa's avatar yakomaxa
Browse files

added all and polymer.protein to keywords of pymol

parent 2ccfdb12
No related branches found
No related tags found
No related merge requests found
......@@ -16,11 +16,17 @@ const ResDict = {
solvent: ['HOH', 'WAT', 'H20', 'TIP', 'SOL']
};
const Backbone = {
nucleic: ['P', "O3'", "O5'", "C5'", "C4'", "C3'", 'OP1', 'OP2', 'O3*', 'O5*', 'C5*', 'C4*', 'C3*'],
protein: ['C', 'N', 'CA', 'O']
};
export const keywords: KeywordDict = {
all: {
'@desc': 'All atoms currently loaded into PyMOL',
abbr: ['*'],
map: () => B.struct.generator.atomGroups()
map: () => B.struct.generator.all()
},
none: {
'@desc': 'No atoms (empty selection)',
......@@ -57,10 +63,6 @@ export const keywords: KeywordDict = {
])
})
},
backbone: {
'@desc': 'Polymer backbone atoms (new in PyMOL 1.6.1)',
abbr: ['bb.']
},
sidechain: {
'@desc': 'Polymer non-backbone atoms (new in PyMOL 1.6.1)',
abbr: ['sc.']
......@@ -198,5 +200,80 @@ export const keywords: KeywordDict = {
},
metals: {
'@desc': 'All metal atoms (new in PyMOL 1.6.1)'
},
backbone: {
'@desc': 'the C, N, CA, and O atoms of a protein and the equivalent atoms in a nucleic acid.',
map: () => backboneExpr()
},
protein: {
'@desc': 'protein',
abbr: ['polymer.protein'],
map: () => B.struct.generator.atomGroups({
'residue-test': B.core.set.has([
B.core.type.set(ResDict.protein),
B.ammp('label_comp_id')
])
})
}
};
function backboneExpr() {
return B.struct.combinator.merge([
B.struct.generator.queryInSelection({
0: proteinExpr(),
query: B.struct.generator.atomGroups({
'atom-test': B.core.set.has([
h.atomNameSet(Backbone.protein),
B.ammp('label_atom_id')
])
})
}),
B.struct.generator.queryInSelection({
0: nucleicExpr(),
query: B.struct.generator.atomGroups({
'atom-test': B.core.set.has([
h.atomNameSet(Backbone.nucleic),
B.ammp('label_atom_id')
])
})
})
]);
}
function proteinExpr() {
return B.struct.filter.pick({
0: B.struct.generator.atomGroups({
'group-by': B.ammp('residueKey')
}),
test: B.core.set.isSubset([
h.atomNameSet(['C', 'N', 'CA', 'O']),
B.ammpSet('label_atom_id')
])
});
}
function nucleicExpr() {
return B.struct.filter.pick({
0: B.struct.generator.atomGroups({
'group-by': B.ammp('residueKey')
}),
test: B.core.logic.and([
B.core.set.isSubset([
// B.core.type.set([ 'P', 'O1P', 'O2P' ]),
h.atomNameSet(['P']),
B.ammpSet('label_atom_id')
]),
B.core.logic.or([
B.core.set.isSubset([
h.atomNameSet(["O3'", "C3'", "C4'", "C5'", "O5'"]),
B.ammpSet('label_atom_id')
]),
B.core.set.isSubset([
h.atomNameSet(['O3*', 'C3*', 'C4*', 'C5*', 'O5*']),
B.ammpSet('label_atom_id')
])
])
])
});
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment