Skip to content

Commit a3d594d

Browse files
committed
Unskip phylo tests
1 parent 2cc7deb commit a3d594d

File tree

3 files changed

+9
-14
lines changed

3 files changed

+9
-14
lines changed

biojava-phylo/src/main/java/demo/DemoDistanceTree.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ public static void main(String[] args) throws Exception {
6969
(BasicSymmetricalDistanceMatrix) DM, TreeConstructorType.NJ);
7070

7171
long treeT = System.currentTimeMillis();
72-
String newick = ForesterWrapper.getNewickString(phylo, true, true);
72+
String newick = ForesterWrapper.getNewickString(phylo, true);
7373
System.out.println(newick);
7474
System.out.println("Tree Construction: " + (treeT - readT) + " ms.");
7575

biojava-phylo/src/main/java/org/biojava/nbio/phylo/ForesterWrapper.java

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -65,18 +65,16 @@ public String getHeader(C sequence) {
6565
*
6666
* @param phylo
6767
* Phylogeny phylogenetic tree
68-
* @param simpleNewick
6968
* @param writeDistances
7069
* write the branch lengths if true
7170
* @return
7271
* @throws Exception
7372
*/
74-
public static String getNewickString(Phylogeny phylo, boolean simpleNewick,
73+
public static String getNewickString(Phylogeny phylo,
7574
boolean writeDistances) throws Exception {
7675

7776
PhylogenyWriter w = new PhylogenyWriter();
78-
StringBuffer newickString = w.toNewHampshire(phylo, simpleNewick,
79-
writeDistances);
77+
StringBuffer newickString = w.toNewHampshire(phylo, writeDistances);
8078
return newickString.toString();
8179
}
8280

biojava-phylo/src/test/java/org/biojava/nbio/phylo/TestDistanceTreeEvaluator.java

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
import org.forester.evoinference.matrix.distance.BasicSymmetricalDistanceMatrix;
44
import org.forester.phylogeny.Phylogeny;
5-
import org.junit.Ignore;
65
import org.junit.Test;
76

87
import static org.junit.Assert.*;
@@ -16,7 +15,6 @@
1615
public class TestDistanceTreeEvaluator {
1716

1817
@Test
19-
@Ignore
2018
public void testErrorFree() throws Exception {
2119

2220
// Create a perfect additive distance matrix
@@ -48,7 +46,6 @@ public void testErrorFree() throws Exception {
4846
}
4947

5048
@Test
51-
@Ignore
5249
public void testErrorEstimation() throws Exception {
5350

5451
// Matrix taken from forester test
@@ -57,18 +54,18 @@ public void testErrorEstimation() throws Exception {
5754
m.setIdentifier(1, "B");
5855
m.setIdentifier(2, "C");
5956
m.setIdentifier(3, "D");
60-
m.setRow("0.00 0.95 0.17 0.98", 0);
61-
m.setRow("0.95 0.00 1.02 1.83", 1);
62-
m.setRow("0.17 1.02 0.00 1.01", 2);
63-
m.setRow("0.98 1.83 1.01 0.00", 3);
57+
m.setRow("0 1 0 1", 0);
58+
m.setRow("1 0 0 1", 1);
59+
m.setRow("0 0 0 1", 2);
60+
m.setRow("1 1 1 0", 3);
6461

6562
// Calculate error free tree and get the cv
6663
Phylogeny tree = TreeConstructor.distanceTree(
6764
ForesterWrapper.cloneDM(m), TreeConstructorType.NJ);
6865
double cv = DistanceTreeEvaluator.evaluate(tree, m);
6966

70-
// Assert error is only 5%
71-
assertEquals(0.05, cv, 0.1);
67+
// Assert error is about 30%
68+
assertEquals(0.3, cv, 0.05);
7269

7370
}
7471
}

0 commit comments

Comments
 (0)