Skip to content

Commit 45a66c7

Browse files
committed
Switch phylo and alignment dependencies back
1 parent 8a0da08 commit 45a66c7

File tree

3 files changed

+20
-17
lines changed

3 files changed

+20
-17
lines changed

biojava-alignment/pom.xml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,11 @@
6262
<dependency>
6363
<groupId>org.apache.logging.log4j</groupId>
6464
<artifactId>log4j-core</artifactId>
65-
</dependency>
65+
</dependency>
66+
<dependency>
67+
<groupId>org.biojava</groupId>
68+
<artifactId>biojava-phylo</artifactId>
69+
<version>4.1.1-SNAPSHOT</version>
70+
</dependency>
6671
</dependencies>
6772
</project>

biojava-phylo/pom.xml

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -59,10 +59,5 @@
5959
<groupId>org.apache.logging.log4j</groupId>
6060
<artifactId>log4j-core</artifactId>
6161
</dependency>
62-
<dependency>
63-
<groupId>org.biojava</groupId>
64-
<artifactId>biojava-alignment</artifactId>
65-
<version>4.1.1-SNAPSHOT</version>
66-
</dependency>
6762
</dependencies>
6863
</project>

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

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
import org.biojava.nbio.core.sequence.template.Compound;
1010
import org.biojava.nbio.core.sequence.template.Sequence;
1111
import org.forester.evoinference.matrix.distance.BasicSymmetricalDistanceMatrix;
12-
import org.forester.evoinference.matrix.distance.DistanceMatrix;
1312
import org.forester.io.parsers.FastaParser;
1413
import org.forester.io.writers.PhylogenyWriter;
1514
import org.forester.msa.Msa;
@@ -26,7 +25,8 @@
2625
public class ForesterWrapper {
2726

2827
/** Prevent instantiation */
29-
private ForesterWrapper() {}
28+
private ForesterWrapper() {
29+
}
3030

3131
/**
3232
* Convert a BioJava {@link MultipleSequenceAlignment} to a forester
@@ -79,21 +79,24 @@ public static String getNewickString(Phylogeny phylo, boolean simpleNewick,
7979
writeDistances);
8080
return newickString.toString();
8181
}
82-
82+
8383
/**
84-
* Helper function to clone a forester DistanceMatrix.
84+
* Helper function to clone a forester symmetrical DistanceMatrix.
8585
*
86-
* @param distM forester DistanceMatrix
87-
* @return identical copy of the forester DistanceMatrix
86+
* @param distM
87+
* forester symmetrical DistanceMatrix
88+
* @return identical copy of the forester symmetrical DistanceMatrix
8889
*/
89-
public static DistanceMatrix cloneDM(DistanceMatrix distM) {
90-
90+
public static BasicSymmetricalDistanceMatrix cloneDM(
91+
BasicSymmetricalDistanceMatrix distM) {
92+
9193
int n = distM.getSize();
92-
DistanceMatrix cloneDM = new BasicSymmetricalDistanceMatrix(n);
93-
94+
BasicSymmetricalDistanceMatrix cloneDM =
95+
new BasicSymmetricalDistanceMatrix(n);
96+
9497
for (int i = 0; i < n; i++) {
9598
cloneDM.setIdentifier(i, distM.getIdentifier(i));
96-
for (int j = 0; j < n; j++) {
99+
for (int j = i + 1; j < n; j++) {
97100
cloneDM.setValue(i, j, distM.getValue(i, j));
98101
}
99102
}

0 commit comments

Comments
 (0)