Beispiel #1
0
 public void actionPerformed(ActionEvent e) {
   String cmd = e.getActionCommand();
   // print is handled by superclass
   if (cmd.equals(MenuCreator.PRINT)) {
     super.actionPerformed(e);
   } else if (cmd.equals(MenuCreator.TEXT_ONLY)) {
     String result = AfpChainWriter.toWebSiteDisplay(afpChain, ca1, ca2);
     DisplayAFP.showAlignmentImage(afpChain, result);
   } else if (cmd.equals(MenuCreator.PAIRS_ONLY)) {
     String result = AfpChainWriter.toAlignedPairs(afpChain, ca1, ca2);
     DisplayAFP.showAlignmentImage(afpChain, result);
   } else if (cmd.equals(MenuCreator.FATCAT_TEXT)) {
     String result = afpChain.toFatcat(ca1, ca2);
     result += AFPChain.newline;
     result += afpChain.toRotMat();
     DisplayAFP.showAlignmentImage(afpChain, result);
   } else if (cmd.equals(MenuCreator.SELECT_EQR)) {
     selectEQR();
   } else if (cmd.equals(MenuCreator.SIMILARITY_COLOR)) {
     colorBySimilarity(true);
   } else if (cmd.equals(MenuCreator.EQR_COLOR)) {
     colorBySimilarity(false);
   } else if (cmd.equals(MenuCreator.FATCAT_BLOCK)) {
     colorByAlignmentBlock();
   } else {
     System.err.println("Unknown command:" + cmd);
   }
 }
Beispiel #2
0
  public static void main(String[] args) {

    String file = "/Users/ap3/tmp/4hhb.ce";

    try {
      BufferedReader in = new BufferedReader(new FileReader(file));
      StringBuffer xml = new StringBuffer();
      String str;
      while ((str = in.readLine()) != null) {
        xml.append(str);
      }
      in.close();

      AFPChain[] afps = AFPChainXMLParser.parseMultiXML(xml.toString());
      AFPChain afpChain = afps[0];

      UserConfiguration config = WebStartMain.getWebStartConfig();
      AtomCache cache = new AtomCache(config.getPdbFilePath(), config.isSplit());

      Atom[] ca1 = cache.getAtoms(afpChain.getName1());
      Atom[] ca2 = cache.getAtoms(afpChain.getName2());

      AFPChainXMLParser.rebuildAFPChain(afpChain, ca1, ca2);

      // StructureAlignment algorithm =
      // StructureAlignmentFactory.getAlgorithm(afpChain.getAlgorithmName());
      StructureAlignmentJmol jmol = StructureAlignmentDisplay.display(afpChain, ca1, ca2);

      DisplayAFP.showAlignmentImage(afpChain, ca1, ca2, jmol);

    } catch (Exception e) {
      e.printStackTrace();
    }
  }