From: cmzmasek Date: Mon, 10 Dec 2012 01:37:48 +0000 (+0000) Subject: not needed X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=b4feb429a0026b7946c480debd9f4cf54b9ee6cf;p=jalview.git not needed --- diff --git a/forester/java/src/org/forester/sdi/RIOn.java b/forester/java/src/org/forester/sdi/RIOn.java deleted file mode 100644 index 058e10f..0000000 --- a/forester/java/src/org/forester/sdi/RIOn.java +++ /dev/null @@ -1,132 +0,0 @@ -// $Id: -// FORESTER -- software libraries and applications -// for evolutionary biology research and applications. -// -// Copyright (C) 2008-2009 Christian M. Zmasek -// Copyright (C) 2008-2009 Burnham Institute for Medical Research -// All rights reserved -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License, or (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA -// -// Contact: phylosoft @ gmail . com -// WWW: www.phylosoft.org/forester - -package org.forester.sdi; - -import java.util.ArrayList; -import java.util.List; - -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.iterators.PhylogenyNodeIterator; -import org.forester.util.GeneralTable; - -public class RIOn { - - private final static boolean ROOT_BY_MINIMIZING_MAPPING_COST = false; - private final static boolean ROOT_BY_MINIMIZING_SUM_OF_DUPS = true; - private final static boolean ROOT_BY_MINIMIZING_TREE_HEIGHT = true; - GeneralTable _orthologs = null; - GeneralTable _paralogs = null; - GeneralTable _super_orthologs = null; - GeneralTable _ultra_paralogs = null; - - private void doInferOrthologs( final Phylogeny gene_tree, final Phylogeny species_tree ) throws SDIException { - final SDIR sdiunrooted = new SDIR(); - final Phylogeny assigned_tree = sdiunrooted.infer( gene_tree, - species_tree, - ROOT_BY_MINIMIZING_MAPPING_COST, - ROOT_BY_MINIMIZING_SUM_OF_DUPS, - ROOT_BY_MINIMIZING_TREE_HEIGHT, - true, - 1 )[ 0 ]; - final List external_nodes = new ArrayList(); - for( final PhylogenyNodeIterator iterator = assigned_tree.iteratorExternalForward(); iterator.hasNext(); ) { - external_nodes.add( iterator.next() ); - } - final PhylogenyMethods methods = PhylogenyMethods.getInstance(); - for( int i = 0; i < external_nodes.size(); ++i ) { - for( int j = 0; j < external_nodes.size(); ++j ) { - if ( i != j ) { - final PhylogenyNode node_i = external_nodes.get( i ); - final PhylogenyNode node_j = external_nodes.get( j ); - final PhylogenyNode lca = PhylogenyMethods.calculateLCA( node_i, node_j ); - final Event event = lca.getNodeData().getEvent(); - final String node_i_name = node_i.getNodeData().getSequence().getName(); - final String node_j_name = node_j.getNodeData().getSequence().getName(); - if ( event.isDuplication() ) { - increaseCounter( getOrthologs(), node_i_name, node_j_name ); - } - else { - increaseCounter( getParalogs(), node_i_name, node_j_name ); - } - } - } - } - } - - public GeneralTable getOrthologs() { - return _orthologs; - } - - public GeneralTable getParalogs() { - return _paralogs; - } - - public GeneralTable getSuperOrthologs() { - return _super_orthologs; - } - - public GeneralTable getUltraParalogs() { - return _ultra_paralogs; - } - - private void increaseCounter( final GeneralTable table, - final String node_i_name, - final String node_j_name ) { - final Integer value = table.getValue( node_i_name, node_j_name ); - if ( value == null ) { - table.setValue( node_i_name, node_j_name, 1 ); - } - else { - table.setValue( node_i_name, node_j_name, value.intValue() + 1 ); - } - } - - private void init() { - _orthologs = new GeneralTable(); - _paralogs = new GeneralTable(); - _super_orthologs = new GeneralTable(); - _ultra_paralogs = new GeneralTable(); - } - - private void setOrthologs( final GeneralTable orthologs ) { - _orthologs = orthologs; - } - - private void setParalogs( final GeneralTable paralogs ) { - _paralogs = paralogs; - } - - private void setSuperOrthologs( final GeneralTable super_orthologs ) { - _super_orthologs = super_orthologs; - } - - private void setUltraParalogs( final GeneralTable ultra_paralogs ) { - _ultra_paralogs = ultra_paralogs; - } -}