Skip to content
Snippets Groups Projects
Commit 51ac7594 authored by Alexander Rose's avatar Alexander Rose
Browse files

query preset tweaks

parent 6bcb5eac
No related branches found
No related tags found
No related merge requests found
......@@ -199,8 +199,8 @@ export class StructureRepresentationHelper {
async function polymerAndLigand(r: StructureRepresentationHelper) {
await r.clear()
await r.setFromExpression('add', 'cartoon', Q.all.expression)
await r.setFromExpression('add', 'carbohydrate', Q.all.expression)
await r.setFromExpression('add', 'cartoon', Q.polymer.expression)
await r.setFromExpression('add', 'carbohydrate', Q.branched.expression)
await r.setFromExpression('add', 'ball-and-stick', MS.struct.modifier.union([
MS.struct.combinator.merge([
Q.ligandPlusConnected.expression,
......@@ -215,15 +215,6 @@ async function proteinAndNucleic(r: StructureRepresentationHelper) {
await r.clear()
await r.setFromExpression('add', 'cartoon', Q.protein.expression)
await r.setFromExpression('add', 'gaussian-surface', Q.nucleic.expression)
await r.setFromExpression('add', 'carbohydrate', Q.all.expression)
await r.setFromExpression('add', 'ball-and-stick', MS.struct.modifier.union([
MS.struct.combinator.merge([
Q.ligandPlusConnected.expression,
Q.branchedConnectedOnly.expression,
Q.water.expression
])
]))
}
async function capsid(r: StructureRepresentationHelper) {
......
......@@ -12,6 +12,7 @@ import { compile } from '../../mol-script/runtime/query/compiler';
import { Loci } from '../../mol-model/loci';
import { PluginContext } from '../context';
import Expression from '../../mol-script/language/expression';
import { LinkType } from '../../mol-model/structure/model/types';
export interface StructureSelectionQuery {
label: string
......@@ -139,7 +140,9 @@ const ligand = StructureSelectionQuery('Ligand', MS.struct.modifier.union([
])
})
]),
// this is to get non-polymer components in polymer entities, e.g. PXZ in 4HIV
// this is to get non-polymer components in polymer entities,
// e.g. PXZ in 4HIV or generally ACE
//
// one option to optimize this is to expose `_entity_poly.nstd_monomer` in molql
// and only check those entities residue by residue
MS.struct.modifier.union([
......@@ -159,7 +162,13 @@ const ligandPlusConnected = StructureSelectionQuery('Ligand with Connected', MS.
MS.struct.modifier.includeConnected({
0: ligand.expression,
'layer-count': 1,
'as-whole-residues': true
'as-whole-residues': true,
'link-test': MS.core.flags.hasAny([
MS.struct.linkProperty.flags(),
MS.core.type.bitflags([
LinkType.Flag.Covalent | LinkType.Flag.MetallicCoordination
])
])
})
]),
by: branched.expression
......
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