Package org.jmol.dssx

Class 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 Description
      private static java.util.Map<java.lang.String,​java.lang.String> pdbAtomForH  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      private void assignPDBH​(java.lang.String group3, java.lang.String sNames)  
      java.lang.String calculateDSSRStructure​(Viewer vwr, 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, 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 of property data in the form name(String), data(float[]), modelIndex (Integer), isGroup (Boolean);
      private void findAnnotationAtoms​(Viewer vwr, java.lang.String name, javajs.util.Lst<SV> _list, java.lang.String key, BS bs)
      find annotations; allows for wild cards InterPro.* where .....
      void fixAtoms​(int modelIndex, SV dbObj, 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
      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, BS bsModel)  
      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)  
      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 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 of property data in the form name(String), data(float[]), modelIndex (Integer), isGroup (Boolean);
        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,
                                           BS bs)
          find annotations; allows for wild cards InterPro.* where .....
          Parameters:
          vwr -
          name -
          _list -
          key -
          bs -
        • setAnnotationAtoms

          private 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,
                                      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 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,
                                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,
                               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
        • fixDSSRJSONMap

          public java.lang.String fixDSSRJSONMap​(java.util.Map<java.lang.String,​java.lang.Object> map)
          Specified by:
          fixDSSRJSONMap in interface JmolAnnotationParser