Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Now testing seqres groups in roundtrip
  • Loading branch information
josemduarte committed Jul 26, 2016
commit bdca0e1c21a386ffbd48fb45ec45442160b61a1d
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ private boolean checkIfAtomsSame(Structure structOne, Structure structTwo) {
Chain chainTwo = chainsTwo.get(j);
// Check they have the same chain id
assertEquals(chainOne.getId(), chainTwo.getId());
checkSeqresGroups(chainOne, chainTwo);
List<Group> groupsOne = chainOne.getAtomGroups();
List<Group> groupsTwo = chainTwo.getAtomGroups();
if(groupsOne.size()!=groupsTwo.size()){
Expand All @@ -93,19 +94,20 @@ private boolean checkIfAtomsSame(Structure structOne, Structure structTwo) {
Group groupOne = groupsOne.get(k);
Group groupTwo = groupsTwo.get(k);
// Check if the groups are of the same type
if(groupOne.getType().equals(groupTwo.getType())==false){
if(!groupOne.getType().equals(groupTwo.getType())){
System.out.println("Error - diff group type: "+structOne.getPDBCode());
System.out.println(groupOne.getPDBName() + " and type: "+groupOne.getType());
System.out.println(groupTwo.getPDBName() + " and type: "+groupTwo.getType());;
}
// Check the single letter amino aicd is correct
// Check the single letter amino acid is correct
if(groupOne.getChemComp().getOne_letter_code().length()==1 && groupTwo.getChemComp().getOne_letter_code().length()==1){
if(!groupOne.getChemComp().getOne_letter_code().equals(groupTwo.getChemComp().getOne_letter_code())){
System.out.println(groupOne.getPDBName());
}
assertEquals(groupOne.getChemComp().getOne_letter_code(), groupTwo.getChemComp().getOne_letter_code());
}
assertEquals(groupOne.getType(), groupTwo.getType());
assertEquals(groupOne.getPDBName(), groupTwo.getPDBName());
assertEquals(groupOne.getResidueNumber().getSeqNum(), groupTwo.getResidueNumber().getSeqNum());
assertEquals(groupOne.getResidueNumber().getInsCode(), groupTwo.getResidueNumber().getInsCode());
assertEquals(groupOne.getResidueNumber().getChainName(), groupTwo.getResidueNumber().getChainName());
Expand Down Expand Up @@ -142,15 +144,15 @@ private boolean checkIfAtomsSame(Structure structOne, Structure structTwo) {
for(int l=0;l<atomsOne.size();l++){
Atom atomOne = atomsOne.get(l);
Atom atomTwo = atomsTwo.get(l);
assertTrue(atomOne.getGroup().getPDBName().equals(atomTwo.getGroup().getPDBName()));
assertTrue(atomOne.getCharge()==atomTwo.getCharge());
assertEquals(atomOne.getGroup().getPDBName(), atomTwo.getGroup().getPDBName());
assertEquals(atomOne.getCharge(), atomTwo.getCharge());
// Check the coords are the same to three db
assertArrayEquals(atomOne.getCoords(), atomTwo.getCoords(), 0.0009999999);
assertEquals(atomOne.getTempFactor(), atomTwo.getTempFactor(), 0.009999999);
assertEquals(atomOne.getOccupancy(), atomTwo.getOccupancy(), 0.009999999);
assertTrue(atomOne.getElement()==atomTwo.getElement());
assertTrue(atomOne.getName().equals(atomTwo.getName()));
assertTrue(atomOne.getAltLoc()==atomTwo.getAltLoc());
assertEquals(atomOne.getElement(), atomTwo.getElement());
assertEquals(atomOne.getName(),atomTwo.getName());
assertEquals(atomOne.getAltLoc(), atomTwo.getAltLoc());
if(i==0){
if(atomOne.getBonds()==null){
if(atomTwo.getBonds()!=null){
Expand Down Expand Up @@ -246,4 +248,15 @@ public int compare(Chain o1, Chain o2) {

}

private void checkSeqresGroups(Chain chainOne, Chain chainTwo) {

assertEquals(chainOne.getSeqResGroups().size(), chainTwo.getSeqResGroups().size());

for (int i=0; i<chainOne.getSeqResGroups().size(); i++) {
Group gOne = chainOne.getSeqResGroup(i);
Group gTwo = chainTwo.getSeqResGroup(i);
assertEquals(gOne.getResidueNumber(), gTwo.getResidueNumber());
assertEquals(gOne.getPDBName(), gTwo.getPDBName());
}
}
}