diff --git a/src/mol-model/structure/structure/properties.ts b/src/mol-model/structure/structure/properties.ts index 2f6f437adad97d4bafaf1c4aab97fa5bff7505d6..29c21954a09905c5bd67e6757e1d084b79b18887 100644 --- a/src/mol-model/structure/structure/properties.ts +++ b/src/mol-model/structure/structure/properties.ts @@ -123,6 +123,7 @@ const entity = { const unit = { id: p(l => l.unit.id), + object_primitive: p(l => l.unit.objectPrimitive), operator_name: p(l => l.unit.conformation.operator.name), model_index: p(l => l.unit.model.modelNum), model_label: p(l => l.unit.model.label), diff --git a/src/mol-model/structure/structure/unit.ts b/src/mol-model/structure/structure/unit.ts index a39470bcdcf473a3327806f2a3ce04501ee8f210..88db3d07de3a48fbab4b086f2dca70a19788e487 100644 --- a/src/mol-model/structure/structure/unit.ts +++ b/src/mol-model/structure/structure/unit.ts @@ -17,6 +17,7 @@ import { ChainIndex, ResidueIndex, ElementIndex } from '../model/indexing'; import { IntMap, SortedArray } from '../../../mol-data/int'; import { hash2, hashFnv32a } from '../../../mol-data/util'; import { getAtomicPolymerElements, getCoarsePolymerElements, getAtomicGapElements, getCoarseGapElements, getNucleotideElements, getProteinElements } from './util/polymer'; +import { mmCIF_Schema } from '../../../mol-io/reader/cif/schema/mmcif'; /** * A building block of a structure that corresponds to an atomic or @@ -95,7 +96,7 @@ namespace Unit { export interface Base { readonly id: number, - // invariant ID stays the same even if the Operator/conformation changes. + /** invariant ID stays the same even if the Operator/conformation changes. */ readonly invariantId: number, readonly elements: StructureElement.Set, readonly model: Model, @@ -107,6 +108,10 @@ namespace Unit { readonly lookup3d: Lookup3D readonly polymerElements: SortedArray<ElementIndex> readonly gapElements: SortedArray<ElementIndex> + /** + * From mmCIF/IHM schema: `_ihm_model_representation_details.model_object_primitive`. + */ + readonly objectPrimitive: mmCIF_Schema['ihm_model_representation_details']['model_object_primitive']['T'] } function getSphereRadiusFunc(model: Model) { @@ -130,6 +135,7 @@ namespace Unit { */ export class Atomic implements Base { readonly kind = Kind.Atomic; + readonly objectPrimitive = 'atomistic'; readonly id: number; readonly invariantId: number; @@ -237,6 +243,7 @@ namespace Unit { class Coarse<K extends Kind.Gaussians | Kind.Spheres, C extends CoarseSphereConformation | CoarseGaussianConformation> implements Base { readonly kind: K; + readonly objectPrimitive: 'sphere' | 'gaussian'; readonly id: number; readonly invariantId: number; @@ -287,6 +294,7 @@ namespace Unit { constructor(id: number, invariantId: number, model: Model, kind: K, elements: StructureElement.Set, conformation: SymmetryOperator.ArrayMapping<ElementIndex>, props: CoarseProperties) { this.kind = kind; + this.objectPrimitive = kind === Kind.Spheres ? 'sphere' : 'gaussian' this.id = id; this.invariantId = invariantId; this.model = model; diff --git a/src/mol-script/language/symbol-table/structure-query.ts b/src/mol-script/language/symbol-table/structure-query.ts index b129ba31909cceaf9586e0eab21723e277ffdf3e..252c1b8ac59a79fa3641538fa1a9d49826c7e55e 100644 --- a/src/mol-script/language/symbol-table/structure-query.ts +++ b/src/mol-script/language/symbol-table/structure-query.ts @@ -21,6 +21,7 @@ export namespace Types { export const RingFingerprint = Type.Value('Structure', 'RingFingerprint'); export const EntityType = Type.OneOf('Structure', 'EntityType', Type.Str, ['polymer', 'non-polymer', 'water', 'branched', 'unknown']); + export const ObjectPrimitive = Type.OneOf('Structure', 'ObjectPrimitive', Type.Str, ['atomistic', 'sphere', 'gaussian', 'other']); export const ResidueId = Type.Value('Structure', 'ResidueId'); export const ElementSet = Type.Value('Structure', 'ElementSet'); @@ -268,8 +269,8 @@ const atomProperty = { authResidueId: atomProp(Types.ResidueId, `type.auth-residue-id symbol executed on current atom's residue`), labelResidueId: atomProp(Types.ResidueId, `type.label-residue-id symbol executed on current atom's residue`), - residueKey: atomProp(Type.AnyValue, 'Unique value for each tuple ``(label_entity_id,auth_asym_id,auth_seq_id,pdbx_PDB_ins_code)``, main use case is grouping of atoms'), - chainKey: atomProp(Type.AnyValue, 'Unique value for each tuple ``(label_entity_id,auth_asym_id)``, main use case is grouping of atoms'), + residueKey: atomProp(Type.AnyValue, 'Unique value for each tuple ``(label_entity_id,auth_asym_id, auth_seq_id, pdbx_PDB_ins_code)``, main use case is grouping of atoms'), + chainKey: atomProp(Type.AnyValue, 'Unique value for each tuple ``(label_entity_id, auth_asym_id)``, main use case is grouping of atoms'), entityKey: atomProp(Type.AnyValue, 'Unique value for each tuple ``label_entity_id``, main use case is grouping of atoms'), isHet: atomProp(Type.Bool, 'Equivalent to atom_site.group_PDB !== ATOM'), @@ -294,7 +295,8 @@ const atomProperty = { occupancy: atomProp(Type.Num), B_iso_or_equiv: atomProp(Type.Num), - entityType: atomProp(Types.EntityType, 'Type of the entity as defined in mmCIF (polymer, non-polymer, water, unknown)'), + entityType: atomProp(Types.EntityType, 'Type of the entity as defined in mmCIF (polymer, non-polymer, branched, water, unknown)'), + objectPrimitive: atomProp(Types.ObjectPrimitive, 'Type of the primitive object used to model this segment as defined in mmCIF/IHM (atomistic, sphere, gaussian, other)'), secondaryStructureKey: atomProp(Type.AnyValue, 'Unique value for each secondary structure element.'), secondaryStructureFlags: atomProp(Types.SecondaryStructureFlags), diff --git a/src/mol-script/runtime/query/table.ts b/src/mol-script/runtime/query/table.ts index 9e839455d75f522b383c13363c7195db8ef3fea9..eeb4edc181032ab037f7bb3d34a0af795237c38c 100644 --- a/src/mol-script/runtime/query/table.ts +++ b/src/mol-script/runtime/query/table.ts @@ -299,6 +299,7 @@ const symbols = [ D(MolScript.structureQuery.atomProperty.macromolecular.B_iso_or_equiv, atomProp(StructureProperties.atom.B_iso_or_equiv)), D(MolScript.structureQuery.atomProperty.macromolecular.entityType, atomProp(StructureProperties.entity.type)), + D(MolScript.structureQuery.atomProperty.macromolecular.objectPrimitive, atomProp(StructureProperties.unit.object_primitive)), D(MolScript.structureQuery.atomProperty.macromolecular.isModified, (ctx, _) => ctx.element.unit.model.properties.modifiedResidues.parentId.has(StructureProperties.residue.label_comp_id(ctx.element))), D(MolScript.structureQuery.atomProperty.macromolecular.modifiedParentName, (ctx, _) => { diff --git a/src/mol-script/script/mol-script/symbols.ts b/src/mol-script/script/mol-script/symbols.ts index 448314896769a4adb90c79cfc48e179fdc72ca50..7c2566ca43965fc9a510f29ecdafefe3daa66f28 100644 --- a/src/mol-script/script/mol-script/symbols.ts +++ b/src/mol-script/script/mol-script/symbols.ts @@ -229,6 +229,7 @@ export const SymbolTable = [ Alias(MolScript.structureQuery.atomProperty.macromolecular.occupancy, 'atom.occupancy'), Alias(MolScript.structureQuery.atomProperty.macromolecular.B_iso_or_equiv, 'atom.B_iso_or_equiv', 'atom.bfactor'), Alias(MolScript.structureQuery.atomProperty.macromolecular.entityType, 'atom.entity-type'), + Alias(MolScript.structureQuery.atomProperty.macromolecular.objectPrimitive, 'atom.object-primitive'), Alias(MolScript.structureQuery.atomProperty.macromolecular.secondaryStructureKey, 'atom.key.sec-struct'),