Package org.biojava.nbio.phylo
Class ForesterWrapper
- java.lang.Object
-
- org.biojava.nbio.phylo.ForesterWrapper
-
public class ForesterWrapper extends java.lang.ObjectThis class contains wrapper methods for communication between BioJava and forester (e.g, Data Structure conversion).- Since:
- 4.1.1
- Author:
- Aleix Lafita
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static BasicSymmetricalDistanceMatrixcloneDM(BasicSymmetricalDistanceMatrix distM)Helper function to clone a forester symmetrical DistanceMatrix.static <C extends Sequence<D>,D extends Compound>
Msaconvert(MultipleSequenceAlignment<C,D> msa)Convert a BioJavaMultipleSequenceAlignmentto a foresterMsa.static java.lang.StringgetNewickString(Phylogeny phylo, boolean writeDistances)Convert a Phylogenetic tree to its Newick representation, so that it can be exported to an external application.
-
-
-
Method Detail
-
convert
public static <C extends Sequence<D>,D extends Compound> Msa convert(MultipleSequenceAlignment<C,D> msa) throws java.io.IOException
Convert a BioJavaMultipleSequenceAlignmentto a foresterMsa. The easiest way to convert them is writting the msa as a FASTA file and then parsing it with the foresterFastaParser.- Parameters:
msa- BioJava MultipleSequenceAlignment- Returns:
- forester Msa object
- Throws:
java.io.IOException- if the conversion was not possible
-
getNewickString
public static java.lang.String getNewickString(Phylogeny phylo, boolean writeDistances) throws java.io.IOException
Convert a Phylogenetic tree to its Newick representation, so that it can be exported to an external application.- Parameters:
phylo- Phylogeny phylogenetic treewriteDistances- write the branch lengths if true- Returns:
- Throws:
java.io.IOException
-
cloneDM
public static BasicSymmetricalDistanceMatrix cloneDM(BasicSymmetricalDistanceMatrix distM)
Helper function to clone a forester symmetrical DistanceMatrix.- Parameters:
distM- forester symmetrical DistanceMatrix- Returns:
- identical copy of the forester symmetrical DistanceMatrix
-
-