public static void main(String[] args) {
    try {

      Structure struc = StructureIO.getStructure("1aoi");

      StructureAlignmentJmol jmolPanel = new StructureAlignmentJmol();

      jmolPanel.setStructure(struc);

      // send some RASMOL style commands to Jmol
      jmolPanel.evalString("select * ; color chain;");
      jmolPanel.evalString("select nucleic; cartoon on;");
      jmolPanel.evalString("select *; spacefill off; wireframe off; cartoon on;  ");
    } catch (Exception e) {
      e.printStackTrace();
    }
  }
Example #2
0
  private void updateJmolDisplay() {

    if (jmol == null) return;

    int size = afpChain.getAlnLength();

    StringBuffer cmd = new StringBuffer("select ");

    int nrSelected = 0;
    try {

      for (int i = 0; i < size; i++) {
        if (selection.get(i)) {

          Atom a1 = DisplayAFP.getAtomForAligPos(afpChain, 0, i, ca1, false);
          Atom a2 = DisplayAFP.getAtomForAligPos(afpChain, 1, i, ca2, false);

          String select1 = "";

          if (a1 != null) select1 = JmolTools.getPdbInfo(a1);
          String select2 = "";
          if (a2 != null) select2 = JmolTools.getPdbInfo(a2);

          // nothing to display
          if (select1.equals("") && select2.equals("")) continue;

          if (nrSelected > 0) cmd.append(", ");

          cmd.append(select1);
          cmd.append(", ");
          cmd.append(select2);
          nrSelected++;
        }
      }

    } catch (StructureException e) {
      e.printStackTrace();
    }
    if (nrSelected == 0) cmd.append(" none;");
    else cmd.append("; set display selected;");

    jmol.evalString(cmd.toString());
  }