Example #1
0
  @Test
  public void testIndependence() throws IOException, StructureException {

    String[] names = new String[] {"1hiv.A", "4i4q", "1n0r.A"};
    int[] orders = new int[] {2, 3, 4};

    for (int i = 0; i < names.length; i++) {

      Structure s = StructureTools.getStructure(names[i]);
      Atom[] atoms = StructureTools.getRepresentativeAtomArray(s);

      CeSymmResult result = CeSymm.analyze(atoms);

      assertTrue(result.isSignificant());
      assertEquals(result.getSymmOrder(), orders[i]);
    }
  }
Example #2
0
  @Override
  public void actionPerformed(ActionEvent ae) {
    String cmd = ae.getActionCommand();
    if (cmd.equals("New Symmetry Analysis")) SymmetryGui.getInstance();

    if (symm == null) logger.error("Currently not displaying a symmetry!");

    try {
      if (cmd.equals("Repeats Superposition")) {
        MultipleAlignmentJmol j = SymmetryDisplay.displayRepeats(symm);
        String s = SymmetryDisplay.printSymmetryAxes(symm);
        j.evalString(s);

      } else if (cmd.equals("Multiple Structure Alignment")) {
        MultipleAlignmentJmol j = SymmetryDisplay.displayFull(symm);
        String s = SymmetryDisplay.printSymmetryAxes(symm);
        j.evalString(s);

      } else if (cmd.equals("Optimal Self Alignment")) {
        Atom[] cloned = StructureTools.cloneAtomArray(symm.getAtoms());
        AbstractAlignmentJmol jmol =
            StructureAlignmentDisplay.display(symm.getSelfAlignment(), symm.getAtoms(), cloned);
        RotationAxis axis = new RotationAxis(symm.getSelfAlignment());
        jmol.evalString(axis.getJmolScript(symm.getAtoms()));
        jmol.setTitle(SymmetryDisplay.getSymmTitle(symm));

      } else if (cmd.equals("Show Symmetry Group")) {
        String script = SymmetryDisplay.printSymmetryGroup(symm);
        jmol.evalString(script);

      } else if (cmd.equals("Show Symmetry Axes")) {
        String s = SymmetryDisplay.printSymmetryAxes(symm);
        jmol.evalString(s);
      }

    } catch (Exception e) {
      logger.error("Could not complete display option", e);
    }
  }