From: James Procter Date: Mon, 20 Mar 2023 17:43:46 +0000 (+0000) Subject: JAL-4134 override default hasTree so PAE tree is saved! X-Git-Tag: Release_2_11_3_0~15^2^2~2 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=19a38c746ce6dee761175294fcbbbb6347740fa5;p=jalview.git JAL-4134 override default hasTree so PAE tree is saved! --- diff --git a/src/jalview/project/Jalview2XML.java b/src/jalview/project/Jalview2XML.java index efcc7ff..ddf2afd 100644 --- a/src/jalview/project/Jalview2XML.java +++ b/src/jalview/project/Jalview2XML.java @@ -3995,7 +3995,7 @@ public class Jalview2XML Console.log.info( "Ignoring additional clusterings for contact matrix"); } - + String treeMethod = xmlmat.getTreeMethod(); double thresh = xmlmat.getCutHeight()!=null ? xmlmat.getCutHeight() : 0; newpae.restoreGroups(newgroups, treeMethod, nwk, thresh); diff --git a/src/jalview/ws/datamodel/alphafold/PAEContactMatrix.java b/src/jalview/ws/datamodel/alphafold/PAEContactMatrix.java index a5ce9a0..5fe27cc 100644 --- a/src/jalview/ws/datamodel/alphafold/PAEContactMatrix.java +++ b/src/jalview/ws/datamodel/alphafold/PAEContactMatrix.java @@ -267,6 +267,11 @@ public class PAEContactMatrix implements ContactMatrixI { return newick; } + @Override + public boolean hasTree() + { + return newick!=null && newick.length()>0; + } boolean abs; double thresh; String treeType=null; diff --git a/test/jalview/project/Jalview2xmlTests.java b/test/jalview/project/Jalview2xmlTests.java index fa6c25c..81756e0 100644 --- a/test/jalview/project/Jalview2xmlTests.java +++ b/test/jalview/project/Jalview2xmlTests.java @@ -1599,10 +1599,10 @@ public class Jalview2xmlTests extends Jalview2xmlBase Assert.assertEquals(oldCM.getContactAt(j), newCM.getContactAt(j)); } } - Assert.assertEquals(dummyMat.hasGroups(), restoredMat.hasGroups()); - Assert.assertEquals(dummyMat.getGroups(), restoredMat.getGroups()); - Assert.assertEquals(dummyMat.hasTree(), restoredMat.hasTree()); - Assert.assertEquals(dummyMat.getNewick(), restoredMat.getNewick()); + Assert.assertEquals(restoredMat.hasGroups(), dummyMat.hasGroups()); + Assert.assertEquals(restoredMat.getGroups(), dummyMat.getGroups()); + Assert.assertEquals(restoredMat.hasTree(), dummyMat.hasTree()); + Assert.assertEquals( restoredMat.getNewick(),dummyMat.getNewick()); }