X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=forester%2Fjava%2Fsrc%2Forg%2Fforester%2Fevoinference%2Fparsimony%2FFitchParsimony.java;h=7c7c9f2df17656c73aba805ad6f6002b3e47006e;hb=5bae4861f59350b3158d6ebd5034ea7698d81b98;hp=df22cbcc7e502926a1087b65013b8a429aa9c62f;hpb=f3f08cb017c276411ba6c7e3f3e157ed5bba136e;p=jalview.git diff --git a/forester/java/src/org/forester/evoinference/parsimony/FitchParsimony.java b/forester/java/src/org/forester/evoinference/parsimony/FitchParsimony.java index df22cbc..7c7c9f2 100644 --- a/forester/java/src/org/forester/evoinference/parsimony/FitchParsimony.java +++ b/forester/java/src/org/forester/evoinference/parsimony/FitchParsimony.java @@ -148,7 +148,7 @@ public class FitchParsimony { /** * Returns a view of the internal states prior to trace-back. - * + * * @return */ public CharacterStateMatrix> getInternalStatesMatrixPriorToTraceback() { @@ -200,13 +200,13 @@ public class FitchParsimony { * This sets whether to use the first or last state in the sorted * states at the undecided internal nodes. * For randomized choices set randomize to true (and this to false). - * + * * Note. It might be advisable to set this to false * for BinaryStates if absence at the root is preferred - * (given the enum BinaryStates sorts in the following order: + * (given the enum BinaryStates sorts in the following order: * ABSENT, UNKNOWN, PRESENT). - * - * + * + * * @param use_last */ public void setUseLast( final boolean use_last ) { @@ -245,7 +245,7 @@ public class FitchParsimony { final PhylogenyNode node_child = node.getChildNode( i ); if ( !states.containsKey( node_child ) ) { throw new AssertionError( "this should not have happened: node [" + node_child.getName() - + "] not found in node state map" ); + + "] not found in node state map" ); } if ( i == 0 ) { states_in_child_nodes.addAll( states.get( node_child ) ); @@ -282,7 +282,7 @@ public class FitchParsimony { final STATE_TYPE state = matrix.getState( indentifier_index, character_index ); if ( state == null ) { throw new IllegalArgumentException( "value at [" + indentifier_index + ", " + character_index - + "] is null" ); + + "] is null" ); } final SortedSet l = new TreeSet(); l.add( state ); @@ -299,7 +299,7 @@ public class FitchParsimony { final STATE_TYPE state = matrix.getState( indentifier_index, character_index ); if ( state == null ) { throw new IllegalArgumentException( "value at [" + indentifier_index + ", " + character_index - + "] is null" ); + + "] is null" ); } states.put( p.getNode( matrix.getIdentifier( indentifier_index ) ), state ); } @@ -313,7 +313,7 @@ public class FitchParsimony { final PhylogenyNode node_child = node.getChildNode( i ); if ( !states.containsKey( node_child ) ) { throw new AssertionError( "this should not have happened: node [" + node_child.getName() - + "] not found in node state map" ); + + "] not found in node state map" ); } states_in_child_nodes.addAll( states.get( node_child ) ); } @@ -340,8 +340,8 @@ public class FitchParsimony { nodes.add( postorder.next() ); } setGainLossMatrix( new BasicCharacterStateMatrix( nodes.size(), - external_node_states_matrix - .getNumberOfCharacters() ) ); + external_node_states_matrix + .getNumberOfCharacters() ) ); int identifier_index = 0; for( final PhylogenyNode node : nodes ) { getGainLossMatrix().setIdentifier( identifier_index++, @@ -364,11 +364,11 @@ public class FitchParsimony { } } setInternalStatesMatrixPriorToTraceback( new BasicCharacterStateMatrix>( internal_nodes.size(), - external_node_states_matrix - .getNumberOfCharacters() ) ); + external_node_states_matrix + .getNumberOfCharacters() ) ); setInternalStatesMatrixTraceback( new BasicCharacterStateMatrix( internal_nodes.size(), - external_node_states_matrix - .getNumberOfCharacters() ) ); + external_node_states_matrix + .getNumberOfCharacters() ) ); int identifier_index = 0; for( final PhylogenyNode node : internal_nodes ) { getInternalStatesMatrix().setIdentifier( identifier_index, @@ -384,7 +384,7 @@ public class FitchParsimony { external_node_states_matrix.getCharacter( character_index ) ); getInternalStatesMatrixPriorToTraceback().setCharacter( character_index, external_node_states_matrix - .getCharacter( character_index ) ); + .getCharacter( character_index ) ); } } @@ -482,7 +482,7 @@ public class FitchParsimony { else if ( current_binary_state == ABSENT ) {//new setGainLossState( character_state_column, current_node, UNCHANGED_ABSENT );//new }//new - // setGainLossState( character_state_column, current_node, UNKNOWN_GAIN_LOSS ); + // setGainLossState( character_state_column, current_node, UNKNOWN_GAIN_LOSS ); } } } @@ -507,26 +507,26 @@ public class FitchParsimony { final PhylogenyNode node, final GainLossStates state ) { getGainLossMatrix().setState( ForesterUtil.isEmpty( node.getName() ) ? node.getId() + "" : node.getName(), - character_state_column, - state ); + character_state_column, + state ); } private void setInternalNodeState( final Map states, final int character_state_column, final PhylogenyNode node ) { getInternalStatesMatrix() - .setState( ForesterUtil.isEmpty( node.getName() ) ? node.getId() + "" : node.getName(), - character_state_column, - states.get( node ) ); + .setState( ForesterUtil.isEmpty( node.getName() ) ? node.getId() + "" : node.getName(), + character_state_column, + states.get( node ) ); } private void setInternalNodeStatePriorToTraceback( final Map> states, final int character_state_column, final PhylogenyNode node ) { getInternalStatesMatrixPriorToTraceback() - .setState( ForesterUtil.isEmpty( node.getName() ) ? String.valueOf( node.getId() ) : node.getName(), - character_state_column, - toListSorted( states.get( node ) ) ); + .setState( ForesterUtil.isEmpty( node.getName() ) ? String.valueOf( node.getId() ) : node.getName(), + character_state_column, + toListSorted( states.get( node ) ) ); } private void setInternalStatesMatrixPriorToTraceback( final CharacterStateMatrix> internal_states_matrix_prior_to_traceback ) {