Package org.jmol.dssx

Class AnnotationParser

  • All Implemented Interfaces:
    JmolAnnotationParser
    Direct Known Subclasses:
    DSSR1

    public class AnnotationParser
    extends 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
    • Constructor Detail

      • AnnotationParser

        public AnnotationParser()
    • Method Detail

      • getAnnotationKVPairs

        private void getAnnotationKVPairs​(SV a,
                                          String match,
                                          String dotPath,
                                          javajs.util.SB sb,
                                          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 String getDataKey​(int type)
      • getMainItem

        private SV getMainItem​(Map<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,
                                         String name,
                                         javajs.util.Lst<SV> _list,
                                         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,
                                                  Map<String,​SV> mapping,
                                                  int i)
      • catalogUnit

        private boolean catalogUnit​(Viewer viewer,
                                    float[][] vals,
                                    String unitID,
                                    float val,
                                    javajs.util.BS bsAtoms,
                                    int[] modelAtomIndices,
                                    Map<String,​int[]> resMap,
                                    Map<String,​Integer> atomMap,
                                    Map<String,​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
      • getAtomValidation

        public javajs.util.Lst<Float> getAtomValidation​(Viewer vwr,
                                                        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 String getAnnotationInfo​(Viewer vwr,
                                        SV a,
                                        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 String getAttachedAtomForPDBH​(String group3,
                                             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​(String group3,
                                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