Пример #1
0
  public void setUp() {
    cache = new AtomCache();

    // Delete files which were cached in previous tests
    String cacheDir = cache.getPath();
    String[] uncacheIDs = new String[] {"1cmw", "1hhb", "4hhb"};

    ArrayList<String> extensions = new ArrayList<String>();

    extensions.add(".ent");
    extensions.add(".pdb");
    extensions.add(".ent.gz");
    extensions.add(".pdb.gz");
    extensions.add(".ent.Z");
    extensions.add(".pdb.Z");

    for (String pdbId : uncacheIDs) {
      String middle = pdbId.substring(1, 3).toLowerCase();

      String fpath = cacheDir + lineSplit + middle + lineSplit + pdbId;
      String ppath = cacheDir + lineSplit + middle + lineSplit + "pdb" + pdbId;

      String[] paths = new String[] {fpath, ppath};

      for (int p = 0; p < paths.length; p++) {
        String testpath = paths[p];
        // System.out.println(testpath);
        for (int i = 0; i < extensions.size(); i++) {
          String ex = (String) extensions.get(i);
          // System.out.println("PDBFileReader testing: "+testpath+ex);
          File f = new File(testpath + ex);

          if (f.exists()) {
            System.out.println("Deleting " + testpath + ex);
            assertTrue("Error deleting " + testpath + ex + " during setup.", f.delete());
          }
        }
      }
    }
  }
Пример #2
0
  public static void main(String[] args) {

    // ScopDatabase berkeley = new BerkeleyScopInstallation();

    // ScopFactory.setScopDatabase(berkeley);

    AtomCache cache = new AtomCache();
    // whenever you want to get access to SCOP now request it like this:
    ScopDatabase scop = ScopFactory.getSCOP("1.75");
    ScopFactory.setScopDatabase(scop);

    System.out.println(cache.getPath());
    System.out.println(cache.getCachePath());
    // ... and do something with it

    // eg. you can run all the demos that work for the UK - SCOP (currently at version 1.75)
    // this demo no automatically picks up the Berkeley version (currently 1.75A)
    DemoSCOP scopDemo = new DemoSCOP();

    scopDemo.getCategories();
    scopDemo.printDomainsForPDB();
    scopDemo.traverseHierarchy();
    scopDemo.alignSuperfamily();
  }