/** * store Hbonds inamino acids DSSP allows two HBonds / aminoacids to allow bifurcated bonds ... */ private void trackHBondEnergy(int i, int j, double energy) { Group one = groups[i]; Group two = groups[j]; SecStrucState stateOne = (SecStrucState) one.getProperty("secstruc"); SecStrucState stateTwo = (SecStrucState) two.getProperty("secstruc"); double acc1e = stateOne.getAccept1().getEnergy(); double acc2e = stateOne.getAccept2().getEnergy(); double don1e = stateTwo.getDonor1().getEnergy(); double don2e = stateTwo.getDonor2().getEnergy(); // if ( energy < 0) // System.out.println("--- tracking Hbond " + i + " " + j + " " + energy + " (accept: " + // acc1e + " " + acc2e +") (donor: "+don1e + " " + don2e+")"); if (energy < acc1e) { // System.out.println(energy +"<"+acc1e) ; stateOne.setAccept2(stateOne.getAccept1()); HBond bond = new HBond(); bond.setEnergy(energy); bond.setPartner(j); stateOne.setAccept1(bond); } else if (energy < acc2e) { // System.out.println(energy +"<"+acc2e) ; HBond bond = new HBond(); bond.setEnergy(energy); bond.setPartner(j); stateOne.setAccept2(bond); } // and now the other side of the bond .. if (energy < don1e) { stateTwo.setDonor2(stateTwo.getDonor1()); HBond bond = new HBond(); bond.setEnergy(energy); bond.setPartner(i); stateTwo.setDonor1(bond); } else if (energy < don2e) { // System.out.println(energy +"<"+don2e) ; HBond bond = new HBond(); bond.setEnergy(energy); bond.setPartner(i); stateTwo.setDonor2(bond); } // System.out.println(stateOne); // one.setProperty("secstruc", stateOne); // two.setProperty("secstruc", stateTwo); /*groups[i] = one; groups[j] = two; */ }