AnnotationParser
Date: 2019-10-22

org.jmol.dssx

## Class AnnotationParser

- java.lang.Object
- - org.jmol.dssx.AnnotationParser

- All Implemented Interfaces:
    JmolAnnotationParser
  Direct Known Subclasses:
    DSSR1

      public class AnnotationParser
      extends java.lang.Object
      implements JmolAnnotationParser

  A parser for output from 3DNA web service. load =1d66/dssr also other annotations now, load *1cbs/dom calls EBI for the mmCIF file and also retrieves the domains mapping JSON report. load *1cbs/val calls EBI for the mmCIF file and also retrieves the validation outliers JSON report. Bob Hanson July 2014
  Author:
    Bob Hanson hansonr@stolaf.edu

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `private static java.util.Map<java.lang.String,java.lang.String>` | `pdbAtomForH`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `AnnotationParser()`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `private void` | `assignPDBH(java.lang.String group3, java.lang.String sNames)`
    `java.lang.String` | `calculateDSSRStructure(Viewer vwr, javajs.util.BS bsAtoms)`
    `java.lang.String` | `catalogStructureUnits(Viewer viewer, SV map0, int[] modelAtomIndices, java.util.Map<java.lang.String,int[]> resMap, java.lang.Object object, java.util.Map<java.lang.String,java.lang.Integer> modelMap)`
    `private boolean` | `catalogUnit(Viewer viewer, float[][] vals, java.lang.String unitID, float val, javajs.util.BS bsAtoms, int[] modelAtomIndices, java.util.Map<java.lang.String,int[]> resMap, java.util.Map<java.lang.String,java.lang.Integer> atomMap, java.util.Map<java.lang.String,java.lang.Integer> modelMap)` Carried out for each unit
    `javajs.util.Lst<java.lang.Object>` | `catalogValidations(Viewer viewer, SV map0, int[] modelAtomIndices, java.util.Map<java.lang.String,int[]> resMap, java.util.Map<java.lang.String,java.lang.Integer> atomMap, java.util.Map<java.lang.String,java.lang.Integer> modelMap)` Returns a Lst
    `private void` | `findAnnotationAtoms(Viewer vwr, java.lang.String name, javajs.util.Lst<SV> _list, java.lang.String key, javajs.util.BS bs)` find annotations; allows for wild cards InterPro.* where .....
    `void` | `fixAtoms(int modelIndex, SV dbObj, javajs.util.BS bsAddedMask, int type, int margin)` Adjusts _atoms bitset to account for added hydrogen atoms.
    `java.lang.String` | `fixDSSRJSONMap(java.util.Map<java.lang.String,java.lang.Object> map)`
    `java.lang.String` | `getAnnotationInfo(Viewer vwr, SV a, java.lang.String match, int type, int modelIndex)` Get a string report of annotation data
    `private void` | `getAnnotationKVPairs(SV a, java.lang.String match, java.lang.String dotPath, javajs.util.SB sb, java.lang.String pre, boolean showDetail, boolean isMappingOnly, int type)` Construct a nice listing for this annotation, including validation
    `javajs.util.BS` | `getAtomBits(Viewer vwr, java.lang.String key, java.lang.Object dbObj, java.util.Map<java.lang.String,java.lang.Object> annotationCache, int type, int modelIndex, javajs.util.BS bsModel)`
    `void` | `getAtomicDSSRData(ModelSet ms, int modelIndex, float[] dssrData, java.lang.String dataType)`
    `javajs.util.Lst<java.lang.Float>` | `getAtomValidation(Viewer vwr, java.lang.String type, Atom atom)` Get all validation values corresponding to a specific validation type.
    `java.lang.String` | `getAttachedAtomForPDBH(java.lang.String group3, java.lang.String name)` Finds the standard attached heavy atom for a PDB H atom; used in EBI clash validation.
    `void` | `getBasePairs(Viewer vwr, int modelIndex)`
    `private java.lang.String` | `getDataKey(int type)`
    `javajs.util.P3[]` | `getDSSRFrame(java.util.Map<java.lang.String,java.lang.Object> dssrNT)`
    `java.lang.String` | `getHBonds(ModelSet ms, int modelIndex, javajs.util.Lst<Bond> vHBonds, boolean doReport)`
    `private SV` | `getMainItem(java.util.Map<java.lang.String,SV> data)`
    `javajs.util.Lst<SV>` | `initializeAnnotation(SV objAnn, int type, int modelIndex)` We create a main list of mappings, where each mapping has _atoms and _path
    `private javajs.util.BS` | `setAnnotationAtoms(Viewer vwr, java.util.Map<java.lang.String,SV> mapping, int i)`
    `void` | `setGroup1(ModelSet ms, int modelIndex)`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### pdbAtomForH

          private static java.util.Map<java.lang.String,java.lang.String> pdbAtomForH

  - ### Constructor Detail

    - #### AnnotationParser

          public AnnotationParser()

  - ### Method Detail

    - #### getAnnotationKVPairs

          private void getAnnotationKVPairs(SV a,
                                            java.lang.String match,
                                            java.lang.String dotPath,
                                            javajs.util.SB sb,
                                            java.lang.String pre,
                                            boolean showDetail,
                                            boolean isMappingOnly,
                                            int type)

      Construct a nice listing for this annotation, including validation
      Parameters:
        `a` -
        `match` -
        `dotPath` -
        `sb` -
        `pre` -
        `showDetail` -
        `isMappingOnly` -
        `type` -

    - #### getDataKey

          private java.lang.String getDataKey(int type)

    - #### catalogStructureUnits

          public java.lang.String catalogStructureUnits(Viewer viewer,
                                                        SV map0,
                                                        int[] modelAtomIndices,
                                                        java.util.Map<java.lang.String,int[]> resMap,
                                                        java.lang.Object object,
                                                        java.util.Map<java.lang.String,java.lang.Integer> modelMap)

      Specified by:
        `catalogStructureUnits` in interface `JmolAnnotationParser`

    - #### catalogValidations

          public javajs.util.Lst<java.lang.Object> catalogValidations(Viewer viewer,
                                                                      SV map0,
                                                                      int[] modelAtomIndices,
                                                                      java.util.Map<java.lang.String,int[]> resMap,
                                                                      java.util.Map<java.lang.String,java.lang.Integer> atomMap,
                                                                      java.util.Map<java.lang.String,java.lang.Integer> modelMap)

      Returns a Lst
      Specified by:
        `catalogValidations` in interface `JmolAnnotationParser`

    - #### getMainItem

          private SV getMainItem(java.util.Map<java.lang.String,SV> data)

    - #### initializeAnnotation

          public javajs.util.Lst<SV> initializeAnnotation(SV objAnn,
                                                          int type,
                                                          int modelIndex)

      We create a main list of mappings, where each mapping has _atoms and _path
      Specified by:
        `initializeAnnotation` in interface `JmolAnnotationParser`
      Parameters:
        `objAnn` -
      Returns:
        Lst of mappings

    - #### findAnnotationAtoms

          private void findAnnotationAtoms(Viewer vwr,
                                           java.lang.String name,
                                           javajs.util.Lst<SV> _list,
                                           java.lang.String key,
                                           javajs.util.BS bs)

      find annotations; allows for wild cards InterPro.* where .....
      Parameters:
        `vwr` -
        `name` -
        `_list` -
        `key` -
        `bs` -

    - #### setAnnotationAtoms

          private javajs.util.BS setAnnotationAtoms(Viewer vwr,
                                                    java.util.Map<java.lang.String,SV> mapping,
                                                    int i)

    - #### catalogUnit

          private boolean catalogUnit(Viewer viewer,
                                      float[][] vals,
                                      java.lang.String unitID,
                                      float val,
                                      javajs.util.BS bsAtoms,
                                      int[] modelAtomIndices,
                                      java.util.Map<java.lang.String,int[]> resMap,
                                      java.util.Map<java.lang.String,java.lang.Integer> atomMap,
                                      java.util.Map<java.lang.String,java.lang.Integer> modelMap)

      Carried out for each unit
      Parameters:
        `viewer` -
        `vals` - model-based array of float values for a given validation type
        `unitID` -
        `val` -
        `bsAtoms` -
        `modelAtomIndices` -
        `resMap` -
        `atomMap` -
        `modelMap` - TODO
      Returns:
        true if this is residue-based validation (to be added to H atoms when pdbAddHydrogens is set

    - #### getAtomBits

          public javajs.util.BS getAtomBits(Viewer vwr,
                                            java.lang.String key,
                                            java.lang.Object dbObj,
                                            java.util.Map<java.lang.String,java.lang.Object> annotationCache,
                                            int type,
                                            int modelIndex,
                                            javajs.util.BS bsModel)

      Specified by:
        `getAtomBits` in interface `JmolAnnotationParser`

    - #### getAtomValidation

          public javajs.util.Lst<java.lang.Float> getAtomValidation(Viewer vwr,
                                                                    java.lang.String type,
                                                                    Atom atom)

      Get all validation values corresponding to a specific validation type. Used by label %[validation.clashes]
      Specified by:
        `getAtomValidation` in interface `JmolAnnotationParser`
      Parameters:
        `vwr` -
        `type` - e.g. "clashes"
        `atom` -
      Returns:
        a list of Float values associated with this atom and this type of validation

    - #### getAnnotationInfo

          public java.lang.String getAnnotationInfo(Viewer vwr,
                                                    SV a,
                                                    java.lang.String match,
                                                    int type,
                                                    int modelIndex)

      Get a string report of annotation data
      Specified by:
        `getAnnotationInfo` in interface `JmolAnnotationParser`
      Parameters:
        `a` - an annotation structure wrapped as a script variable
        `match` - can contain "mappings" to get those specifically
      Returns:
        tab-separated line-based listing

    - #### getAttachedAtomForPDBH

          public java.lang.String getAttachedAtomForPDBH(java.lang.String group3,
                                                         java.lang.String name)

      Finds the standard attached heavy atom for a PDB H atom; used in EBI clash validation.
      Parameters:
        `group3` -
        `name` -
      Returns:
        name of attached atom or hName

    - #### assignPDBH

          private void assignPDBH(java.lang.String group3,
                                  java.lang.String sNames)

    - #### fixAtoms

          public void fixAtoms(int modelIndex,
                               SV dbObj,
                               javajs.util.BS bsAddedMask,
                               int type,
                               int margin)

      Adjusts _atoms bitset to account for added hydrogen atoms. A margin of 20 allows for 20 added H atoms per group
      Specified by:
        `fixAtoms` in interface `JmolAnnotationParser`

    - #### getBasePairs

          public void getBasePairs(Viewer vwr,
                                   int modelIndex)

      Specified by:
        `getBasePairs` in interface `JmolAnnotationParser`

    - #### calculateDSSRStructure

          public java.lang.String calculateDSSRStructure(Viewer vwr,
                                                         javajs.util.BS bsAtoms)

      Specified by:
        `calculateDSSRStructure` in interface `JmolAnnotationParser`

    - #### fixDSSRJSONMap

          public java.lang.String fixDSSRJSONMap(java.util.Map<java.lang.String,java.lang.Object> map)

      Specified by:
        `fixDSSRJSONMap` in interface `JmolAnnotationParser`

    - #### getHBonds

          public java.lang.String getHBonds(ModelSet ms,
                                            int modelIndex,
                                            javajs.util.Lst<Bond> vHBonds,
                                            boolean doReport)

      Specified by:
        `getHBonds` in interface `JmolAnnotationParser`

    - #### getAtomicDSSRData

          public void getAtomicDSSRData(ModelSet ms,
                                        int modelIndex,
                                        float[] dssrData,
                                        java.lang.String dataType)

      Specified by:
        `getAtomicDSSRData` in interface `JmolAnnotationParser`

    - #### setGroup1

          public void setGroup1(ModelSet ms,
                                int modelIndex)

      Specified by:
        `setGroup1` in interface `JmolAnnotationParser`

    - #### getDSSRFrame

          public javajs.util.P3[] getDSSRFrame(java.util.Map<java.lang.String,java.lang.Object> dssrNT)

      Specified by:
        `getDSSRFrame` in interface `JmolAnnotationParser`