BioExt
Date: 2019-10-22

org.jmol.modelsetbio

## Class BioExt

- java.lang.Object
- - org.jmol.modelsetbio.BioExt

-     public class BioExt
      extends java.lang.Object

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `private static java.lang.String` | `aaPlus`
    `private static java.lang.String` | `aaSp2`
    `private static java.lang.String` | `aaSp21`
    `private ModelSet` | `ms`
    `private static java.lang.String` | `naNoH`
    `private static java.lang.String[]` | `pdbRecords`
    `private static java.lang.String[]` | `qColor`
    `private Viewer` | `vwr`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `BioExt()`

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `(package private) int` | `calculateAllstruts(Viewer vwr, ModelSet ms, javajs.util.BS bs1, javajs.util.BS bs2)`
    `(package private) void` | `calculateStraightnessAll()`
    `private static javajs.util.Lst<Atom[]>` | `calculateStruts(ModelSet modelSet, javajs.util.BS bs1, javajs.util.BS bs2, javajs.util.Lst<Atom> vCA, float thresh, int delta, boolean allowMultiple)` Algorithm of George Phillips phillips@biochem.wisc.edu originally a contribution to pyMol as struts.py; adapted here by Bob Hanson for Jmol 1/2010 Return a vector of support posts for rapid prototyping models along the lines of George Phillips for Pymol except on actual molecular segments (biopolymers), not PDB chains (which may or may not be continuous).
    `(package private) static java.lang.String` | `drawQuat(javajs.util.Quat q, java.lang.String prefix, java.lang.String id, javajs.util.P3 ptCenter, float scale)`
    `private static float` | `get3DStraightness(java.lang.String id, javajs.util.Quat dq, javajs.util.Quat dqnext)`
    `(package private) void` | `getAllPolymerInfo(javajs.util.BS bs, java.util.Map<java.lang.String,javajs.util.Lst<java.util.Map<java.lang.String,java.lang.Object>>> fullInfo)`
    `(package private) boolean` | `getAminoAcidValenceAndCharge(java.lang.String res, java.lang.String name, int[] ret)` returns an array if we have special hybridization or charge
    `private void` | `getData(int m0, int mStep, BioPolymer p, char ctype, char qtype, int derivType, javajs.util.BS bsAtoms, javajs.util.BS bsSelected, boolean isDraw, boolean isRamachandran, boolean calcRamachandranStraightness, boolean useQuaternionStraightness, boolean writeRamachandranStraightness, boolean quaternionStraightness, float factor, boolean isAmino, boolean isRelativeAlias, LabelToken[] tokens, javajs.util.OC pdbATOM, javajs.util.SB pdbCONECT, javajs.util.BS bsWritten, javajs.util.P3 ptTemp)`
    `(package private) java.lang.String` | `getFullPDBHeader(java.util.Map<java.lang.String,java.lang.Object> auxiliaryInfo)`
    `private static Atom[]` | `getMutationBackbone(AminoMonomer res1, Atom[] backbone)`
    `private void` | `getPdbData(BioPolymer bp, char ctype, char qtype, int mStep, int derivType, javajs.util.BS bsAtoms, javajs.util.BS bsSelected, boolean bothEnds, boolean isDraw, boolean addHeader, LabelToken[] tokens, javajs.util.OC pdbATOM, javajs.util.SB pdbCONECT, javajs.util.BS bsWritten, javajs.util.P3 ptTemp)`
    `(package private) void` | `getPdbDataM(BioModel m, Viewer vwr, java.lang.String type, char ctype, boolean isDraw, javajs.util.BS bsSelected, javajs.util.OC out, LabelToken[] tokens, javajs.util.SB pdbCONECT, javajs.util.BS bsWritten)`
    `private static java.lang.String` | `getQInfo(javajs.util.Quat q)`
    `private static float` | `getQuaternionStraightness(java.lang.String id, javajs.util.Quat dq, javajs.util.Quat dqnext)`
    `private static float` | `getStraightness(float cosHalfTheta)`
    `(package private) boolean` | `mutate(Viewer vwr, javajs.util.BS bs, java.lang.String group, java.lang.String[] sequence)`
    `private static boolean` | `mutateAtom(Viewer vwr, int iatom, java.lang.String fileName)`
    `private static void` | `replaceMutatedMonomer(Viewer vwr, AminoMonomer res0, AminoMonomer res1)`
    `(package private) BioExt` | `set(Viewer vwr, ModelSet ms)`
    `private static void` | `setStrut(int i, int j, int n, javajs.util.Lst<Atom> vCA, javajs.util.BS bs1, javajs.util.BS bs2, javajs.util.Lst<Atom[]> vStruts, javajs.util.BS bsStruts, javajs.util.BS bsNotAvailable, javajs.util.BS bsNearbyResidues, int delta)`
    `private static int` | `strutPoint(int i, int j, int n)`

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

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

