import java.util.TreeSet;
import org.forester.phylogeny.Phylogeny;
+import org.forester.phylogeny.PhylogenyMethods;
import org.forester.phylogeny.PhylogenyNode;
import org.forester.phylogeny.data.Event;
import org.forester.phylogeny.data.Taxonomy;
*
* @author Christian M. Zmasek
*/
-public final class GSDI extends SDI {
+public class GSDI extends SDI {
private final boolean _most_parsimonious_duplication_model;
private final boolean _strip_gene_tree;
private final boolean _strip_species_tree;
- private int _speciation_or_duplication_events_sum;
- private int _speciations_sum;
+ protected int _speciation_or_duplication_events_sum;
+ protected int _speciations_sum;
private final List<PhylogenyNode> _stripped_gene_tree_nodes;
private final List<PhylogenyNode> _stripped_species_tree_nodes;
private final Set<PhylogenyNode> _mapped_species_tree_nodes;
_mapped_species_tree_nodes = new HashSet<PhylogenyNode>();
_scientific_names_mapped_to_reduced_specificity = new TreeSet<String>();
linkNodesOfG();
- getSpeciesTree().preOrderReId();
+ PhylogenyMethods.preOrderReId( getSpeciesTree() );
geneTreePostOrderTraversal();
}
this( gene_tree, species_tree, most_parsimonious_duplication_model, false, false );
}
+ public GSDI( final Phylogeny gene_tree,
+ final Phylogeny species_tree,
+ final boolean most_parsimonious_duplication_model,
+ final boolean strip_gene_tree,
+ final boolean strip_species_tree,
+ final int x ) throws SDIException {
+ super( gene_tree, species_tree );
+ _speciation_or_duplication_events_sum = 0;
+ _speciations_sum = 0;
+ _most_parsimonious_duplication_model = most_parsimonious_duplication_model;
+ _duplications_sum = 0;
+ _strip_gene_tree = strip_gene_tree;
+ _strip_species_tree = strip_species_tree;
+ _stripped_gene_tree_nodes = new ArrayList<PhylogenyNode>();
+ _stripped_species_tree_nodes = new ArrayList<PhylogenyNode>();
+ _mapped_species_tree_nodes = new HashSet<PhylogenyNode>();
+ _scientific_names_mapped_to_reduced_specificity = new TreeSet<String>();
+ }
+
// s is the node on the species tree g maps to.
private final void determineEvent( final PhylogenyNode s, final PhylogenyNode g ) {
boolean oyako = false;
_stripped_species_tree_nodes.add( s );
}
}
+ _species_tree.clearHashIdToNodeMap();
+ _species_tree.externalNodesHaveChanged();
}
public List<PhylogenyNode> getStrippedSpeciesTreeNodes() {
for( final PhylogenyNode g : _stripped_gene_tree_nodes ) {
_gene_tree.deleteSubtree( g, true );
}
+ _gene_tree.clearHashIdToNodeMap();
+ _gene_tree.externalNodesHaveChanged();
}
public Set<PhylogenyNode> getMappedExternalSpeciesTreeNodes() {