git://source.jalview.org
/
jalview.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
in progress
[jalview.git]
/
forester
/
java
/
src
/
org
/
forester
/
sdi
/
TestGSDI.java
diff --git
a/forester/java/src/org/forester/sdi/TestGSDI.java
b/forester/java/src/org/forester/sdi/TestGSDI.java
index
91ac13a
..
6480281
100644
(file)
--- a/
forester/java/src/org/forester/sdi/TestGSDI.java
+++ b/
forester/java/src/org/forester/sdi/TestGSDI.java
@@
-50,7
+50,7
@@
public final class TestGSDI {
}
private final static Event getEvent( final Phylogeny p, final String n1, final String n2 ) {
}
private final static Event getEvent( final Phylogeny p, final String n1, final String n2 ) {
- return PhylogenyMethods.getInstance().obtainLCA( p.getNode( n1 ), p.getNode( n2 ) ).getNodeData().getEvent();
+ return PhylogenyMethods.calculateLCA( p.getNode( n1 ), p.getNode( n2 ) ).getNodeData().getEvent();
}
public static boolean test() {
}
public static boolean test() {
@@
-128,17
+128,20
@@
public final class TestGSDI {
if ( sdi1.getDuplicationsSum() != 1 ) {
return false;
}
if ( sdi1.getDuplicationsSum() != 1 ) {
return false;
}
- if ( !pm.obtainLCA( g1.getNode( "B" ), g1.getNode( "A1" ) ).getNodeData().getEvent().isSpeciation() ) {
+ if ( !PhylogenyMethods.calculateLCA( g1.getNode( "B" ), g1.getNode( "A1" ) ).getNodeData().getEvent()
+ .isSpeciation() ) {
return false;
}
return false;
}
- if ( !pm.obtainLCA( g1.getNode( "C" ), g1.getNode( "A1" ) ).getNodeData().getEvent()
+ if ( !PhylogenyMethods.calculateLCA( g1.getNode( "C" ), g1.getNode( "A1" ) ).getNodeData().getEvent()
.isSpeciationOrDuplication() ) {
return false;
}
.isSpeciationOrDuplication() ) {
return false;
}
- if ( !( pm.obtainLCA( g1.getNode( "A2" ), g1.getNode( "A1" ) ).getNodeData().getEvent().isDuplication() ) ) {
+ if ( !( PhylogenyMethods.calculateLCA( g1.getNode( "A2" ), g1.getNode( "A1" ) ).getNodeData().getEvent()
+ .isDuplication() ) ) {
return false;
}
return false;
}
- if ( !pm.obtainLCA( g1.getNode( "D" ), g1.getNode( "A1" ) ).getNodeData().getEvent().isSpeciation() ) {
+ if ( !PhylogenyMethods.calculateLCA( g1.getNode( "D" ), g1.getNode( "A1" ) ).getNodeData().getEvent()
+ .isSpeciation() ) {
return false;
}
final Phylogeny g2 = TestGSDI
return false;
}
final Phylogeny g2 = TestGSDI
@@
-147,17
+150,20
@@
public final class TestGSDI {
if ( sdi2.getDuplicationsSum() != 0 ) {
return false;
}
if ( sdi2.getDuplicationsSum() != 0 ) {
return false;
}
- if ( !pm.obtainLCA( g2.getNode( "A1" ), g2.getNode( "A2" ) ).getNodeData().getEvent().isSpeciation() ) {
+ if ( !PhylogenyMethods.calculateLCA( g2.getNode( "A1" ), g2.getNode( "A2" ) ).getNodeData().getEvent()
+ .isSpeciation() ) {
return false;
}
return false;
}
- if ( !pm.obtainLCA( g2.getNode( "A1" ), g2.getNode( "B" ) ).getNodeData().getEvent().isSpeciation() ) {
+ if ( !PhylogenyMethods.calculateLCA( g2.getNode( "A1" ), g2.getNode( "B" ) ).getNodeData().getEvent()
+ .isSpeciation() ) {
return false;
}
return false;
}
- if ( !pm.obtainLCA( g2.getNode( "A1" ), g2.getNode( "C" ) ).getNodeData().getEvent()
+ if ( !PhylogenyMethods.calculateLCA( g2.getNode( "A1" ), g2.getNode( "C" ) ).getNodeData().getEvent()
.isSpeciationOrDuplication() ) {
return false;
}
.isSpeciationOrDuplication() ) {
return false;
}
- if ( !pm.obtainLCA( g2.getNode( "A1" ), g2.getNode( "D" ) ).getNodeData().getEvent().isSpeciation() ) {
+ if ( !PhylogenyMethods.calculateLCA( g2.getNode( "A1" ), g2.getNode( "D" ) ).getNodeData().getEvent()
+ .isSpeciation() ) {
return false;
}
final Phylogeny g3 = TestGSDI
return false;
}
final Phylogeny g3 = TestGSDI
@@
-166,17
+172,20
@@
public final class TestGSDI {
if ( sdi3.getDuplicationsSum() != 0 ) {
return false;
}
if ( sdi3.getDuplicationsSum() != 0 ) {
return false;
}
- if ( !pm.obtainLCA( g3.getNode( "A1" ), g3.getNode( "A2" ) ).getNodeData().getEvent().isSpeciation() ) {
+ if ( !PhylogenyMethods.calculateLCA( g3.getNode( "A1" ), g3.getNode( "A2" ) ).getNodeData().getEvent()
+ .isSpeciation() ) {
return false;
}
return false;
}
- if ( !pm.obtainLCA( g3.getNode( "A1" ), g3.getNode( "C" ) ).getNodeData().getEvent().isSpeciation() ) {
+ if ( !PhylogenyMethods.calculateLCA( g3.getNode( "A1" ), g3.getNode( "C" ) ).getNodeData().getEvent()
+ .isSpeciation() ) {
return false;
}
return false;
}
- if ( !pm.obtainLCA( g3.getNode( "A1" ), g3.getNode( "B" ) ).getNodeData().getEvent()
+ if ( !PhylogenyMethods.calculateLCA( g3.getNode( "A1" ), g3.getNode( "B" ) ).getNodeData().getEvent()
.isSpeciationOrDuplication() ) {
return false;
}
.isSpeciationOrDuplication() ) {
return false;
}
- if ( !pm.obtainLCA( g3.getNode( "A1" ), g3.getNode( "D" ) ).getNodeData().getEvent().isSpeciation() ) {
+ if ( !PhylogenyMethods.calculateLCA( g3.getNode( "A1" ), g3.getNode( "D" ) ).getNodeData().getEvent()
+ .isSpeciation() ) {
return false;
}
final Phylogeny g4 = TestGSDI
return false;
}
final Phylogeny g4 = TestGSDI
@@
-185,13
+194,16
@@
public final class TestGSDI {
if ( sdi4.getDuplicationsSum() != 1 ) {
return false;
}
if ( sdi4.getDuplicationsSum() != 1 ) {
return false;
}
- if ( !pm.obtainLCA( g4.getNode( "B" ), g4.getNode( "C1" ) ).getNodeData().getEvent().isSpeciation() ) {
+ if ( !PhylogenyMethods.calculateLCA( g4.getNode( "B" ), g4.getNode( "C1" ) ).getNodeData().getEvent()
+ .isSpeciation() ) {
return false;
}
return false;
}
- if ( !pm.obtainLCA( g4.getNode( "B" ), g4.getNode( "C2" ) ).getNodeData().getEvent().isDuplication() ) {
+ if ( !PhylogenyMethods.calculateLCA( g4.getNode( "B" ), g4.getNode( "C2" ) ).getNodeData().getEvent()
+ .isDuplication() ) {
return false;
}
return false;
}
- if ( !pm.obtainLCA( g4.getNode( "B" ), g4.getNode( "D" ) ).getNodeData().getEvent().isSpeciation() ) {
+ if ( !PhylogenyMethods.calculateLCA( g4.getNode( "B" ), g4.getNode( "D" ) ).getNodeData().getEvent()
+ .isSpeciation() ) {
return false;
}
final Phylogeny g5 = TestGSDI
return false;
}
final Phylogeny g5 = TestGSDI
@@
-200,19
+212,24
@@
public final class TestGSDI {
if ( sdi5.getDuplicationsSum() != 3 ) {
return false;
}
if ( sdi5.getDuplicationsSum() != 3 ) {
return false;
}
- if ( !pm.obtainLCA( g5.getNode( "D1" ), g5.getNode( "A1" ) ).getNodeData().getEvent().isSpeciation() ) {
+ if ( !PhylogenyMethods.calculateLCA( g5.getNode( "D1" ), g5.getNode( "A1" ) ).getNodeData().getEvent()
+ .isSpeciation() ) {
return false;
}
return false;
}
- if ( !pm.obtainLCA( g5.getNode( "D1" ), g5.getNode( "B" ) ).getNodeData().getEvent().isDuplication() ) {
+ if ( !PhylogenyMethods.calculateLCA( g5.getNode( "D1" ), g5.getNode( "B" ) ).getNodeData().getEvent()
+ .isDuplication() ) {
return false;
}
return false;
}
- if ( !pm.obtainLCA( g5.getNode( "D1" ), g5.getNode( "D2" ) ).getNodeData().getEvent().isDuplication() ) {
+ if ( !PhylogenyMethods.calculateLCA( g5.getNode( "D1" ), g5.getNode( "D2" ) ).getNodeData().getEvent()
+ .isDuplication() ) {
return false;
}
return false;
}
- if ( !pm.obtainLCA( g5.getNode( "D2" ), g5.getNode( "D3" ) ).getNodeData().getEvent().isDuplication() ) {
+ if ( !PhylogenyMethods.calculateLCA( g5.getNode( "D2" ), g5.getNode( "D3" ) ).getNodeData().getEvent()
+ .isDuplication() ) {
return false;
}
return false;
}
- if ( !pm.obtainLCA( g5.getNode( "C" ), g5.getNode( "D3" ) ).getNodeData().getEvent().isSpeciation() ) {
+ if ( !PhylogenyMethods.calculateLCA( g5.getNode( "C" ), g5.getNode( "D3" ) ).getNodeData().getEvent()
+ .isSpeciation() ) {
return false;
}
final Phylogeny species7 = TestGSDI.createPhylogeny( "(((((((([&&NHX:S=a1],[&&NHX:S=a2]),"
return false;
}
final Phylogeny species7 = TestGSDI.createPhylogeny( "(((((((([&&NHX:S=a1],[&&NHX:S=a2]),"
@@
-265,7
+282,8
@@
public final class TestGSDI {
if ( sdi2_0.getSpeciationsSum() != 1 ) {
return false;
}
if ( sdi2_0.getSpeciationsSum() != 1 ) {
return false;
}
- if ( !pm.obtainLCA( g2_0.getNode( "m1" ), g2_0.getNode( "m3" ) ).getNodeData().getEvent().isSpeciation() ) {
+ if ( !PhylogenyMethods.calculateLCA( g2_0.getNode( "m1" ), g2_0.getNode( "m3" ) ).getNodeData().getEvent()
+ .isSpeciation() ) {
return false;
}
final Phylogeny g2_1 = TestGSDI.createPhylogeny( "(e2[&&NHX:S=e2],h2[&&NHX:S=h2])" );
return false;
}
final Phylogeny g2_1 = TestGSDI.createPhylogeny( "(e2[&&NHX:S=e2],h2[&&NHX:S=h2])" );
@@
-279,7
+297,8
@@
public final class TestGSDI {
if ( sdi2_1.getSpeciationsSum() != 1 ) {
return false;
}
if ( sdi2_1.getSpeciationsSum() != 1 ) {
return false;
}
- if ( !pm.obtainLCA( g2_1.getNode( "e2" ), g2_1.getNode( "h2" ) ).getNodeData().getEvent().isSpeciation() ) {
+ if ( !PhylogenyMethods.calculateLCA( g2_1.getNode( "e2" ), g2_1.getNode( "h2" ) ).getNodeData().getEvent()
+ .isSpeciation() ) {
return false;
}
final Phylogeny g2_2 = TestGSDI.createPhylogeny( "(e2[&&NHX:S=e2],p4[&&NHX:S=p4])" );
return false;
}
final Phylogeny g2_2 = TestGSDI.createPhylogeny( "(e2[&&NHX:S=e2],p4[&&NHX:S=p4])" );
@@
-293,7
+312,8
@@
public final class TestGSDI {
if ( sdi2_2.getSpeciationsSum() != 1 ) {
return false;
}
if ( sdi2_2.getSpeciationsSum() != 1 ) {
return false;
}
- if ( !pm.obtainLCA( g2_2.getNode( "e2" ), g2_2.getNode( "p4" ) ).getNodeData().getEvent().isSpeciation() ) {
+ if ( !PhylogenyMethods.calculateLCA( g2_2.getNode( "e2" ), g2_2.getNode( "p4" ) ).getNodeData().getEvent()
+ .isSpeciation() ) {
return false;
}
final Phylogeny g2_3 = TestGSDI.createPhylogeny( "(e2a[&&NHX:S=e2],e2b[&&NHX:S=e2])" );
return false;
}
final Phylogeny g2_3 = TestGSDI.createPhylogeny( "(e2a[&&NHX:S=e2],e2b[&&NHX:S=e2])" );
@@
-307,7
+327,8
@@
public final class TestGSDI {
if ( sdi2_3.getSpeciationsSum() != 0 ) {
return false;
}
if ( sdi2_3.getSpeciationsSum() != 0 ) {
return false;
}
- if ( !pm.obtainLCA( g2_3.getNode( "e2a" ), g2_3.getNode( "e2b" ) ).getNodeData().getEvent().isDuplication() ) {
+ if ( !PhylogenyMethods.calculateLCA( g2_3.getNode( "e2a" ), g2_3.getNode( "e2b" ) ).getNodeData()
+ .getEvent().isDuplication() ) {
return false;
}
final Phylogeny g2_4 = TestGSDI.createPhylogeny( "((j1[&&NHX:S=j1],j4[&&NHX:S=j4]),i3[&&NHX:S=i3])" );
return false;
}
final Phylogeny g2_4 = TestGSDI.createPhylogeny( "((j1[&&NHX:S=j1],j4[&&NHX:S=j4]),i3[&&NHX:S=i3])" );
@@
-321,10
+342,12
@@
public final class TestGSDI {
if ( sdi2_4.getSpeciationsSum() != 2 ) {
return false;
}
if ( sdi2_4.getSpeciationsSum() != 2 ) {
return false;
}
- if ( !pm.obtainLCA( g2_4.getNode( "j1" ), g2_4.getNode( "j4" ) ).getNodeData().getEvent().isSpeciation() ) {
+ if ( !PhylogenyMethods.calculateLCA( g2_4.getNode( "j1" ), g2_4.getNode( "j4" ) ).getNodeData().getEvent()
+ .isSpeciation() ) {
return false;
}
return false;
}
- if ( !pm.obtainLCA( g2_4.getNode( "j1" ), g2_4.getNode( "i3" ) ).getNodeData().getEvent().isSpeciation() ) {
+ if ( !PhylogenyMethods.calculateLCA( g2_4.getNode( "j1" ), g2_4.getNode( "i3" ) ).getNodeData().getEvent()
+ .isSpeciation() ) {
return false;
}
final Phylogeny g2_5 = TestGSDI.createPhylogeny( "((j1[&&NHX:S=j1],j4[&&NHX:S=j4]),f3[&&NHX:S=f3])" );
return false;
}
final Phylogeny g2_5 = TestGSDI.createPhylogeny( "((j1[&&NHX:S=j1],j4[&&NHX:S=j4]),f3[&&NHX:S=f3])" );
@@
-338,10
+361,12
@@
public final class TestGSDI {
if ( sdi2_5.getSpeciationsSum() != 2 ) {
return false;
}
if ( sdi2_5.getSpeciationsSum() != 2 ) {
return false;
}
- if ( !pm.obtainLCA( g2_5.getNode( "j1" ), g2_5.getNode( "j4" ) ).getNodeData().getEvent().isSpeciation() ) {
+ if ( !PhylogenyMethods.calculateLCA( g2_5.getNode( "j1" ), g2_5.getNode( "j4" ) ).getNodeData().getEvent()
+ .isSpeciation() ) {
return false;
}
return false;
}
- if ( !pm.obtainLCA( g2_5.getNode( "j1" ), g2_5.getNode( "f3" ) ).getNodeData().getEvent().isSpeciation() ) {
+ if ( !PhylogenyMethods.calculateLCA( g2_5.getNode( "j1" ), g2_5.getNode( "f3" ) ).getNodeData().getEvent()
+ .isSpeciation() ) {
return false;
}
final Phylogeny g2_6 = TestGSDI.createPhylogeny( "((j3[&&NHX:S=j3],i4[&&NHX:S=i4]),f3[&&NHX:S=f3])" );
return false;
}
final Phylogeny g2_6 = TestGSDI.createPhylogeny( "((j3[&&NHX:S=j3],i4[&&NHX:S=i4]),f3[&&NHX:S=f3])" );
@@
-355,10
+380,12
@@
public final class TestGSDI {
if ( sdi2_6.getSpeciationsSum() != 2 ) {
return false;
}
if ( sdi2_6.getSpeciationsSum() != 2 ) {
return false;
}
- if ( !pm.obtainLCA( g2_6.getNode( "j3" ), g2_6.getNode( "i4" ) ).getNodeData().getEvent().isSpeciation() ) {
+ if ( !PhylogenyMethods.calculateLCA( g2_6.getNode( "j3" ), g2_6.getNode( "i4" ) ).getNodeData().getEvent()
+ .isSpeciation() ) {
return false;
}
return false;
}
- if ( !pm.obtainLCA( g2_6.getNode( "j3" ), g2_6.getNode( "f3" ) ).getNodeData().getEvent().isSpeciation() ) {
+ if ( !PhylogenyMethods.calculateLCA( g2_6.getNode( "j3" ), g2_6.getNode( "f3" ) ).getNodeData().getEvent()
+ .isSpeciation() ) {
return false;
}
final Phylogeny g2_7 = TestGSDI.createPhylogeny( "((j1[&&NHX:S=j1],k1[&&NHX:S=k1]),i1[&&NHX:S=i1])" );
return false;
}
final Phylogeny g2_7 = TestGSDI.createPhylogeny( "((j1[&&NHX:S=j1],k1[&&NHX:S=k1]),i1[&&NHX:S=i1])" );
@@
-372,10
+399,11
@@
public final class TestGSDI {
if ( sdi2_7.getSpeciationsSum() != 1 ) {
return false;
}
if ( sdi2_7.getSpeciationsSum() != 1 ) {
return false;
}
- if ( !pm.obtainLCA( g2_7.getNode( "j1" ), g2_7.getNode( "k1" ) ).getNodeData().getEvent().isSpeciation() ) {
+ if ( !PhylogenyMethods.calculateLCA( g2_7.getNode( "j1" ), g2_7.getNode( "k1" ) ).getNodeData().getEvent()
+ .isSpeciation() ) {
return false;
}
return false;
}
- if ( !pm.obtainLCA( g2_7.getNode( "j1" ), g2_7.getNode( "i1" ) ).getNodeData().getEvent()
+ if ( !PhylogenyMethods.calculateLCA( g2_7.getNode( "j1" ), g2_7.getNode( "i1" ) ).getNodeData().getEvent()
.isSpeciationOrDuplication() ) {
return false;
}
.isSpeciationOrDuplication() ) {
return false;
}
@@
-390,11
+418,12
@@
public final class TestGSDI {
if ( sdi2_8.getSpeciationsSum() != 1 ) {
return false;
}
if ( sdi2_8.getSpeciationsSum() != 1 ) {
return false;
}
- if ( !pm.obtainLCA( g2_8.getNode( "j1" ), g2_8.getNode( "k1" ) ).getNodeData().getEvent()
+ if ( !PhylogenyMethods.calculateLCA( g2_8.getNode( "j1" ), g2_8.getNode( "k1" ) ).getNodeData().getEvent()
.isSpeciationOrDuplication() ) {
return false;
}
.isSpeciationOrDuplication() ) {
return false;
}
- if ( !pm.obtainLCA( g2_8.getNode( "k1" ), g2_8.getNode( "i1" ) ).getNodeData().getEvent().isSpeciation() ) {
+ if ( !PhylogenyMethods.calculateLCA( g2_8.getNode( "k1" ), g2_8.getNode( "i1" ) ).getNodeData().getEvent()
+ .isSpeciation() ) {
return false;
}
final Phylogeny g2_9 = TestGSDI.createPhylogeny( "((j1[&&NHX:S=j1],k4[&&NHX:S=k4]),f2[&&NHX:S=f2])" );
return false;
}
final Phylogeny g2_9 = TestGSDI.createPhylogeny( "((j1[&&NHX:S=j1],k4[&&NHX:S=k4]),f2[&&NHX:S=f2])" );