Skip to content
Snippets Groups Projects
Select Git revision
  • d0bf08d0a3a0b0fd3ae3fadeda288bd2f857d68b
  • master default protected
  • rednatco-v2
  • rednatco
  • test
  • ntc-tube-uniform-color
  • ntc-tube-missing-atoms
  • restore-vertex-array-per-program
  • watlas2
  • dnatco_new
  • cleanup-old-nodejs
  • webmmb
  • fix_auth_seq_id
  • update_deps
  • ext_dev
  • ntc_balls
  • nci-2
  • plugin
  • bugfix-0.4.5
  • nci
  • servers
  • v0.5.0-dev.1
  • v0.4.5
  • v0.4.4
  • v0.4.3
  • v0.4.2
  • v0.4.1
  • v0.4.0
  • v0.3.12
  • v0.3.11
  • v0.3.10
  • v0.3.9
  • v0.3.8
  • v0.3.7
  • v0.3.6
  • v0.3.5
  • v0.3.4
  • v0.3.3
  • v0.3.2
  • v0.3.1
  • v0.3.0
41 results

structure-query.ts

Blame
  • structure-query.ts 16.78 KiB
    /**
     * Copyright (c) 2018 Mol* contributors, licensed under MIT, See LICENSE file for more info.
     *
     * @author David Sehnal <david.sehnal@gmail.com>
     */
    
    import Type from '../type'
    import * as Core from './core'
    import { Arguments, Argument } from '../symbol'
    import { symbol } from '../helpers'
    
    export namespace Types {
        export const ElementSymbol = Type.Value('Structure', 'ElementSymbol');
        export const AtomName = Type.Value('Structure', 'AtomName');
    
        export const BondFlag = Type.OneOf('Structure', 'BondFlag', Type.Str, ['covalent', 'metallic', 'ion', 'hydrogen', 'sulfide', 'computed', 'aromatic']);
        export const BondFlags = Core.Types.Flags(BondFlag, 'BondFlags');
    
        export const SecondaryStructureFlag = Type.OneOf('Structure', 'SecondaryStructureFlag', Type.Str, ['alpha', 'beta', '3-10', 'pi', 'sheet', 'strand', 'helix', 'turn', 'none']);
        export const SecondaryStructureFlags = Core.Types.Flags(SecondaryStructureFlag, 'SecondaryStructureFlag');
    
        export const RingFingerprint = Type.Value('Structure', 'RingFingerprint');
        export const EntityType = Type.OneOf('Structure', 'EntityType', Type.Str, ['polymer', 'non-polymer', 'water', 'unknown']);
        export const ResidueId = Type.Value('Structure', 'ResidueId');
    
        export const ElementSet = Type.Value('Structure', 'ElementSet');
        export const ElementSelection = Type.Value('Structure', 'ElementSelection');
        export const ElementReference = Type.Value('Structure', 'ElementReference');
    
        export const ElementSelectionQuery = Core.Types.Fn(ElementSelection, 'ElementSelectionQuery');
    }
    
    const type = {
        '@header': 'Types',
        elementSymbol: symbol(
            Arguments.Dictionary({ 0: Argument(Type.Str) }),
            Types.ElementSymbol, 'Create element symbol representation from a string value.'),
    
        atomName: symbol(
            Arguments.Dictionary({ 0: Argument(Type.AnyValue) }), Types.AtomName, 'Convert a value to an atom name.'),
    
        entityType: symbol(
            Arguments.Dictionary({ 0: Argument(Types.EntityType) }),
            Types.EntityType,
            `Create normalized representation of entity type: ${Type.oneOfValues(Types.EntityType).join(', ')}.`),
    
        bondFlags: symbol(
            Arguments.List(Types.BondFlag),
            Types.BondFlags,
            `Create bond flags representation from a list of strings. Allowed flags: ${Type.oneOfValues(Types.BondFlag).join(', ')}.`),
    
        ringFingerprint: symbol(
            Arguments.List(Types.ElementSymbol, { nonEmpty: true }),
            Types.RingFingerprint,
            'Create ring fingerprint from the supplied atom element list.'),
    
        secondaryStructureFlags: symbol(
            Arguments.List(Types.SecondaryStructureFlag),
            Types.SecondaryStructureFlags,
            `Create secondary structure flags representation from a list of strings. Allowed flags: ${Type.oneOfValues(Types.SecondaryStructureFlag).join(', ')}.`),
    
        authResidueId: symbol(Arguments.Dictionary({
            0: Argument(Type.Str, { description: 'auth_asym_id' }),
            1: Argument(Type.Num, { description: 'auth_seq_id' }),
            2: Argument(Type.Str, { description: 'pdbx_PDB_ins_code', isOptional: true })
        }), Types.ResidueId, `Residue identifier based on "auth_" annotation.`),
        labelResidueId: symbol(Arguments.Dictionary({
            0: Argument(Type.Str, { description: 'label_entity_id' }),
            1: Argument(Type.Str, { description: 'label_asym_id' }),
            2: Argument(Type.Num, { description: 'label_seq_id' }),