throw new IllegalArgumentException( "binary states matrix number of identifiers is not equal to the number of tree nodes provided" );
}
final CharacterStateMatrix<GainLossStates> gl_matrix = new BasicCharacterStateMatrix<GainLossStates>( binary_states_matrix
- .getNumberOfIdentifiers(),
- binary_states_matrix
- .getNumberOfCharacters() );
+ .getNumberOfIdentifiers(),
+ binary_states_matrix
+ .getNumberOfCharacters() );
int total_gains = 0;
int total_losses = 0;
int total_unchanged = 0;
final PhylogenyNode node = it.next();
final String name = node.getName();
final BinaryStates bin_state = binary_states_matrix.getState( binary_states_matrix
- .getIdentifierIndex( name ), c );
+ .getIdentifierIndex( name ), c );
final PhylogenyNode parent_node = getPhylogeny().getNode( name ).getParent();
GainLossStates gl_state = null;
if ( node.isRoot() ) {
}
else {
final BinaryStates parent_bin_state = binary_states_matrix.getState( binary_states_matrix
- .getIdentifierIndex( parent_node.getName() ), c );
+ .getIdentifierIndex( parent_node.getName() ), c );
if ( bin_state == BinaryStates.ABSENT ) {
if ( parent_bin_state == BinaryStates.ABSENT ) {
++total_unchanged;
final List<GenomeWideCombinableDomains> gwcd_list ) {
if ( phylogeny.getNumberOfExternalNodes() != gwcd_list.size() ) {
throw new IllegalArgumentException( "number of external nodes [" + phylogeny.getNumberOfExternalNodes()
- + "] does not equal size of genome wide combinable domains list [" + gwcd_list.size() + "]" );
+ + "] does not equal size of genome wide combinable domains list [" + gwcd_list.size() + "]" );
}
return new DomainParsimonyCalculator( phylogeny, gwcd_list );
}
}
return new DomainParsimonyCalculator( phylogeny, gwcd_list, domain_id_to_secondary_features_map );
}
-
+ @SuppressWarnings("unchecked")
public static CharacterStateMatrix<BinaryStates> createMatrixOfBinaryDomainCombinationPresenceOrAbsence( final List<GenomeWideCombinableDomains> gwcd_list ) {
if ( gwcd_list.isEmpty() ) {
throw new IllegalArgumentException( "genome wide combinable domains list is empty" );
}
final int number_of_characters = all_binary_combinations.size();
final CharacterStateMatrix<CharacterStateMatrix.BinaryStates> matrix = new BasicCharacterStateMatrix<CharacterStateMatrix.BinaryStates>( number_of_identifiers,
- number_of_characters );
+ number_of_characters );
int character_index = 0;
for( final BinaryDomainCombination bc : all_binary_combinations ) {
matrix.setCharacter( character_index++, bc.toString() );
}
int number_of_characters = all_domain_ids.size();
if ( positive_filter != null ) {
- //number_of_characters = positive_filter.size(); -- bad if doms in filter but not in genomes
+ //number_of_characters = positive_filter.size(); -- bad if doms in filter but not in genomes
number_of_characters = 0;
for( final String id : all_domain_ids ) {
if ( positive_filter.contains( id ) ) {
}
}
final CharacterStateMatrix<CharacterStateMatrix.BinaryStates> matrix = new BasicCharacterStateMatrix<CharacterStateMatrix.BinaryStates>( number_of_identifiers,
- number_of_characters );
+ number_of_characters );
int character_index = 0;
for( final String id : all_domain_ids ) {
if ( positive_filter == null ) {
}
return matrix;
}
-
+ @SuppressWarnings("unchecked")
public static CharacterStateMatrix<BinaryStates> createMatrixOfSecondaryFeatureBinaryDomainCombinationPresenceOrAbsence( final List<GenomeWideCombinableDomains> gwcd_list,
final Map<String, String> domain_id_to_second_features_map ) {
if ( gwcd_list.isEmpty() ) {
}
if ( !no_mappings.isEmpty() ) {
ForesterUtil.programMessage( surfacing.PRG_NAME, "No mappings for the following (" + no_mappings.size()
- + "):" );
+ + "):" );
for( final String id : no_mappings ) {
ForesterUtil.programMessage( surfacing.PRG_NAME, id );
}
}
final int number_of_characters = all_binary_combinations_mapped.size();
final CharacterStateMatrix<CharacterStateMatrix.BinaryStates> matrix = new BasicCharacterStateMatrix<CharacterStateMatrix.BinaryStates>( number_of_identifiers,
- number_of_characters );
+ number_of_characters );
int character_index = 0;
for( final BinaryDomainCombination bc : all_binary_combinations_mapped ) {
matrix.setCharacter( character_index++, bc.toString() );
/**
* For folds instead of Pfam-domains, for example
- *
- *
+ *
+ *
* @param gwcd_list
* @return
*/
}
final int number_of_characters = all_secondary_features.size();
final CharacterStateMatrix<CharacterStateMatrix.BinaryStates> matrix = new BasicCharacterStateMatrix<CharacterStateMatrix.BinaryStates>( number_of_identifiers,
- number_of_characters );
+ number_of_characters );
int character_index = 0;
for( final String second_id : all_secondary_features ) {
matrix.setCharacter( character_index++, second_id );