- - ### Field Detail

    - #### vwr

          private Viewer vwr

    - #### ms

          private ModelSet ms

    - #### qColor

          private static final java.lang.String[] qColor

    - #### pdbRecords

          private static final java.lang.String[] pdbRecords

    - #### naNoH

          private static final java.lang.String naNoH

      See Also:
        Constant Field Values

    - #### aaSp2

          private static final java.lang.String aaSp2

      See Also:
        Constant Field Values

    - #### aaSp21

          private static final java.lang.String aaSp21

      See Also:
        Constant Field Values

    - #### aaPlus

          private static final java.lang.String aaPlus

      See Also:
        Constant Field Values

  - ### Constructor Detail

    - #### BioExt

          public BioExt()

  - ### Method Detail

    - #### set

          BioExt set(Viewer vwr,
                     ModelSet ms)

    - #### getAllPolymerInfo

          void getAllPolymerInfo(javajs.util.BS bs,
                                 java.util.Map<java.lang.String,javajs.util.Lst<java.util.Map<java.lang.String,java.lang.Object>>> fullInfo)

    - #### calculateStraightnessAll

          void calculateStraightnessAll()

    - #### getPdbData

          private void getPdbData(BioPolymer bp,
                                  char ctype,
                                  char qtype,
                                  int mStep,
                                  int derivType,
                                  javajs.util.BS bsAtoms,
                                  javajs.util.BS bsSelected,
                                  boolean bothEnds,
                                  boolean isDraw,
                                  boolean addHeader,
                                  LabelToken[] tokens,
                                  javajs.util.OC pdbATOM,
                                  javajs.util.SB pdbCONECT,
                                  javajs.util.BS bsWritten,
                                  javajs.util.P3 ptTemp)

    - #### getData

          private void getData(int m0,
                               int mStep,
                               BioPolymer p,
                               char ctype,
                               char qtype,
                               int derivType,
                               javajs.util.BS bsAtoms,
                               javajs.util.BS bsSelected,
                               boolean isDraw,
                               boolean isRamachandran,
                               boolean calcRamachandranStraightness,
                               boolean useQuaternionStraightness,
                               boolean writeRamachandranStraightness,
                               boolean quaternionStraightness,
                               float factor,
                               boolean isAmino,
                               boolean isRelativeAlias,
                               LabelToken[] tokens,
                               javajs.util.OC pdbATOM,
                               javajs.util.SB pdbCONECT,
                               javajs.util.BS bsWritten,
                               javajs.util.P3 ptTemp)

      Parameters:
        `m0` -
        `mStep` -
        `p` -
        `ctype` -
        `qtype` -
        `derivType` -
        `bsAtoms` -
        `bsSelected` -
        `isDraw` -
        `isRamachandran` -
        `calcRamachandranStraightness` -
        `useQuaternionStraightness` -
        `writeRamachandranStraightness` -
        `quaternionStraightness` - NOT USED
        `factor` -
        `isAmino` -
        `isRelativeAlias` -
        `tokens` -
        `pdbATOM` -
        `pdbCONECT` -
        `bsWritten` -
        `ptTemp` -

    - #### getQInfo

          private static java.lang.String getQInfo(javajs.util.Quat q)

    - #### drawQuat

          static java.lang.String drawQuat(javajs.util.Quat q,
                                           java.lang.String prefix,
                                           java.lang.String id,
                                           javajs.util.P3 ptCenter,
                                           float scale)

    - #### get3DStraightness

          private static float get3DStraightness(java.lang.String id,
                                                 javajs.util.Quat dq,
                                                 javajs.util.Quat dqnext)

      Parameters:
        `id` - for debugging only
        `dq` -
        `dqnext` -
      Returns:
        calculated straightness

    - #### getQuaternionStraightness

          private static float getQuaternionStraightness(java.lang.String id,
                                                         javajs.util.Quat dq,
                                                         javajs.util.Quat dqnext)

      Parameters:
        `id` - for debugging only
        `dq` -
        `dqnext` -
      Returns:
        straightness

    - #### getStraightness

          private static float getStraightness(float cosHalfTheta)

    - #### getPdbDataM

          void getPdbDataM(BioModel m,
                           Viewer vwr,
                           java.lang.String type,
                           char ctype,
                           boolean isDraw,
                           javajs.util.BS bsSelected,
                           javajs.util.OC out,
                           LabelToken[] tokens,
                           javajs.util.SB pdbCONECT,
                           javajs.util.BS bsWritten)

    - #### calculateAllstruts

          int calculateAllstruts(Viewer vwr,
                                 ModelSet ms,
                                 javajs.util.BS bs1,
                                 javajs.util.BS bs2)

    - #### calculateStruts

          private static javajs.util.Lst<Atom[]> calculateStruts(ModelSet modelSet,
                                                                 javajs.util.BS bs1,
                                                                 javajs.util.BS bs2,
                                                                 javajs.util.Lst<Atom> vCA,
                                                                 float thresh,
                                                                 int delta,
                                                                 boolean allowMultiple)

      Algorithm of George Phillips phillips@biochem.wisc.edu originally a contribution to pyMol as struts.py; adapted here by Bob Hanson for Jmol 1/2010 Return a vector of support posts for rapid prototyping models along the lines of George Phillips for Pymol except on actual molecular segments (biopolymers), not PDB chains (which may or may not be continuous). Like George, we go from thresh-4 to thresh in units of 1 Angstrom, but we do not require this threshold to be an integer. In addition, we prevent double-creation of struts by tracking where struts are, and we do not look for any addtional end struts if there is a strut already to an atom at a particular biopolymer end. The three parameters are: set strutDefaultRadius 0.3 set strutSpacingMinimum 6 set strutLengthMaximum 7.0 Struts will be introduced by: calculate struts {atom set A} {atom set B} where the two atom sets are optional and default to the currently selected set. They can be manipulated using the STRUTS command much like any "bond" struts 0.3 color struts opaque pink connect {atomno=3} {atomno=4} strut struts only command
      Parameters:
        `modelSet` -
        `bs1` -
        `bs2` -
        `vCA` -
        `thresh` -
        `delta` -
        `allowMultiple` -
      Returns:
        vector of pairs of atoms

    - #### strutPoint

          private static int strutPoint(int i,
                                        int j,
                                        int n)

    - #### setStrut

          private static void setStrut(int i,
                                       int j,
                                       int n,
                                       javajs.util.Lst<Atom> vCA,
                                       javajs.util.BS bs1,
                                       javajs.util.BS bs2,
                                       javajs.util.Lst<Atom[]> vStruts,
                                       javajs.util.BS bsStruts,
                                       javajs.util.BS bsNotAvailable,
                                       javajs.util.BS bsNearbyResidues,
                                       int delta)

    - #### mutate

          boolean mutate(Viewer vwr,
                         javajs.util.BS bs,
                         java.lang.String group,
                         java.lang.String[] sequence)

    - #### mutateAtom

          private static boolean mutateAtom(Viewer vwr,
                                            int iatom,
                                            java.lang.String fileName)

    - #### replaceMutatedMonomer

          private static void replaceMutatedMonomer(Viewer vwr,
                                                    AminoMonomer res0,
                                                    AminoMonomer res1)

    - #### getMutationBackbone

          private static Atom[] getMutationBackbone(AminoMonomer res1,
                                                    Atom[] backbone)

      Parameters:
        `res1` -
        `backbone` -
      Returns:
        [C O CA N H]

    - #### getFullPDBHeader

          java.lang.String getFullPDBHeader(java.util.Map<java.lang.String,java.lang.Object> auxiliaryInfo)

    - #### getAminoAcidValenceAndCharge

          boolean getAminoAcidValenceAndCharge(java.lang.String res,
                                               java.lang.String name,
                                               int[] ret)

      returns an array if we have special hybridization or charge
      Parameters:
        `res` -
        `name` -
        `ret` - [0] (target valence) may be reduced by one for sp2 for C or O only [1] will be set to 1 if positive (lysine or terminal N) or -1 if negative (OXT) [2] will be set to 2 if sp2 [3] is supplied covalent bond count
      Returns:
        true for special; false if not