Skip to content
Snippets Groups Projects
Select Git revision
  • 309c25e10bcef28df0b3928642b8bc63178a0213
  • 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

keywords.ts

Blame
  • keywords.ts 17.65 KiB
    /**                                                                                                                                        
     * Copyright (c) 2017-2021 mol* contributors, licensed under MIT, See LICENSE file for more info.                                           
     * @author Alexander Rose <alexander.rose@weirdbyte.de>                                                                                      * @author Panagiotis Tourlas <panagiot_tourlov@hotmail.com>                                                                                 *
     * @author Koya Sakuma                                                                                                                       * This module was taken from MolQL and modified in similar manner as pymol and vmd tranpilers.
    **/
    
    
    import { MolScriptBuilder } from '../../../mol-script/language/builder';
    const B = MolScriptBuilder;
    import * as h from '../helper';
    import { KeywordDict } from '../types';
    
    
    function nucleicExpr() {
      return B.struct.combinator.merge([
        B.struct.generator.atomGroups({
          'residue-test': B.core.set.has([
            B.set(...['G', 'C', 'A', 'T', 'U', 'I', 'DG', 'DC', 'DA', 'DT', 'DU', 'DI', '+G', '+C', '+A', '+T', '+U', '+I']),
            B.ammp('label_comp_id')
          ])
        }),
        B.struct.filter.pick({
          0: B.struct.generator.atomGroups({
            'group-by': B.ammp('residueKey')
          }),
          test: B.core.logic.and([
            B.core.rel.eq([ B.struct.atomSet.atomCount(), 1 ]),
            B.core.rel.eq([ B.ammp('label_atom_id'), B.atomName('P') ]),
          ])
        }),
        B.struct.filter.pick({
          0: B.struct.generator.atomGroups({
            'group-by': B.ammp('residueKey')
          }),
          test: B.core.logic.or([
            B.core.set.isSubset([
              h.atomNameSet([ "C1'", "C2'", "O3'", "C3'", "C4'", "C5'", "O5'" ]),
              B.ammpSet('label_atom_id')
            ]),
            B.core.set.isSubset([
              h.atomNameSet([ 'C1*', 'C2*', 'O3*', 'C3*', 'C4*', 'C5*', 'O5*' ]),
              B.ammpSet('label_atom_id')
            ])
          ])
        })
      ])
    }
    
    const ResDict = {
      acidic: ['ASP', 'GLU'],
      aliphatic: ['ALA', 'GLY', 'ILE', 'LEU', 'VAL'],
      amino: ['ALA', 'ARG', 'ASN', 'ASP', 'CYS', 'GLN', 'GLU', 'GLY', 'HIS', 'ILE', 'LEU', 'LYS', 'MET', 'PHE', 'PRO', 'SER', 'THR', 'TRP', 'TYR', 'VAL', 'ASX', 'GLX', 'UNK', ],
      aromatic: ['HIS', 'PHE', 'TRP', 'TYR'],
      basic: ['ARG', 'HIS', 'LYS'],
      buried: ['ALA','CYS', 'ILE', 'LEU', 'MET', 'PHE', 'TRP', 'VAL'],
      cg: ['CYT', 'C', 'GUA', 'G'],
      cyclic: ['HIS', 'PHE', 'PRO', 'TRP', 'TYR'],
      hydrophobic: ['ALA', 'GLY', 'ILE', 'LEU', 'MET', 'PHE', 'PRO', 'TRP', 'TYR', 'VAL'],
      large: ['ARG', 'GLU', 'GLN', 'HIS', 'ILE', 'LEU', 'LYS', 'MET', 'PHE', 'TRP', 'TYR'],
      medium: ['ASN', 'ASP', 'CYS', 'PRO', 'THR', 'VAL'],
      small: ['ALA', 'GLY', 'SER'],
    }
    
    export const keywords: KeywordDict = {
      // general terms
      all: {
        '@desc': 'all atoms; same as *',
        abbr: ['*'],
        map: () => B.struct.generator.atomGroups()
      },