Exemplo n.º 1
0
 public PDBChain findChain(String id) {
   for (int i = 0; i < chains.size(); i++) {
     // System.out.println("ID = " + id + " " +((PDBChain)chains.elementAt(i)).id);
     if (((PDBChain) chains.elementAt(i)).id.equals(id)) {
       return (PDBChain) chains.elementAt(i);
     }
   }
   return null;
 }
Exemplo n.º 2
0
  public void parse() {

    System.out.println("Parsing");

    for (int i = 0; i < lineArray.size(); i++) {
      StringTokenizer str = new StringTokenizer(lineArray.elementAt(i).toString());
      if (str.hasMoreTokens()) {
        String inStr = str.nextToken();

        if (inStr.indexOf("ATOM") != -1) {
          try {
            myAtom tmpatom = new myAtom(str);
            if (findChain(tmpatom.chain) != null) {
              System.out.println("Adding to chain " + tmpatom.chain);
              findChain(tmpatom.chain).atoms.addElement(tmpatom);
            } else {
              System.out.println("Making chain " + tmpatom.chain);
              PDBChain tmpchain = new PDBChain(tmpatom.chain);
              chains.addElement(tmpchain);
              tmpchain.atoms.addElement(tmpatom);
            }
          } catch (NumberFormatException e) {
            System.out.println("Caught" + e);
            System.out.println("Atom not added");
          }
        }
      }
    }
    makeResidueList();
    makeCaBondList();
    //    for (int i=0; i < chains.size() ; i++) {
    //  String pog = ((PDBChain)chains.elementAt(i)).print();
    //  System.out.println(pog);
    // }
  }
Exemplo n.º 3
0
 public void setChainColours() {
   for (int i = 0; i < chains.size(); i++) {
     ((PDBChain) chains.elementAt(i)).setChainColours();
   }
 }
Exemplo n.º 4
0
 public void makeCaBondList() {
   for (int i = 0; i < chains.size(); i++) {
     ((PDBChain) chains.elementAt(i)).makeCaBondList();
   }
 }