import org.forester.go.OBOparser;
import org.forester.go.PfamToGoMapping;
import org.forester.go.PfamToGoParser;
-import org.forester.protein.DomainId;
public class pfam2go_extractor {
}
final SortedSet<String> pfams = new TreeSet<String>();
for( final PfamToGoMapping pfam_to_go_mapping : pfam2go ) {
- final DomainId domain_id = pfam_to_go_mapping.getKey();
+ final String domain_id = pfam_to_go_mapping.getKey();
final GoId go_id = pfam_to_go_mapping.getValue();
final Set<GoId> supers = GoUtils.getAllSuperGoIds( go_id, goid_to_term_map );
supers.add( go_id );
encountered_domains.add( line );
boolean found = false;
for( final PfamToGoMapping mapping : mappings ) {
- if ( mapping.getKey().getId().equals( line ) ) {
+ if ( mapping.getKey().equals( line ) ) {
System.out.println( mapping.getValue() );
found = true;
}
total_pfam_ids++;
boolean mapped = false;
for( final PfamToGoMapping pfam_to_go_mapping : pfam2go ) {
- if ( pfam_to_go_mapping.getKey().getId().equals( pfam_id ) ) {
+ if ( pfam_to_go_mapping.getKey().equals( pfam_id ) ) {
mapped = true;
System.out.println( pfam_to_go_mapping.getValue().toString() );
}
import org.forester.phylogeny.iterators.PhylogenyNodeIterator;
import org.forester.protein.BinaryDomainCombination;
import org.forester.protein.Domain;
-import org.forester.protein.DomainId;
import org.forester.protein.Protein;
import org.forester.species.BasicSpecies;
import org.forester.species.Species;
final static private String INPUT_GENOMES_FILE_OPTION = "genomes";
final static private String INPUT_SPECIES_TREE_OPTION = "species_tree";
final static private String SEQ_EXTRACT_OPTION = "prot_extract";
- final static private String PRG_VERSION = "2.270";
- final static private String PRG_DATE = "130628";
+ final static private String PRG_VERSION = "2.280";
+ final static private String PRG_DATE = "130701";
final static private String E_MAIL = "czmasek@burnham.org";
final static private String WWW = "www.phylosoft.org/forester/applications/surfacing";
final static private boolean IGNORE_DUFS_DEFAULT = true;
final Writer out = ForesterUtil.createBufferedWriter( output_file );
final SortedMap<Object, Integer> bdc_to_counts = ForesterUtil
.listToSortedCountsMap( all_bin_domain_combinations_changed );
- final SortedSet<DomainId> all_domains_in_combination_changed_more_than_once = new TreeSet<DomainId>();
- final SortedSet<DomainId> all_domains_in_combination_changed_only_once = new TreeSet<DomainId>();
+ final SortedSet<String> all_domains_in_combination_changed_more_than_once = new TreeSet<String>();
+ final SortedSet<String> all_domains_in_combination_changed_only_once = new TreeSet<String>();
int above_one = 0;
int one = 0;
for( final Object bdc_object : bdc_to_counts.keySet() ) {
final List<String> plus_minus_analysis_low_copy,
final List<GenomeWideCombinableDomains> gwcd_list,
final SortedMap<Species, List<Protein>> protein_lists_per_species,
- final Map<DomainId, List<GoId>> domain_id_to_go_ids_map,
+ final Map<String, List<GoId>> domain_id_to_go_ids_map,
final Map<GoId, GoTerm> go_id_to_term_map,
final List<Object> plus_minus_analysis_numbers ) {
final Set<String> all_spec = new HashSet<String>();
SurfacingUtil.checkForOutputFileWriteability( dcc_outfile );
}
File pfam_to_go_file = null;
- Map<DomainId, List<GoId>> domain_id_to_go_ids_map = null;
+ Map<String, List<GoId>> domain_id_to_go_ids_map = null;
int domain_id_to_go_ids_count = 0;
if ( cla.isOptionSet( surfacing.PFAM_TO_GO_FILE_USE_OPTION ) ) {
if ( !cla.isOptionValueSet( surfacing.PFAM_TO_GO_FILE_USE_OPTION ) ) {
}
radomize_fitch_parsimony = true;
}
- SortedSet<DomainId> filter = null;
+ SortedSet<String> filter = null;
if ( ( positive_filter_file != null ) || ( negative_filter_file != null )
|| ( negative_domains_filter_file != null ) ) {
- filter = new TreeSet<DomainId>();
+ filter = new TreeSet<String>();
if ( positive_filter_file != null ) {
processFilter( positive_filter_file, filter );
}
processFilter( negative_domains_filter_file, filter );
}
}
- Map<DomainId, Set<String>>[] domain_id_to_secondary_features_maps = null;
+ Map<String, Set<String>>[] domain_id_to_secondary_features_maps = null;
File[] secondary_features_map_files = null;
final File domain_lengths_analysis_outfile = new File( out_dir + ForesterUtil.FILE_SEPARATOR + output_file
+ DOMAIN_LENGTHS_ANALYSIS_SUFFIX );
if ( VERBOSE ) {
System.out.println();
System.out.println( "Domain ids to secondary features map:" );
- for( final DomainId domain_id : domain_id_to_secondary_features_maps[ i ].keySet() ) {
- System.out.print( domain_id.getId() );
+ for( final String domain_id : domain_id_to_secondary_features_maps[ i ].keySet() ) {
+ System.out.print( domain_id );
System.out.print( " => " );
for( final String sec : domain_id_to_secondary_features_maps[ i ].get( domain_id ) ) {
System.out.print( sec );
html_desc.append( "<tr><td>Command line:</td><td>\n" + cla.getCommandLineArgsAsString() + "\n</td></tr>" + nl );
System.out.println( "Command line : " + cla.getCommandLineArgsAsString() );
BufferedWriter[] query_domains_writer_ary = null;
- List<DomainId>[] query_domain_ids_array = null;
+ List<String>[] query_domain_ids_array = null;
if ( query_domain_ids != null ) {
final String[] query_domain_ids_str_array = query_domain_ids.split( "#" );
query_domain_ids_array = new ArrayList[ query_domain_ids_str_array.length ];
for( int i = 0; i < query_domain_ids_str_array.length; i++ ) {
String query_domain_ids_str = query_domain_ids_str_array[ i ];
final String[] query_domain_ids_str_ary = query_domain_ids_str.split( "~" );
- final List<DomainId> query = new ArrayList<DomainId>();
+ final List<String> query = new ArrayList<String>();
for( final String element : query_domain_ids_str_ary ) {
- query.add( new DomainId( element ) );
+ query.add( element );
}
query_domain_ids_array[ i ] = query;
query_domain_ids_str = query_domain_ids_str.replace( '~', '_' );
protein_lists_per_species = new TreeMap<Species, List<Protein>>();
}
final List<GenomeWideCombinableDomains> gwcd_list = new ArrayList<GenomeWideCombinableDomains>( number_of_genomes );
- final SortedSet<DomainId> all_domains_encountered = new TreeSet<DomainId>();
+ final SortedSet<String> all_domains_encountered = new TreeSet<String>();
final SortedSet<BinaryDomainCombination> all_bin_domain_combinations_encountered = new TreeSet<BinaryDomainCombination>();
List<BinaryDomainCombination> all_bin_domain_combinations_gained_fitch = null;
List<BinaryDomainCombination> all_bin_domain_combinations_lost_fitch = null;
if ( ( domain_id_to_secondary_features_maps != null )
&& ( domain_id_to_secondary_features_maps.length > 0 ) ) {
int j = 0;
- for( final Map<DomainId, Set<String>> domain_id_to_secondary_features_map : domain_id_to_secondary_features_maps ) {
+ for( final Map<String, Set<String>> domain_id_to_secondary_features_map : domain_id_to_secondary_features_maps ) {
final Map<Species, MappingResults> mapping_results_map = new TreeMap<Species, MappingResults>();
final DomainParsimonyCalculator secondary_features_parsimony = DomainParsimonyCalculator
.createInstance( intree, gwcd_list, domain_id_to_secondary_features_map );
System.out.println();
}
- private static void processFilter( final File filter_file, final SortedSet<DomainId> filter ) {
+ private static void processFilter( final File filter_file, final SortedSet<String> filter ) {
SortedSet<String> filter_str = null;
try {
filter_str = ForesterUtil.file2set( filter_file );
}
if ( filter_str != null ) {
for( final String string : filter_str ) {
- filter.add( new DomainId( string ) );
+ filter.add( string );
}
}
if ( VERBOSE ) {
System.out.println( "Filter:" );
- for( final DomainId domainId : filter ) {
- System.out.println( domainId.getId() );
+ for( final String domainId : filter ) {
+ System.out.println( domainId );
}
}
}
private static void writePresentToNexus( final File output_file,
final File positive_filter_file,
- final SortedSet<DomainId> filter,
+ final SortedSet<String> filter,
final List<GenomeWideCombinableDomains> gwcd_list ) {
try {
SurfacingUtil
final SortedMap<Species, List<Protein>> protein_lists_per_species,
final List<GenomeWideCombinableDomains> gwcd_list,
final double domain_e_cutoff ) {
- final SortedSet<DomainId> all_domains = new TreeSet<DomainId>();
+ final SortedSet<String> all_domains = new TreeSet<String>();
for( final GenomeWideCombinableDomains gwcd : gwcd_list ) {
all_domains.addAll( gwcd.getAllDomainIds() );
}
- for( final DomainId domain : all_domains ) {
+ for( final String domain : all_domains ) {
final File out = new File( output_dir + ForesterUtil.FILE_SEPARATOR + domain + SEQ_EXTRACT_SUFFIX );
SurfacingUtil.checkForOutputFileWriteability( out );
try {
package org.forester.go;
-import org.forester.protein.DomainId;
-
public class PfamToGoMapping implements Mapping {
- private final DomainId _pfam_domain_id;
- private final GoId _go_id;
+ private final String _pfam_domain_id;
+ private final GoId _go_id;
- public PfamToGoMapping( final DomainId pfam_domain_id, final GoId go_id ) {
+ public PfamToGoMapping( final String pfam_domain_id, final GoId go_id ) {
_pfam_domain_id = pfam_domain_id;
_go_id = go_id;
}
if ( this == m ) {
return 0;
}
- return getKey().compareTo( ( DomainId ) m.getKey() );
+ return getKey().compareTo( ( String ) m.getKey() );
}
/**
}
@Override
- public DomainId getKey() {
+ public String getKey() {
return _pfam_domain_id;
}
import java.util.regex.Matcher;
import java.util.regex.Pattern;
-import org.forester.protein.DomainId;
import org.forester.util.ForesterUtil;
public class PfamToGoParser {
if ( ForesterUtil.isEmpty( pfam ) || ForesterUtil.isEmpty( go ) ) {
throw new IOException( "unexpected format [\"" + line + "\"]" );
}
- final PfamToGoMapping map = new PfamToGoMapping( new DomainId( pfam ), new GoId( go ) );
+ final PfamToGoMapping map = new PfamToGoMapping( pfam, new GoId( go ) );
++_mapping_count;
mappings.add( map );
}
import java.util.Map;
import java.util.SortedSet;
-import org.forester.protein.DomainId;
import org.forester.util.ForesterUtil;
public class TestGo {
private static boolean testPfamToGoMapping() {
try {
- final PfamToGoMapping pg0 = new PfamToGoMapping( new DomainId( "A" ), new GoId( "GO:0000001" ) );
- final PfamToGoMapping pg1 = new PfamToGoMapping( new DomainId( "A" ), new GoId( "GO:0000001" ) );
- final PfamToGoMapping pg2 = new PfamToGoMapping( new DomainId( "B" ), new GoId( "GO:0000001" ) );
- final PfamToGoMapping pg3 = new PfamToGoMapping( new DomainId( "A" ), new GoId( "GO:0000002" ) );
- final PfamToGoMapping pg4 = new PfamToGoMapping( new DomainId( "B" ), new GoId( "GO:0000002" ) );
+ final PfamToGoMapping pg0 = new PfamToGoMapping( "A", new GoId( "GO:0000001" ) );
+ final PfamToGoMapping pg1 = new PfamToGoMapping( "A", new GoId( "GO:0000001" ) );
+ final PfamToGoMapping pg2 = new PfamToGoMapping( "B", new GoId( "GO:0000001" ) );
+ final PfamToGoMapping pg3 = new PfamToGoMapping( "A", new GoId( "GO:0000002" ) );
+ final PfamToGoMapping pg4 = new PfamToGoMapping( "B", new GoId( "GO:0000002" ) );
if ( !pg0.equals( pg0 ) ) {
return false;
}
final PfamToGoMapping m5 = mappings.get( 5 );
final PfamToGoMapping m424 = mappings.get( 424 );
final PfamToGoMapping m425 = mappings.get( 425 );
- if ( !m0.getKey().equals( new DomainId( "7tm_1" ) ) ) {
+ if ( !m0.getKey().equals( "7tm_1" ) ) {
return false;
}
if ( !m0.getValue().equals( new GoId( "GO:0001584" ) ) ) {
return false;
}
- if ( m0.getKey().equals( new DomainId( "7tm_x" ) ) ) {
+ if ( m0.getKey().equals( "7tm_x" ) ) {
return false;
}
if ( m0.getValue().equals( new GoId( "GO:0001585" ) ) ) {
return false;
}
- if ( !m1.getKey().equals( new DomainId( "7tm_1" ) ) ) {
+ if ( !m1.getKey().equals( "7tm_1" ) ) {
return false;
}
if ( !m1.getValue().equals( new GoId( "GO:0007186" ) ) ) {
return false;
}
- if ( !m2.getKey().equals( new DomainId( "7tm_1" ) ) ) {
+ if ( !m2.getKey().equals( "7tm_1" ) ) {
return false;
}
if ( !m2.getValue().equals( new GoId( "GO:0016021" ) ) ) {
return false;
}
- if ( !m3.getKey().equals( new DomainId( "7tm_2" ) ) ) {
+ if ( !m3.getKey().equals( "7tm_2" ) ) {
return false;
}
if ( !m3.getValue().equals( new GoId( "GO:0004930" ) ) ) {
return false;
}
- if ( !m4.getKey().equals( new DomainId( "7tm_2" ) ) ) {
+ if ( !m4.getKey().equals( "7tm_2" ) ) {
return false;
}
if ( !m4.getValue().equals( new GoId( "GO:0016020" ) ) ) {
return false;
}
- if ( !m5.getKey().equals( new DomainId( "7tm_3" ) ) ) {
+ if ( !m5.getKey().equals( "7tm_3" ) ) {
return false;
}
if ( !m5.getValue().equals( new GoId( "GO:0008067" ) ) ) {
return false;
}
- if ( !m424.getKey().equals( new DomainId( "OMPdecase" ) ) ) {
+ if ( !m424.getKey().equals( "OMPdecase" ) ) {
return false;
}
if ( !m424.getValue().equals( new GoId( "GO:0006207" ) ) ) {
return false;
}
- if ( !m425.getKey().equals( new DomainId( "Bac_DNA_binding" ) ) ) {
+ if ( !m425.getKey().equals( "Bac_DNA_binding" ) ) {
return false;
}
if ( !m425.getValue().equals( new GoId( "GO:0003677" ) ) ) {
import org.forester.go.GoUtils;
import org.forester.go.OBOparser;
import org.forester.go.PfamToGoMapping;
-import org.forester.protein.DomainId;
import org.forester.species.BasicSpecies;
import org.forester.species.Species;
import org.forester.surfacing.SurfacingConstants;
}
private static StringBuilder obtainDomainsForGoId( final List<PfamToGoMapping> pfam_to_go,
- final SortedSet<DomainId> domains_per_species,
+ final SortedSet<String> domains_per_species,
final Map<GoId, GoTerm> all_go_terms,
final GoId query_go_id,
- final Set<DomainId> found_domain_ids ) {
+ final Set<String> found_domain_ids ) {
final StringBuilder sb = new StringBuilder();
- D: for( final DomainId domain_id : domains_per_species ) {
+ D: for( final String domain_id : domains_per_species ) {
for( final PfamToGoMapping ptg : pfam_to_go ) {
if ( ptg.getKey().equals( domain_id ) ) {
final GoId go_id = ptg.getValue();
return species;
}
- private static SortedMap<Species, SortedSet<DomainId>> parseDomainGainLossFile( final File input )
- throws IOException {
+ private static SortedMap<Species, SortedSet<String>> parseDomainGainLossFile( final File input ) throws IOException {
final String error = ForesterUtil.isReadableFile( input );
if ( !ForesterUtil.isEmpty( error ) ) {
throw new IOException( error );
}
- final SortedMap<Species, SortedSet<DomainId>> speciesto_to_domain_id = new TreeMap<Species, SortedSet<DomainId>>();
+ final SortedMap<Species, SortedSet<String>> speciesto_to_domain_id = new TreeMap<Species, SortedSet<String>>();
final BufferedReader br = new BufferedReader( new FileReader( input ) );
String line;
int line_number = 0;
}
else if ( line.startsWith( "#" ) ) {
current_species = new BasicSpecies( line.substring( 1 ) );
- speciesto_to_domain_id.put( current_species, new TreeSet<DomainId>() );
+ speciesto_to_domain_id.put( current_species, new TreeSet<String>() );
if ( VERBOSE ) {
ForesterUtil.programMessage( PRG_NAME, "saw " + current_species );
}
if ( current_species == null ) {
throw new IOException( "parsing problem [at line " + line_number + "] in [" + input + "]" );
}
- speciesto_to_domain_id.get( current_species ).add( new DomainId( line ) );
+ speciesto_to_domain_id.get( current_species ).add( new String( line ) );
}
}
}
final SortedMap<String, SortedSet<OntologizerResult>> species_to_results_map,
final String species,
final double p_adjusted_upper_limit,
- final SortedSet<DomainId> domains_per_species,
+ final SortedSet<String> domains_per_species,
final List<PfamToGoMapping> pfam_to_go,
- final Set<DomainId> domain_ids_with_go_annot ) throws IOException {
+ final Set<String> domain_ids_with_go_annot ) throws IOException {
final SortedSet<OntologizerResult> ontologizer_results = species_to_results_map.get( species );
for( final OntologizerResult ontologizer_result : ontologizer_results ) {
final GoTerm go_term = go_id_to_terms.get( ontologizer_result.getGoId() );
throw new IllegalArgumentException( "adjusted P values limit [" + p_adjusted_upper_limit
+ "] is out of range" );
}
- SortedMap<Species, SortedSet<DomainId>> speciesto_to_domain_id = null;
+ SortedMap<Species, SortedSet<String>> speciesto_to_domain_id = null;
if ( domain_gain_loss_file != null ) {
if ( !domain_gain_loss_file.exists() ) {
throw new IllegalArgumentException( "[" + domain_gain_loss_file + "] does not exist" );
GoNameSpace.GoNamespaceType.MOLECULAR_FUNCTION ) ) {
writeHtmlSpecies( m_html_writer, species );
}
- SortedSet<DomainId> domains_per_species = null;
+ SortedSet<String> domains_per_species = null;
if ( ( speciesto_to_domain_id != null ) && ( speciesto_to_domain_id.size() > 0 ) ) {
domains_per_species = speciesto_to_domain_id.get( new BasicSpecies( species ) );
}
- final Set<DomainId> domain_ids_with_go_annot = new HashSet<DomainId>();
+ final Set<String> domain_ids_with_go_annot = new HashSet<String>();
processOneSpecies( go_id_to_terms,
b_html_writer,
b_tab_writer,
}
private static void writeHtmlDomains( final Writer writer,
- final SortedSet<DomainId> domains,
- final Set<DomainId> domain_ids_with_go_annot ) throws IOException {
+ final SortedSet<String> domains,
+ final Set<String> domain_ids_with_go_annot ) throws IOException {
writer.write( "<tr>" );
writer.write( "<td colspan=\"10\">" );
if ( domains != null ) {
- for( final DomainId domain : domains ) {
+ for( final String domain : domains ) {
if ( !domain_ids_with_go_annot.contains( domain ) ) {
writer.write( "[<a class=\"new_type\" href=\"" + SurfacingConstants.PFAM_FAMILY_ID_LINK + domain
+ "\">" + domain + "</a>] " );
final double p_adjusted_upper_limit,
final String species,
final Map<GoId, GoTerm> go_id_to_terms,
- final SortedSet<DomainId> domains_per_species,
+ final SortedSet<String> domains_per_species,
final List<PfamToGoMapping> pfam_to_go,
- final Set<DomainId> domain_ids_with_go_annot ) throws IOException {
+ final Set<String> domain_ids_with_go_annot ) throws IOException {
final Color p_adj_color = ForesterUtil.calcColor( ontologizer_result.getPAdjusted(),
0,
p_adjusted_upper_limit,
import org.forester.protein.BasicDomain;
import org.forester.protein.BasicProtein;
import org.forester.protein.Domain;
-import org.forester.protein.DomainId;
import org.forester.protein.Protein;
import org.forester.surfacing.SurfacingUtil;
import org.forester.util.ForesterUtil;
private static final ReturnType RETURN_TYPE_DEFAULT = ReturnType.UNORDERED_PROTEIN_DOMAIN_COLLECTION_PER_PROTEIN;
private static final boolean IGNORE_DUFS_DEFAULT = false;
private static final int MAX_ALLOWED_OVERLAP_DEFAULT = -1;
- private final Set<DomainId> _filter;
+ private final Set<String> _filter;
private final FilterType _filter_type;
private final File _input_file;
private final String _species;
private int _domains_ignored_due_to_e_value;
private int _domains_ignored_due_to_individual_score_cutoff;
private int _domains_stored;
- private SortedSet<DomainId> _domains_stored_set;
+ private SortedSet<String> _domains_stored_set;
private long _time;
private int _domains_ignored_due_to_negative_domain_filter;
private Map<String, Integer> _domains_ignored_due_to_negative_domain_filter_counts_map;
public HmmPfamOutputParser( final File input_file,
final String species,
final String model_type,
- final Set<DomainId> filter,
+ final Set<String> filter,
final FilterType filter_type ) {
_input_file = input_file;
_species = species;
private void addProtein( final List<Protein> proteins, final Protein current_protein ) {
if ( ( getFilterType() == FilterType.POSITIVE_PROTEIN ) || ( getFilterType() == FilterType.NEGATIVE_PROTEIN ) ) {
- final Set<DomainId> domain_ids_in_protein = new HashSet<DomainId>();
+ final Set<String> domain_ids_in_protein = new HashSet<String>();
for( final Domain d : current_protein.getProteinDomains() ) {
domain_ids_in_protein.add( d.getDomainId() );
}
return _domains_stored;
}
- public SortedSet<DomainId> getDomainsStoredSet() {
+ public SortedSet<String> getDomainsStoredSet() {
return _domains_stored_set;
}
return _e_value_maximum;
}
- private Set<DomainId> getFilter() {
+ private Set<String> getFilter() {
return _filter;
}
}
private void intitCounts() {
- setDomainsStoredSet( new TreeSet<DomainId>() );
+ setDomainsStoredSet( new TreeSet<String>() );
setDomainsEncountered( 0 );
setProteinsEncountered( 0 );
setProteinsIgnoredDueToFilter( 0 );
ForesterUtil.increaseCountingMap( getDomainsIgnoredDueToVirusLikeIdCountsMap(), id );
++_domains_ignored_due_to_virus_like_id;
}
- else if ( ( getFilterType() == FilterType.NEGATIVE_DOMAIN )
- && getFilter().contains( new DomainId( id ) ) ) {
+ else if ( ( getFilterType() == FilterType.NEGATIVE_DOMAIN ) && getFilter().contains( id ) ) {
++_domains_ignored_due_to_negative_domain_filter;
ForesterUtil.increaseCountingMap( getDomainsIgnoredDueToNegativeDomainFilterCountsMap(), id );
}
_domains_stored = domains_stored;
}
- private void setDomainsStoredSet( final SortedSet<DomainId> _storeddomains_stored ) {
+ private void setDomainsStoredSet( final SortedSet<String> _storeddomains_stored ) {
_domains_stored_set = _storeddomains_stored;
}
import org.forester.protein.BasicDomain;
import org.forester.protein.BasicProtein;
import org.forester.protein.Domain;
-import org.forester.protein.DomainId;
import org.forester.protein.Protein;
import org.forester.surfacing.SurfacingUtil;
import org.forester.util.ForesterUtil;
private static final boolean IGNORE_DUFS_DEFAULT = false;
private static final int MAX_ALLOWED_OVERLAP_DEFAULT = -1;
private static final boolean IGNORE_REPLACED_RRMS = false;
- private final Set<DomainId> _filter;
+ private final Set<String> _filter;
private final FilterType _filter_type;
private final File _input_file;
private final String _species;
private int _domains_ignored_due_to_e_value;
private int _domains_ignored_due_to_individual_score_cutoff;
private int _domains_stored;
- private SortedSet<DomainId> _domains_stored_set;
+ private SortedSet<String> _domains_stored_set;
private long _time;
private int _domains_ignored_due_to_negative_domain_filter;
private Map<String, Integer> _domains_ignored_due_to_negative_domain_filter_counts_map;
public HmmscanPerDomainTableParser( final File input_file,
final String species,
- final Set<DomainId> filter,
+ final Set<String> filter,
final FilterType filter_type,
final INDIVIDUAL_SCORE_CUTOFF individual_cutoff_applies_to ) {
_input_file = input_file;
public HmmscanPerDomainTableParser( final File input_file,
final String species,
- final Set<DomainId> filter,
+ final Set<String> filter,
final FilterType filter_type,
final INDIVIDUAL_SCORE_CUTOFF individual_cutoff_applies_to,
final boolean allow_proteins_with_same_name ) {
_domains_ignored_due_to_overlap += domains_removed;
}
if ( ( getFilterType() == FilterType.POSITIVE_PROTEIN ) || ( getFilterType() == FilterType.NEGATIVE_PROTEIN ) ) {
- final Set<DomainId> domain_ids_in_protein = new HashSet<DomainId>();
+ final Set<String> domain_ids_in_protein = new HashSet<String>();
for( final Domain d : current_protein.getProteinDomains() ) {
domain_ids_in_protein.add( d.getDomainId() );
}
return _domains_stored;
}
- public SortedSet<DomainId> getDomainsStoredSet() {
+ public SortedSet<String> getDomainsStoredSet() {
return _domains_stored_set;
}
return _e_value_maximum;
}
- private Set<DomainId> getFilter() {
+ private Set<String> getFilter() {
return _filter;
}
}
private void intitCounts() {
- setDomainsStoredSet( new TreeSet<DomainId>() );
+ setDomainsStoredSet( new TreeSet<String>() );
setDomainsEncountered( 0 );
setProteinsEncountered( 0 );
setProteinsIgnoredDueToFilter( 0 );
ForesterUtil.increaseCountingMap( getDomainsIgnoredDueToVirusLikeIdCountsMap(), target_id );
++_domains_ignored_due_to_virus_like_id;
}
- else if ( ( getFilterType() == FilterType.NEGATIVE_DOMAIN )
- && getFilter().contains( new DomainId( target_id ) ) ) {
+ else if ( ( getFilterType() == FilterType.NEGATIVE_DOMAIN ) && getFilter().contains( target_id ) ) {
++_domains_ignored_due_to_negative_domain_filter;
ForesterUtil.increaseCountingMap( getDomainsIgnoredDueToNegativeDomainFilterCountsMap(), target_id );
}
_domains_stored = domains_stored;
}
- private void setDomainsStoredSet( final SortedSet<DomainId> _storeddomains_stored ) {
+ private void setDomainsStoredSet( final SortedSet<String> _storeddomains_stored ) {
_domains_stored_set = _storeddomains_stored;
}
package org.forester.protein;
-import org.forester.go.GoId;
import org.forester.util.ForesterUtil;
public class BasicDomain implements Domain {
- final private DomainId _id;
- final private int _from;
- final private int _to;
- final private short _number;
- final private short _total_count;
- final private double _per_sequence_evalue;
- final private double _per_sequence_score;
- final private double _per_domain_evalue;
- final private double _per_domain_score;
-
- public BasicDomain( final String id_str ) {
- if ( ForesterUtil.isEmpty( id_str ) ) {
+ final private String _id;
+ final private int _from;
+ final private int _to;
+ final private short _number;
+ final private short _total_count;
+ final private double _per_sequence_evalue;
+ final private double _per_sequence_score;
+ final private double _per_domain_evalue;
+ final private double _per_domain_score;
+
+ public BasicDomain( final String id ) {
+ if ( ForesterUtil.isEmpty( id ) ) {
throw new IllegalArgumentException( "attempt to create protein domain with null or empty id" );
}
- _id = new DomainId( id_str );
+ _id = id;
_from = -1;
_to = -1;
_number = -1;
_per_domain_score = -1;
}
- public BasicDomain( final String id_str,
+ public BasicDomain( final String id,
final int from,
final int to,
final short number,
final short total_count,
final double per_sequence_evalue,
final double per_sequence_score ) {
- this( id_str, from, to, number, total_count, per_sequence_evalue, per_sequence_score, 0, 0 );
+ this( id, from, to, number, total_count, per_sequence_evalue, per_sequence_score, 0, 0 );
}
- public BasicDomain( final String id_str,
+ public BasicDomain( final String id,
final int from,
final int to,
final short number,
if ( ( from >= to ) || ( from < 0 ) ) {
throw new IllegalArgumentException( "attempt to create protein domain from " + from + " to " + to );
}
- if ( ForesterUtil.isEmpty( id_str ) ) {
+ if ( ForesterUtil.isEmpty( id ) ) {
throw new IllegalArgumentException( "attempt to create protein domain with null or empty id" );
}
if ( ( number > total_count ) || ( number < 0 ) ) {
if ( ( per_sequence_evalue < 0.0 ) || ( per_domain_evalue < 0.0 ) ) {
throw new IllegalArgumentException( "attempt to create protein domain with negative E-value" );
}
- _id = new DomainId( id_str );
+ _id = id;
_from = from;
_to = to;
_number = number;
_per_domain_score = per_domain_score;
}
- @Override
- public void addGoId( final GoId go_id ) {
- getDomainId().getGoIds().add( go_id );
- }
-
+ // ^^ @Override
+ // ^^ public void addGoId( final GoId go_id ) {
+ // ^^ getDomainId().getGoIds().add( go_id );
+ // ^^ }
/**
* Basic domains are compared/sorted based upon their identifiers (case
* insensitive) and their numbers.
}
@Override
- public DomainId getDomainId() {
+ public String getDomainId() {
return _id;
}
return _from;
}
- @Override
- public GoId getGoId( final int i ) {
- return getDomainId().getGoIds().get( i );
- }
-
+ // ^^ @Override
+ // ^^ public GoId getGoId( final int i ) {
+ // ^^ return getDomainId().getGoIds().get( i );
+ // ^^ }
@Override
public short getNumber() {
return _number;
}
- @Override
- public int getNumberOfGoIds() {
- return getDomainId().getGoIds().size();
- }
-
+ // ^^ @Override
+ // ^^ public int getNumberOfGoIds() {
+ // ^^ return getDomainId().getGoIds().size();
+ // ^^ }
@Override
public double getPerDomainEvalue() {
return _per_domain_evalue;
@Override
public int hashCode() {
- return getDomainId().getId().hashCode();
+ return getDomainId().hashCode();
}
@Override
public String toString() {
- return toStringBuffer().toString();
+ return getDomainId();
}
public StringBuffer toStringBuffer() {
- return new StringBuffer( getDomainId().getId() );
+ return new StringBuffer( getDomainId() );
}
@Override
final int m1 = ( d1.getTo() + d1.getFrom() );
final int m2 = ( d2.getTo() + d2.getFrom() );
return m1 < m2 ? -1 : m1 > m2 ? 1 : d1
- .getDomainId().getId()
- .compareTo( d2.getDomainId().getId() );
+ .getDomainId()
+ .compareTo( d2.getDomainId() );
}
};
* @param in_nc_order to consider order
* @return
*/
- public boolean contains( final List<DomainId> query_domain_ids, final boolean in_nc_order ) {
+ public boolean contains( final List<String> query_domain_ids, final boolean in_nc_order ) {
if ( !in_nc_order ) {
- for( final DomainId query_domain_id : query_domain_ids ) {
+ for( final String query_domain_id : query_domain_ids ) {
if ( !getProteinDomainIds().contains( query_domain_id ) ) {
return false;
}
}
else {
int current_start_position = -1;
- I: for( final DomainId query_domain_id : query_domain_ids ) {
+ I: for( final String query_domain_id : query_domain_ids ) {
if ( getProteinDomainIds().contains( query_domain_id ) ) {
final List<Domain> found_domains = getProteinDomains( query_domain_id );
final SortedSet<Integer> ordered_start_positions = new TreeSet<Integer>();
}
@Override
- public int getProteinDomainCount( final DomainId domain_id ) {
+ public int getProteinDomainCount( final String domain_id ) {
return getProteinDomains( domain_id ).size();
}
}
@Override
- public List<Domain> getProteinDomains( final DomainId domain_id ) {
+ public List<Domain> getProteinDomains( final String domain_id ) {
final List<Domain> domains = new ArrayList<Domain>();
for( final Domain domain : getProteinDomains() ) {
if ( domain.getDomainId().equals( domain_id ) ) {
else {
sb.append( separator );
}
- sb.append( d.getDomainId().getId() );
+ sb.append( d.getDomainId() );
}
return sb.toString();
}
String prev_id = "";
int counter = 1;
for( final Domain d : getDomainsSortedByPosition() ) {
- final String id = d.getDomainId().getId();
+ final String id = d.getDomainId();
if ( prev_id.equals( id ) ) {
counter++;
}
return toDomainArchitectureString( "~" );
}
- private List<DomainId> getProteinDomainIds() {
- final List<DomainId> ids = new ArrayList<DomainId>( getProteinDomains().size() );
+ private List<String> getProteinDomainIds() {
+ final List<String> ids = new ArrayList<String>( getProteinDomains().size() );
for( final Domain domain : getProteinDomains() ) {
ids.add( domain.getDomainId() );
}
public static final String SEPARATOR = "=";
- public DomainId getId0();
+ public String getId0();
- public DomainId getId1();
+ public String getId1();
public abstract StringBuffer toGraphDescribingLanguage( final OutputFormat format,
final String node_attribute,
package org.forester.protein;
-import org.forester.go.GoId;
-
public interface Domain extends Comparable<Domain> {
- public void addGoId( GoId go_id );
-
- public DomainId getDomainId();
+ // ^^ public void addGoId( GoId go_id );
+ public String getDomainId();
public int getLength();
public int getFrom();
- public GoId getGoId( int i );
-
+ // ^^ public GoId getGoId( int i );
public short getNumber();
- public int getNumberOfGoIds();
-
+ // ^^ public int getNumberOfGoIds();
public double getPerDomainEvalue();
public double getPerDomainScore();
package org.forester.protein;
-import java.util.ArrayList;
-import java.util.List;
-
-import org.forester.go.GoId;
import org.forester.util.ForesterUtil;
public class DomainId implements Comparable<DomainId> {
final private String _id;
- private List<GoId> _go_ids;
- public DomainId( final String id ) {
+ // private List<GoId> _go_ids;
+ private DomainId( final String id ) {
if ( ForesterUtil.isEmpty( id ) ) {
throw new IllegalArgumentException( "attempt to create domain id from empty or null string" );
}
throw new IllegalArgumentException( "attempt to create domain id from string containing the separator character ["
+ BinaryDomainCombination.SEPARATOR + "] for domain combinations [" + _id + "]" );
}
- setGoIds( null );
- }
-
- public void addGoId( final GoId go_id ) {
- if ( getGoIds() == null ) {
- setGoIds( new ArrayList<GoId>() );
- }
- getGoIds().add( go_id );
+ ///////////////////////////// // setGoIds( null );
}
+ // public void addGoId( final GoId go_id ) {
+ // if ( getGoIds() == null ) {
+ // setGoIds( new ArrayList<GoId>() );
+ // }
+ // getGoIds().add( go_id );
+ // }
@Override
public int compareTo( final DomainId domain_id ) {
if ( this == domain_id ) {
}
}
- public GoId getGoId( final int i ) {
- return getGoIds().get( i );
- }
-
+ // public GoId getGoId( final int i ) {
+ // return getGoIds().get( i );
+ //}
// Note.
// The fact that equals and compareTo do not behave the same in cases where ids only differ by their case
// is not ideal. From Sun regarding Interface SortedSet<E>:
// so two elements that are deemed equal by this method are, from the standpoint of the sorted set,
// equal. The behavior of a sorted set is well-defined even if its ordering is inconsistent with equals;
// it just fails to obey the general contract of the Set interface."
- public List<GoId> getGoIds() {
- return _go_ids;
- }
-
- public String getId() {
+ // public List<GoId> getGoIds() {
+ // return _go_ids;
+ // }
+ private String getId() {
return _id;
}
- public int getNumberOfGoIds() {
- if ( getGoIds() == null ) {
- return 0;
- }
- return getGoIds().size();
- }
-
+ // public int getNumberOfGoIds() {
+ // if ( getGoIds() == null ) {
+ // return 0;
+ // }
+ // return getGoIds().size();
+ // }
@Override
public int hashCode() {
return getId().hashCode();
}
- private void setGoIds( final List<GoId> go_ids ) {
- _go_ids = go_ids;
- }
-
+ // private void setGoIds( final List<GoId> go_ids ) {
+ // _go_ids = go_ids;
+ // }
@Override
public String toString() {
return getId();
* @param in_nc_order to consider order
* @return
*/
- public boolean contains( final List<DomainId> domains, final boolean in_nc_order );
+ public boolean contains( final List<String> domains, final boolean in_nc_order );
public String getAccession();
public Domain getProteinDomain( final int index );
- public int getProteinDomainCount( final DomainId domain_id );
+ public int getProteinDomainCount( final String domain_id );
public List<Domain> getProteinDomains();
- public List<Domain> getProteinDomains( final DomainId domain_id );
+ public List<Domain> getProteinDomains( final String domain_id );
public ProteinId getProteinId();
package org.forester.surfacing;
import org.forester.protein.BinaryDomainCombination;
-import org.forester.protein.DomainId;
public class AdjactantDirectedBinaryDomainCombination extends BasicBinaryDomainCombination {
- public AdjactantDirectedBinaryDomainCombination( final DomainId n_terminal, final DomainId c_terminal ) {
- super();
- if ( ( n_terminal == null ) || ( c_terminal == null ) ) {
- throw new IllegalArgumentException( "attempt to create binary domain combination using null" );
- }
- _data = n_terminal.getId() + BinaryDomainCombination.SEPARATOR + c_terminal.getId();
- }
-
public AdjactantDirectedBinaryDomainCombination( final String n_terminal, final String c_terminal ) {
super();
if ( ( n_terminal == null ) || ( c_terminal == null ) ) {
throw new IllegalArgumentException( "attempt to create binary domain combination using null" );
}
- _data = n_terminal + BinaryDomainCombination.SEPARATOR + c_terminal;
+ _id0 = n_terminal;
+ _id1 = c_terminal;
}
public static AdjactantDirectedBinaryDomainCombination createInstance( final String ids ) {
import java.util.List;
import org.forester.protein.BinaryDomainCombination;
-import org.forester.protein.DomainId;
import org.forester.species.Species;
public class AdjactantDirectedCombinableDomains extends BasicCombinableDomains {
- public AdjactantDirectedCombinableDomains( final DomainId n_terminal_key_domain, final Species species ) {
+ public AdjactantDirectedCombinableDomains( final String n_terminal_key_domain, final Species species ) {
super( n_terminal_key_domain, species );
}
@Override
public List<BinaryDomainCombination> toBinaryDomainCombinations() {
final List<BinaryDomainCombination> binary_combinations = new ArrayList<BinaryDomainCombination>( getNumberOfCombinableDomains() );
- for( final DomainId domain : getCombiningDomains().keySet() ) {
+ for( final String domain : getCombiningDomains().keySet() ) {
// Precondition (!): key domain is most upstream domain.
//TODO ensure this is true.
binary_combinations.add( new AdjactantDirectedBinaryDomainCombination( getKeyDomain(), domain ) );
package org.forester.surfacing;
import org.forester.protein.BinaryDomainCombination;
-import org.forester.protein.DomainId;
import org.forester.util.ForesterUtil;
public class BasicBinaryDomainCombination implements BinaryDomainCombination {
- String _data;
+ String _id0;
+ String _id1;
+ String _str;
BasicBinaryDomainCombination() {
- _data = null;
+ _id0 = null;
+ _id1 = null;
+ _str = null;
}
- public BasicBinaryDomainCombination( final String id_0, final String id_1 ) {
- if ( ( id_0 == null ) || ( id_1 == null ) ) {
+ private String getAsStr() {
+ if ( _str == null ) {
+ _str = _id0 + SEPARATOR + _id1;
+ }
+ return _str;
+ }
+
+ public BasicBinaryDomainCombination( final String id0, final String id1 ) {
+ if ( ( id0 == null ) || ( id1 == null ) ) {
throw new IllegalArgumentException( "attempt to create binary domain combination using null" );
}
- if ( id_0.toLowerCase().compareTo( id_1.toLowerCase() ) < 0 ) {
- _data = id_0 + BinaryDomainCombination.SEPARATOR + id_1;
+ if ( id0.toLowerCase().compareTo( id1.toLowerCase() ) < 0 ) {
+ _id0 = id0;
+ _id1 = id1;
}
else {
- _data = id_1 + BinaryDomainCombination.SEPARATOR + id_0;
+ _id0 = id1;
+ _id1 = id0;
}
}
- public BasicBinaryDomainCombination( final DomainId id_0, final DomainId id_1 ) {
- this( id_0.getId(), id_1.getId() );
- }
-
@Override
public int compareTo( final BinaryDomainCombination binary_domain_combination ) {
if ( binary_domain_combination.getClass() != this.getClass() ) {
}
@Override
- public DomainId getId0() {
- return new DomainId( _data.split( BinaryDomainCombination.SEPARATOR )[ 0 ] );
+ public String getId0() {
+ return _id0;
}
@Override
- public DomainId getId1() {
- return new DomainId( _data.split( BinaryDomainCombination.SEPARATOR )[ 1 ] );
+ public String getId1() {
+ return _id1;
}
@Override
public int hashCode() {
- return _data.hashCode();
+ return getAsStr().hashCode();
}
@Override
@Override
public String toString() {
- return _data;
+ return getAsStr();
}
public static BinaryDomainCombination createInstance( final String ids ) {
import java.util.TreeMap;
import org.forester.protein.BinaryDomainCombination;
-import org.forester.protein.DomainId;
import org.forester.species.Species;
import org.forester.util.DescriptiveStatistics;
public class BasicCombinableDomains implements CombinableDomains {
- final private DomainId _key_domain;
- private int _key_domain_count;
- private int _key_domain_proteins_count;
- final private Species _species;
- final private TreeMap<DomainId, Integer> _combining_domains;
- private DescriptiveStatistics _key_domain_confidence_statistics;
+ final private String _key_domain;
+ private int _key_domain_count;
+ private int _key_domain_proteins_count;
+ final private Species _species;
+ final private TreeMap<String, Integer> _combining_domains;
+ private DescriptiveStatistics _key_domain_confidence_statistics;
- public BasicCombinableDomains( final DomainId key_domain, final Species species ) {
+ public BasicCombinableDomains( final String key_domain, final Species species ) {
_key_domain = key_domain;
_species = species;
- _combining_domains = new TreeMap<DomainId, Integer>();
+ _combining_domains = new TreeMap<String, Integer>();
init();
}
@Override
- public void addCombinableDomain( final DomainId protein_domain ) {
+ public void addCombinableDomain( final String protein_domain ) {
if ( getCombiningDomains().containsKey( protein_domain ) ) {
getCombiningDomains().put( protein_domain, getCombiningDomains().get( protein_domain ) + 1 );
}
}
@Override
- public List<DomainId> getAllDomains() {
- final List<DomainId> domains = getCombinableDomains();
+ public List<String> getAllDomains() {
+ final List<String> domains = getCombinableDomains();
if ( !domains.contains( getKeyDomain() ) ) {
domains.add( getKeyDomain() );
}
}
@Override
- public List<DomainId> getCombinableDomains() {
- final List<DomainId> domains = new ArrayList<DomainId>( getNumberOfCombinableDomains() );
- for( final DomainId domain : getCombiningDomains().keySet() ) {
+ public List<String> getCombinableDomains() {
+ final List<String> domains = new ArrayList<String>( getNumberOfCombinableDomains() );
+ for( final String domain : getCombiningDomains().keySet() ) {
domains.add( domain );
}
return domains;
}
@Override
- public SortedMap<DomainId, Integer> getCombinableDomainsIds() {
- final SortedMap<DomainId, Integer> ids = new TreeMap<DomainId, Integer>();
- for( final DomainId domain : getCombiningDomains().keySet() ) {
- final DomainId pd = domain;
+ public SortedMap<String, Integer> getCombinableDomainsIds() {
+ final SortedMap<String, Integer> ids = new TreeMap<String, Integer>();
+ for( final String domain : getCombiningDomains().keySet() ) {
+ final String pd = domain;
ids.put( pd, getCombiningDomains().get( pd ) );
}
return ids;
@Override
public StringBuilder getCombiningDomainIdsAsStringBuilder() {
final StringBuilder sb = new StringBuilder();
- for( final Iterator<DomainId> iter = getCombiningDomains().keySet().iterator(); iter.hasNext(); ) {
- final DomainId key = iter.next();
+ for( final Iterator<String> iter = getCombiningDomains().keySet().iterator(); iter.hasNext(); ) {
+ final String key = iter.next();
sb.append( key.toString() );
sb.append( " [" );
final int count = getCombiningDomains().get( key );
return sb;
}
- protected TreeMap<DomainId, Integer> getCombiningDomains() {
+ protected TreeMap<String, Integer> getCombiningDomains() {
return _combining_domains;
}
@Override
- public DomainId getKeyDomain() {
+ public String getKeyDomain() {
return _key_domain;
}
}
@Override
- public int getNumberOfProteinsExhibitingCombination( final DomainId protein_domain ) {
+ public int getNumberOfProteinsExhibitingCombination( final String protein_domain ) {
if ( getCombiningDomains().containsKey( protein_domain ) ) {
return getCombiningDomains().get( protein_domain );
}
}
@Override
- public boolean isCombinable( final DomainId protein_domain ) {
+ public boolean isCombinable( final String protein_domain ) {
return getCombiningDomains().containsKey( protein_domain );
}
@Override
public List<BinaryDomainCombination> toBinaryDomainCombinations() {
final List<BinaryDomainCombination> binary_combinations = new ArrayList<BinaryDomainCombination>( getNumberOfCombinableDomains() );
- for( final DomainId domain : getCombiningDomains().keySet() ) {
+ for( final String domain : getCombiningDomains().keySet() ) {
binary_combinations.add( new BasicBinaryDomainCombination( getKeyDomain(), domain ) );
}
return binary_combinations;
import java.util.TreeMap;
import java.util.TreeSet;
-import org.forester.protein.DomainId;
import org.forester.species.Species;
import org.forester.util.BasicDescriptiveStatistics;
import org.forester.util.DescriptiveStatistics;
throw new IllegalArgumentException( "attempt to calculate multiple combinable domains similarity for less than two combinale domains collections" );
}
final SortedSet<DomainSimilarity> similarities = new TreeSet<DomainSimilarity>();
- final SortedSet<DomainId> keys = new TreeSet<DomainId>();
+ final SortedSet<String> keys = new TreeSet<String>();
for( final GenomeWideCombinableDomains cdc : cdc_list ) {
keys.addAll( ( cdc ).getAllCombinableDomainsIds().keySet() );
}
- for( final DomainId key : keys ) {
+ for( final String key : keys ) {
final List<CombinableDomains> same_id_cd_list = new ArrayList<CombinableDomains>( cdc_list.size() );
final List<Species> species_with_key_id_domain = new ArrayList<Species>();
for( final GenomeWideCombinableDomains cdc : cdc_list ) {
cd.getKeyDomainCount(),
cd.getNumberOfCombinableDomains(),
cd.getKeyDomainConfidenceDescriptiveStatistics() );
- for( final DomainId domain : cd.getCombinableDomains() ) {
+ for( final String domain : cd.getCombinableDomains() ) {
sd.addProteinsExhibitingCombinationCount( domain, cd.getNumberOfProteinsExhibitingCombination( domain ) );
}
return sd;
import org.forester.protein.BinaryDomainCombination;
import org.forester.protein.BinaryDomainCombination.DomainCombinationType;
import org.forester.protein.Domain;
-import org.forester.protein.DomainId;
import org.forester.protein.Protein;
import org.forester.species.Species;
import org.forester.util.BasicDescriptiveStatistics;
public class BasicGenomeWideCombinableDomains implements GenomeWideCombinableDomains {
- private final static NumberFormat FORMATTER = new DecimalFormat( "0.0E0" );
- private static final Comparator<CombinableDomains> DESCENDING_KEY_DOMAIN_COUNT_ORDER = new Comparator<CombinableDomains>() {
+ private final static NumberFormat FORMATTER = new DecimalFormat( "0.0E0" );
+ private static final Comparator<CombinableDomains> DESCENDING_KEY_DOMAIN_COUNT_ORDER = new Comparator<CombinableDomains>() {
- @Override
- public int compare( final CombinableDomains d1,
- final CombinableDomains d2 ) {
- if ( d1.getKeyDomainCount() < d2
- .getKeyDomainCount() ) {
- return 1;
- }
- else if ( d1
- .getKeyDomainCount() > d2
- .getKeyDomainCount() ) {
- return -1;
- }
- else {
- return d1
- .getKeyDomain()
- .getId()
- .compareTo( d2
- .getKeyDomain()
- .getId() );
- }
- }
- };
- private static final Comparator<CombinableDomains> DESCENDING_KEY_DOMAIN_PROTEINS_COUNT_ORDER = new Comparator<CombinableDomains>() {
+ @Override
+ public int compare( final CombinableDomains d1,
+ final CombinableDomains d2 ) {
+ if ( d1.getKeyDomainCount() < d2
+ .getKeyDomainCount() ) {
+ return 1;
+ }
+ else if ( d1
+ .getKeyDomainCount() > d2
+ .getKeyDomainCount() ) {
+ return -1;
+ }
+ else {
+ return d1
+ .getKeyDomain()
+ .compareTo( d2
+ .getKeyDomain() );
+ }
+ }
+ };
+ private static final Comparator<CombinableDomains> DESCENDING_KEY_DOMAIN_PROTEINS_COUNT_ORDER = new Comparator<CombinableDomains>() {
- @Override
- public int compare( final CombinableDomains d1,
- final CombinableDomains d2 ) {
- if ( d1.getKeyDomainProteinsCount() < d2
- .getKeyDomainProteinsCount() ) {
- return 1;
- }
- else if ( d1
- .getKeyDomainProteinsCount() > d2
- .getKeyDomainProteinsCount() ) {
- return -1;
- }
- else {
- return d1
- .getKeyDomain()
- .getId()
- .compareTo( d2
- .getKeyDomain()
- .getId() );
- }
- }
- };
- private static final Comparator<CombinableDomains> DESCENDING_COMBINATIONS_COUNT_ORDER = new Comparator<CombinableDomains>() {
+ @Override
+ public int compare( final CombinableDomains d1,
+ final CombinableDomains d2 ) {
+ if ( d1.getKeyDomainProteinsCount() < d2
+ .getKeyDomainProteinsCount() ) {
+ return 1;
+ }
+ else if ( d1
+ .getKeyDomainProteinsCount() > d2
+ .getKeyDomainProteinsCount() ) {
+ return -1;
+ }
+ else {
+ return d1
+ .getKeyDomain()
+ .compareTo( d2
+ .getKeyDomain() );
+ }
+ }
+ };
+ private static final Comparator<CombinableDomains> DESCENDING_COMBINATIONS_COUNT_ORDER = new Comparator<CombinableDomains>() {
- @Override
- public int compare( final CombinableDomains d1,
- final CombinableDomains d2 ) {
- if ( d1.getNumberOfCombinableDomains() < d2
- .getNumberOfCombinableDomains() ) {
- return 1;
- }
- else if ( d1
- .getNumberOfCombinableDomains() > d2
- .getNumberOfCombinableDomains() ) {
- return -1;
- }
- else {
- return d1
- .getKeyDomain()
- .getId()
- .compareTo( d2
- .getKeyDomain()
- .getId() );
- }
- }
- };
- final private SortedMap<DomainId, CombinableDomains> _combinable_domains_map;
- final private Species _species;
- final private DomainCombinationType _dc_type;
+ @Override
+ public int compare( final CombinableDomains d1,
+ final CombinableDomains d2 ) {
+ if ( d1.getNumberOfCombinableDomains() < d2
+ .getNumberOfCombinableDomains() ) {
+ return 1;
+ }
+ else if ( d1
+ .getNumberOfCombinableDomains() > d2
+ .getNumberOfCombinableDomains() ) {
+ return -1;
+ }
+ else {
+ return d1
+ .getKeyDomain()
+ .compareTo( d2
+ .getKeyDomain() );
+ }
+ }
+ };
+ final private SortedMap<String, CombinableDomains> _combinable_domains_map;
+ final private Species _species;
+ final private DomainCombinationType _dc_type;
private BasicGenomeWideCombinableDomains( final Species species, final DomainCombinationType dc_type ) {
- _combinable_domains_map = new TreeMap<DomainId, CombinableDomains>();
+ _combinable_domains_map = new TreeMap<String, CombinableDomains>();
_species = species;
_dc_type = dc_type;
}
- private void add( final DomainId key, final CombinableDomains cdc ) {
+ private void add( final String key, final CombinableDomains cdc ) {
_combinable_domains_map.put( key, cdc );
}
@Override
- public boolean contains( final DomainId key_id ) {
+ public boolean contains( final String key_id ) {
return _combinable_domains_map.containsKey( key_id );
}
@Override
- public CombinableDomains get( final DomainId key_id ) {
+ public CombinableDomains get( final String key_id ) {
return _combinable_domains_map.get( key_id );
}
@Override
- public SortedMap<DomainId, CombinableDomains> getAllCombinableDomainsIds() {
+ public SortedMap<String, CombinableDomains> getAllCombinableDomainsIds() {
return _combinable_domains_map;
}
@Override
- public SortedSet<DomainId> getAllDomainIds() {
- final SortedSet<DomainId> domains = new TreeSet<DomainId>();
- for( final DomainId key : getAllCombinableDomainsIds().keySet() ) {
+ public SortedSet<String> getAllDomainIds() {
+ final SortedSet<String> domains = new TreeSet<String>();
+ for( final String key : getAllCombinableDomainsIds().keySet() ) {
final CombinableDomains cb = getAllCombinableDomainsIds().get( key );
- final List<DomainId> ds = cb.getAllDomains();
- for( final DomainId d : ds ) {
+ final List<String> ds = cb.getAllDomains();
+ for( final String d : ds ) {
domains.add( d );
}
}
}
@Override
- public SortedSet<DomainId> getMostPromiscuosDomain() {
- final SortedSet<DomainId> doms = new TreeSet<DomainId>();
+ public SortedSet<String> getMostPromiscuosDomain() {
+ final SortedSet<String> doms = new TreeSet<String>();
final int max = ( int ) getPerGenomeDomainPromiscuityStatistics().getMax();
- for( final DomainId key : getAllCombinableDomainsIds().keySet() ) {
+ for( final String key : getAllCombinableDomainsIds().keySet() ) {
final CombinableDomains cb = getAllCombinableDomainsIds().get( key );
if ( cb.getNumberOfCombinableDomains() == max ) {
doms.add( key );
@Override
public DescriptiveStatistics getPerGenomeDomainPromiscuityStatistics() {
final DescriptiveStatistics stats = new BasicDescriptiveStatistics();
- for( final DomainId key : getAllCombinableDomainsIds().keySet() ) {
+ for( final String key : getAllCombinableDomainsIds().keySet() ) {
final CombinableDomains cb = getAllCombinableDomainsIds().get( key );
stats.addValue( cb.getNumberOfCombinableDomains() );
}
@Override
public SortedSet<BinaryDomainCombination> toBinaryDomainCombinations() {
final SortedSet<BinaryDomainCombination> binary_combinations = new TreeSet<BinaryDomainCombination>();
- for( final DomainId key : getAllCombinableDomainsIds().keySet() ) {
+ for( final String key : getAllCombinableDomainsIds().keySet() ) {
final CombinableDomains cb = getAllCombinableDomainsIds().get( key );
for( final BinaryDomainCombination b : cb.toBinaryDomainCombinations() ) {
binary_combinations.add( b );
public StringBuilder toStringBuilder( final GenomeWideCombinableDomainsSortOrder sort_order ) {
final StringBuilder sb = new StringBuilder();
final List<CombinableDomains> combinable_domains = new ArrayList<CombinableDomains>();
- for( final DomainId key : getAllCombinableDomainsIds().keySet() ) {
+ for( final String key : getAllCombinableDomainsIds().keySet() ) {
final CombinableDomains cb = getAllCombinableDomainsIds().get( key );
combinable_domains.add( cb );
}
return sb;
}
- private static void countDomains( final Map<DomainId, Integer> domain_counts,
- final Map<DomainId, Integer> domain_protein_counts,
- final Map<DomainId, DescriptiveStatistics> stats,
- final Set<DomainId> saw_c,
- final DomainId id_i,
+ private static void countDomains( final Map<String, Integer> domain_counts,
+ final Map<String, Integer> domain_protein_counts,
+ final Map<String, DescriptiveStatistics> stats,
+ final Set<String> saw_c,
+ final String id_i,
final double support ) {
if ( domain_counts.containsKey( id_i ) ) {
domain_counts.put( id_i, 1 + domain_counts.get( ( id_i ) ) );
public static BasicGenomeWideCombinableDomains createInstance( final List<Protein> protein_list,
final boolean ignore_combination_with_same_domain,
final Species species,
- final Map<DomainId, List<GoId>> domain_id_to_go_ids_map,
+ final Map<String, List<GoId>> domain_id_to_go_ids_map,
final DomainCombinationType dc_type,
final Map<String, DescriptiveStatistics> protein_length_stats_by_dc,
final Map<String, DescriptiveStatistics> domain_number_stats_by_dc ) {
final BasicGenomeWideCombinableDomains instance = new BasicGenomeWideCombinableDomains( species, dc_type );
- final Map<DomainId, Integer> domain_counts = new HashMap<DomainId, Integer>();
- final Map<DomainId, Integer> domain_protein_counts = new HashMap<DomainId, Integer>();
- final Map<DomainId, DescriptiveStatistics> stats = new HashMap<DomainId, DescriptiveStatistics>();
+ final Map<String, Integer> domain_counts = new HashMap<String, Integer>();
+ final Map<String, Integer> domain_protein_counts = new HashMap<String, Integer>();
+ final Map<String, DescriptiveStatistics> stats = new HashMap<String, DescriptiveStatistics>();
for( final Protein protein : protein_list ) {
if ( !protein.getSpecies().equals( species ) ) {
throw new IllegalArgumentException( "species (" + protein.getSpecies()
+ ") does not match species of combinable domains collection (" + species + ")" );
}
- final Set<DomainId> saw_i = new HashSet<DomainId>();
- final Set<DomainId> saw_c = new HashSet<DomainId>();
+ final Set<String> saw_i = new HashSet<String>();
+ final Set<String> saw_c = new HashSet<String>();
for( int i = 0; i < protein.getProteinDomains().size(); ++i ) {
final Domain pd_i = protein.getProteinDomain( i );
- final DomainId id_i = pd_i.getDomainId();
+ final String id_i = pd_i.getDomainId();
final int current_start = pd_i.getFrom();
BasicGenomeWideCombinableDomains.countDomains( domain_counts,
domain_protein_counts,
else {
domain_combination = new BasicCombinableDomains( pd_i.getDomainId(), species );
}
- if ( ( domain_id_to_go_ids_map != null )
- && domain_id_to_go_ids_map.containsKey( pd_i.getDomainId() ) ) {
- final List<GoId> go_ids = domain_id_to_go_ids_map.get( pd_i.getDomainId() );
- for( final GoId go_id : go_ids ) {
- domain_combination.getKeyDomain().addGoId( go_id );
- }
- }
+ // ^^ if ( ( domain_id_to_go_ids_map != null )
+ // ^^ && domain_id_to_go_ids_map.containsKey( pd_i.getDomainId() ) ) {
+ // ^^ final List<GoId> go_ids = domain_id_to_go_ids_map.get( pd_i.getDomainId() );
+ // ^^ for( final GoId go_id : go_ids ) {
+ // ^^ domain_combination.getKeyDomain().addGoId( go_id );
+ // ^^ }
+ // ^^ }
instance.add( id_i, domain_combination );
}
- final Set<DomainId> saw_j = new HashSet<DomainId>();
+ final Set<String> saw_j = new HashSet<String>();
if ( ignore_combination_with_same_domain ) {
saw_j.add( id_i );
}
continue;
}
if ( i != j ) {
- final DomainId id = protein.getProteinDomain( j ).getDomainId();
+ final String id = protein.getProteinDomain( j ).getDomainId();
if ( !saw_j.contains( id ) ) {
saw_j.add( id );
if ( dc_type != DomainCombinationType.DIRECTED_ADJACTANT ) {
}
}
}
- for( final DomainId key_id : domain_counts.keySet() ) {
+ for( final String key_id : domain_counts.keySet() ) {
instance.get( key_id ).setKeyDomainCount( domain_counts.get( key_id ) );
instance.get( key_id ).setKeyDomainProteinsCount( domain_protein_counts.get( key_id ) );
instance.get( key_id ).setKeyDomainConfidenceDescriptiveStatistics( stats.get( key_id ) );
import java.util.SortedMap;
import org.forester.protein.BinaryDomainCombination;
-import org.forester.protein.DomainId;
import org.forester.species.Species;
import org.forester.util.DescriptiveStatistics;
*
* @param protein_domain
*/
- public void addCombinableDomain( final DomainId protein_domain );
+ public void addCombinableDomain( final String protein_domain );
/**
*
*
* @return all domains
*/
- List<DomainId> getAllDomains();
+ List<String> getAllDomains();
- List<DomainId> getCombinableDomains();
+ List<String> getCombinableDomains();
/**
* Returns the combinable domain identifiers sorted in alphabetical manner: -
*
* @return combining domain identifiers sorted in alphabetical manner
*/
- public SortedMap<DomainId, Integer> getCombinableDomainsIds();
+ public SortedMap<String, Integer> getCombinableDomainsIds();
public StringBuilder getCombiningDomainIdsAsStringBuilder();
*
* @return the domain identifier
*/
- public DomainId getKeyDomain();
+ public String getKeyDomain();
/**
* Gets descriptive statistics for the confidence (i.e. E-values) of the key
public int getNumberOfCombinableDomains();
- public int getNumberOfProteinsExhibitingCombination( final DomainId protein_domain );
+ public int getNumberOfProteinsExhibitingCombination( final String protein_domain );
/**
* Returns the species of this combinable domains.
*/
public Species getSpecies();
- public boolean isCombinable( final DomainId protein_domain );
+ public boolean isCombinable( final String protein_domain );
/**
* This is to set descriptive statistics for the confidence (i.e. E-values)
import java.util.List;
-import org.forester.protein.DomainId;
-
public class CombinationsBasedPairwiseDomainSimilarityCalculator implements PairwiseDomainSimilarityCalculator {
@Override
if ( !domains_1.getKeyDomain().equals( domains_2.getKeyDomain() ) ) {
throw new IllegalArgumentException( "attempt to calculate similarity between domain collection with different keys" );
}
- final List<DomainId> d1 = domains_1.getCombinableDomains();
- final List<DomainId> d2 = domains_2.getCombinableDomains();
+ final List<String> d1 = domains_1.getCombinableDomains();
+ final List<String> d2 = domains_2.getCombinableDomains();
int same = 0;
int different = 0;
- for( final DomainId domain : d1 ) {
+ for( final String domain : d1 ) {
if ( d2.contains( domain ) ) {
same++;
}
different++;
}
}
- for( final DomainId domain : d2 ) {
+ for( final String domain : d2 ) {
if ( !( d1.contains( domain ) ) ) {
different++;
}
package org.forester.surfacing;
import org.forester.protein.BinaryDomainCombination;
-import org.forester.protein.DomainId;
public class DirectedBinaryDomainCombination extends BasicBinaryDomainCombination {
- public DirectedBinaryDomainCombination( final DomainId n_terminal, final DomainId c_terminal ) {
- super();
- if ( ( n_terminal == null ) || ( c_terminal == null ) ) {
- throw new IllegalArgumentException( "attempt to create binary domain combination using null" );
- }
- _data = n_terminal.getId() + BinaryDomainCombination.SEPARATOR + c_terminal.getId();
- }
-
public DirectedBinaryDomainCombination( final String n_terminal, final String c_terminal ) {
super();
if ( ( n_terminal == null ) || ( c_terminal == null ) ) {
throw new IllegalArgumentException( "attempt to create binary domain combination using null" );
}
- _data = n_terminal + BinaryDomainCombination.SEPARATOR + c_terminal;
+ _id0 = n_terminal;
+ _id1 = c_terminal;
}
public static BinaryDomainCombination createInstance( final String ids ) {
import java.util.List;
import org.forester.protein.BinaryDomainCombination;
-import org.forester.protein.DomainId;
import org.forester.species.Species;
public class DirectedCombinableDomains extends BasicCombinableDomains {
- public DirectedCombinableDomains( final DomainId n_terminal_key_domain, final Species species ) {
+ public DirectedCombinableDomains( final String n_terminal_key_domain, final Species species ) {
super( n_terminal_key_domain, species );
}
@Override
public List<BinaryDomainCombination> toBinaryDomainCombinations() {
final List<BinaryDomainCombination> binary_combinations = new ArrayList<BinaryDomainCombination>( getNumberOfCombinableDomains() );
- for( final DomainId domain : getCombiningDomains().keySet() ) {
+ for( final String domain : getCombiningDomains().keySet() ) {
// Precondition (!): key domain is most upstream domain.
//TODO ensure this is true.
binary_combinations.add( new DirectedBinaryDomainCombination( getKeyDomain(), domain ) );
import java.util.Set;
import org.forester.protein.BinaryDomainCombination;
-import org.forester.protein.DomainId;
public class DomainArchitectureBasedGenomeSimilarityCalculator {
public static final double MIN_SIMILARITY_SCORE = 0.0;
final private GenomeWideCombinableDomains _combinable_domains_genome_0;
final private GenomeWideCombinableDomains _combinable_domains_genome_1;
- private Set<DomainId> _domain_ids_to_ignore;
+ private Set<String> _domain_ids_to_ignore;
private boolean _allow_domains_to_be_ignored;
- private Set<DomainId> _all_domains;
- private Set<DomainId> _shared_domains;
- private Set<DomainId> _domains_specific_to_0;
- private Set<DomainId> _domains_specific_to_1;
+ private Set<String> _all_domains;
+ private Set<String> _shared_domains;
+ private Set<String> _domains_specific_to_0;
+ private Set<String> _domains_specific_to_1;
private Set<BinaryDomainCombination> _all_binary_domain_combinations;
private Set<BinaryDomainCombination> _shared_binary_domain_combinations;
private Set<BinaryDomainCombination> _binary_domain_combinations_specific_to_0;
forceRecalculation();
}
- public void addDomainIdToIgnore( final DomainId domain_id_to_ignore ) {
+ public void addDomainIdToIgnore( final String domain_id_to_ignore ) {
forceRecalculation();
getDomainIdsToIgnore().add( domain_id_to_ignore );
}
public void deleteAllDomainIdsToIgnore() {
forceRecalculation();
- setDomainIdsToIgnore( new HashSet<DomainId>() );
+ setDomainIdsToIgnore( new HashSet<String>() );
}
private void forceRecalculation() {
*
* @return
*/
- public Set<DomainId> getAllDomains() {
+ public Set<String> getAllDomains() {
if ( _all_domains == null ) {
- final Set<DomainId> all = new HashSet<DomainId>();
+ final Set<String> all = new HashSet<String>();
all.addAll( getCombinableDomainsGenome0().getAllDomainIds() );
all.addAll( getCombinableDomainsGenome1().getAllDomainIds() );
if ( isAllowDomainsToBeIgnored() && !getDomainIdsToIgnore().isEmpty() ) {
return _combinable_domains_genome_1;
}
- private Set<DomainId> getDomainIdsToIgnore() {
+ private Set<String> getDomainIdsToIgnore() {
return _domain_ids_to_ignore;
}
- private Set<DomainId> getDomainsSpecificToGenome( final boolean specific_to_genome_0 ) {
- final Set<DomainId> specific = new HashSet<DomainId>();
- final Set<DomainId> d0 = getCombinableDomainsGenome0().getAllDomainIds();
- final Set<DomainId> d1 = getCombinableDomainsGenome1().getAllDomainIds();
+ private Set<String> getDomainsSpecificToGenome( final boolean specific_to_genome_0 ) {
+ final Set<String> specific = new HashSet<String>();
+ final Set<String> d0 = getCombinableDomainsGenome0().getAllDomainIds();
+ final Set<String> d1 = getCombinableDomainsGenome1().getAllDomainIds();
if ( specific_to_genome_0 ) {
- for( final DomainId domain0 : d0 ) {
+ for( final String domain0 : d0 ) {
if ( !d1.contains( domain0 ) ) {
specific.add( domain0 );
}
}
}
else {
- for( final DomainId domain1 : d1 ) {
+ for( final String domain1 : d1 ) {
if ( !d0.contains( domain1 ) ) {
specific.add( domain1 );
}
return specific;
}
- public Set<DomainId> getDomainsSpecificToGenome0() {
+ public Set<String> getDomainsSpecificToGenome0() {
if ( _domains_specific_to_0 == null ) {
_domains_specific_to_0 = getDomainsSpecificToGenome( true );
}
return _domains_specific_to_0;
}
- public Set<DomainId> getDomainsSpecificToGenome1() {
+ public Set<String> getDomainsSpecificToGenome1() {
if ( _domains_specific_to_1 == null ) {
_domains_specific_to_1 = getDomainsSpecificToGenome( false );
}
return _shared_binary_domain_combinations;
}
- public Set<DomainId> getSharedDomains() {
+ public Set<String> getSharedDomains() {
if ( _shared_domains == null ) {
- final Set<DomainId> shared = new HashSet<DomainId>();
- final Set<DomainId> d0 = getCombinableDomainsGenome0().getAllDomainIds();
- final Set<DomainId> d1 = getCombinableDomainsGenome1().getAllDomainIds();
- for( final DomainId domain0 : d0 ) {
+ final Set<String> shared = new HashSet<String>();
+ final Set<String> d0 = getCombinableDomainsGenome0().getAllDomainIds();
+ final Set<String> d1 = getCombinableDomainsGenome1().getAllDomainIds();
+ for( final String domain0 : d0 ) {
if ( d1.contains( domain0 ) ) {
shared.add( domain0 );
}
return pruned;
}
- private Set<DomainId> pruneDomains( final Set<DomainId> all ) {
- final Set<DomainId> pruned = new HashSet<DomainId>();
- for( final DomainId d : all ) {
+ private Set<String> pruneDomains( final Set<String> all ) {
+ final Set<String> pruned = new HashSet<String>();
+ for( final String d : all ) {
if ( !getDomainIdsToIgnore().contains( d ) ) {
pruned.add( d );
}
_allow_domains_to_be_ignored = allow_domains_to_be_ignored;
}
- void setDomainIdsToIgnore( final Set<DomainId> domain_ids_to_ignore ) {
+ void setDomainIdsToIgnore( final Set<String> domain_ids_to_ignore ) {
forceRecalculation();
_domain_ids_to_ignore = domain_ids_to_ignore;
}
import org.forester.go.GoId;
import org.forester.go.GoTerm;
import org.forester.protein.BinaryDomainCombination;
-import org.forester.protein.DomainId;
import org.forester.protein.Protein;
import org.forester.species.Species;
import org.forester.util.BasicDescriptiveStatistics;
}
}
- private static void addCounts( final SortedMap<DomainId, List<Integer>> copy_counts,
- final DomainId domain,
+ private static void addCounts( final SortedMap<String, List<Integer>> copy_counts,
+ final String domain,
final GenomeWideCombinableDomains genome ) {
if ( !copy_counts.containsKey( domain ) ) {
copy_counts.put( domain, new ArrayList<Integer>() );
}
}
- private static StringBuilder addGoInformation( final DomainId d,
- final Map<DomainId, List<GoId>> domain_id_to_go_ids_map,
+ private static StringBuilder addGoInformation( final String d,
+ final Map<String, List<GoId>> domain_id_to_go_ids_map,
final Map<GoId, GoTerm> go_id_to_term_map ) {
final StringBuilder sb = new StringBuilder();
if ( ( domain_id_to_go_ids_map == null ) || domain_id_to_go_ids_map.isEmpty()
sb.append( "<br>" );
}
else {
- sb.append( "go id \"" + go_id + "\" not found [" + d.getId() + "]" );
+ sb.append( "go id \"" + go_id + "\" not found [" + d + "]" );
}
}
return sb;
final File plain_output_dom,
final File html_output_dom,
final File html_output_dc,
- final Map<DomainId, List<GoId>> domain_id_to_go_ids_map,
+ final Map<String, List<GoId>> domain_id_to_go_ids_map,
final Map<GoId, GoTerm> go_id_to_term_map,
final File all_domains_go_ids_out_dom,
final File passing_domains_go_ids_out_dom,
final Writer html_writer_dc = new BufferedWriter( new FileWriter( html_output_dc ) );
final Writer all_gos_writer = new BufferedWriter( new FileWriter( all_domains_go_ids_out_dom ) );
final Writer passing_gos_writer = new BufferedWriter( new FileWriter( passing_domains_go_ids_out_dom ) );
- final SortedMap<DomainId, Double> high_copy_base_values = new TreeMap<DomainId, Double>();
- final SortedMap<DomainId, Double> high_copy_target_values = new TreeMap<DomainId, Double>();
- final SortedMap<DomainId, Double> low_copy_values = new TreeMap<DomainId, Double>();
- final SortedMap<DomainId, List<Integer>> high_copy_base_copy_counts = new TreeMap<DomainId, List<Integer>>();
- final SortedMap<DomainId, List<Integer>> high_copy_target_copy_counts = new TreeMap<DomainId, List<Integer>>();
- final SortedMap<DomainId, List<Integer>> low_copy_copy_counts = new TreeMap<DomainId, List<Integer>>();
- final SortedSet<DomainId> all_domains = new TreeSet<DomainId>();
+ final SortedMap<String, Double> high_copy_base_values = new TreeMap<String, Double>();
+ final SortedMap<String, Double> high_copy_target_values = new TreeMap<String, Double>();
+ final SortedMap<String, Double> low_copy_values = new TreeMap<String, Double>();
+ final SortedMap<String, List<Integer>> high_copy_base_copy_counts = new TreeMap<String, List<Integer>>();
+ final SortedMap<String, List<Integer>> high_copy_target_copy_counts = new TreeMap<String, List<Integer>>();
+ final SortedMap<String, List<Integer>> low_copy_copy_counts = new TreeMap<String, List<Integer>>();
+ final SortedSet<String> all_domains = new TreeSet<String>();
final SortedMap<BinaryDomainCombination, Double> high_copy_base_values_dc = new TreeMap<BinaryDomainCombination, Double>();
final SortedMap<BinaryDomainCombination, Double> high_copy_target_values_dc = new TreeMap<BinaryDomainCombination, Double>();
final SortedMap<BinaryDomainCombination, Double> low_copy_values_dc = new TreeMap<BinaryDomainCombination, Double>();
final SortedSet<GoId> go_ids_of_passing_domains = new TreeSet<GoId>();
final SortedSet<GoId> go_ids_all = new TreeSet<GoId>();
for( final GenomeWideCombinableDomains genome : genomes ) {
- final SortedSet<DomainId> domains = genome.getAllDomainIds();
+ final SortedSet<String> domains = genome.getAllDomainIds();
final SortedSet<BinaryDomainCombination> dcs = genome.toBinaryDomainCombinations();
final String species = genome.getSpecies().getSpeciesId();
bdcs_per_genome.put( species, genome.toBinaryDomainCombinations() );
- for( final DomainId d : domains ) {
+ for( final String d : domains ) {
all_domains.add( d );
if ( domain_id_to_go_ids_map.containsKey( d ) ) {
go_ids_all.addAll( domain_id_to_go_ids_map.get( d ) );
all_dcs.add( dc );
}
}
- for( final DomainId domain : all_domains ) {
+ for( final String domain : all_domains ) {
for( final GenomeWideCombinableDomains genome : genomes ) {
final String species = genome.getSpecies().getSpeciesId();
if ( high_copy_base_species.contains( species ) ) {
}
}
}
- for( final DomainId domain : all_domains ) {
+ for( final String domain : all_domains ) {
calculateDomainCountsBasedValue( high_copy_target_values,
high_copy_target_copy_counts,
domain,
}
}
- private static void calculateDomainCountsBasedValue( final SortedMap<DomainId, Double> copy_values,
- final SortedMap<DomainId, List<Integer>> copy_counts,
- final DomainId domain,
+ private static void calculateDomainCountsBasedValue( final SortedMap<String, Double> copy_values,
+ final SortedMap<String, List<Integer>> copy_counts,
+ final String domain,
final COPY_CALCULATION_MODE copy_calc_mode ) {
if ( copy_counts.containsKey( domain ) ) {
switch ( copy_calc_mode ) {
results.put( bdc, ( double ) max );
}
- private static void calculateMaxCount( final SortedMap<DomainId, Double> results,
- final SortedMap<DomainId, List<Integer>> copy_counts,
- final DomainId domain ) {
+ private static void calculateMaxCount( final SortedMap<String, Double> results,
+ final SortedMap<String, List<Integer>> copy_counts,
+ final String domain ) {
final List<Integer> counts = copy_counts.get( domain );
int max = 0;
for( final Integer count : counts ) {
results.put( bdc, ( ( double ) sum ) / ( ( double ) counts.size() ) );
}
- private static void calculateMeanCount( final SortedMap<DomainId, Double> results,
- final SortedMap<DomainId, List<Integer>> copy_counts,
- final DomainId domain ) {
+ private static void calculateMeanCount( final SortedMap<String, Double> results,
+ final SortedMap<String, List<Integer>> copy_counts,
+ final String domain ) {
final List<Integer> counts = copy_counts.get( domain );
int sum = 0;
for( final Integer count : counts ) {
results.put( bdc, stats.median() );
}
- private static void calculateMedianCount( final SortedMap<DomainId, Double> results,
- final SortedMap<DomainId, List<Integer>> copy_counts,
- final DomainId domain ) {
+ private static void calculateMedianCount( final SortedMap<String, Double> results,
+ final SortedMap<String, List<Integer>> copy_counts,
+ final String domain ) {
final List<Integer> counts = copy_counts.get( domain );
final DescriptiveStatistics stats = new BasicDescriptiveStatistics();
for( final Integer count : counts ) {
results.put( bdc, ( double ) min );
}
- private static void calculateMinCount( final SortedMap<DomainId, Double> results,
- final SortedMap<DomainId, List<Integer>> copy_counts,
- final DomainId domain ) {
+ private static void calculateMinCount( final SortedMap<String, Double> results,
+ final SortedMap<String, List<Integer>> copy_counts,
+ final String domain ) {
final List<Integer> counts = copy_counts.get( domain );
int min = Integer.MAX_VALUE;
for( final Integer count : counts ) {
html_writer.write( "</td>" );
}
- private static void writeCopyNumberValues( final SortedMap<DomainId, Double> copy_means,
- final DomainId domain,
+ private static void writeCopyNumberValues( final SortedMap<String, Double> copy_means,
+ final String domain,
final GenomeWideCombinableDomains genome,
final String species,
final Writer plain_writer,
final List<String> low_copy_species,
final int min_diff,
final Double factor,
- final Map<DomainId, List<GoId>> domain_id_to_go_ids_map,
+ final Map<String, List<GoId>> domain_id_to_go_ids_map,
final Map<GoId, GoTerm> go_id_to_term_map,
final Writer plain_writer,
final Writer html_writer,
final File proteins_file_base,
- final SortedMap<DomainId, Double> high_copy_base_values,
- final SortedMap<DomainId, Double> high_copy_target_values,
- final SortedMap<DomainId, Double> low_copy_values,
- final SortedSet<DomainId> all_domains,
+ final SortedMap<String, Double> high_copy_base_values,
+ final SortedMap<String, Double> high_copy_target_values,
+ final SortedMap<String, Double> low_copy_values,
+ final SortedSet<String> all_domains,
final SortedSet<GoId> go_ids_of_passing_domains,
final SortedMap<Species, List<Protein>> protein_lists_per_species )
throws IOException {
int not_total_absense_counter = 0;
SurfacingUtil.addHtmlHead( html_writer, "Domain Copy Differences" );
html_writer.write( "<body><table>" );
- for( final DomainId domain_id : all_domains ) {
+ for( final String domain_id : all_domains ) {
if ( ( high_copy_base_values.get( domain_id ) > 0 ) && ( high_copy_target_values.get( domain_id ) > 0 )
&& ( high_copy_base_values.get( domain_id ) >= low_copy_values.get( domain_id ) ) ) {
if ( high_copy_target_values.get( domain_id ) >= ( min_diff + ( factor * low_copy_values
if ( domain_id_to_go_ids_map.containsKey( domain_id ) ) {
go_ids_of_passing_domains.addAll( domain_id_to_go_ids_map.get( domain_id ) );
}
- plain_writer.write( domain_id.getId() );
+ plain_writer.write( domain_id );
plain_writer.write( SurfacingConstants.NL );
- html_writer.write( "<tr><td><a href=\"" + SurfacingConstants.PFAM_FAMILY_ID_LINK
- + domain_id.getId() + "\">" + domain_id.getId() + "</a></td><td>" );
+ html_writer.write( "<tr><td><a href=\"" + SurfacingConstants.PFAM_FAMILY_ID_LINK + domain_id
+ + "\">" + domain_id + "</a></td><td>" );
html_writer.write( addGoInformation( domain_id, domain_id_to_go_ids_map, go_id_to_term_map )
.toString() );
html_writer.write( "</td><td>" );
private static void writeProteinsToFile( final File proteins_file_base,
final SortedMap<Species, List<Protein>> protein_lists_per_species,
- final DomainId domain_id ) throws IOException {
+ final String domain_id ) throws IOException {
final File my_proteins_file = new File( proteins_file_base.getParentFile() + ForesterUtil.FILE_SEPARATOR
+ domain_id + PLUS_MINUS_PROTEINS_FILE_DOM_SUFFIX );
SurfacingUtil.checkForOutputFileWriteability( my_proteins_file );
import java.util.SortedMap;
import java.util.TreeMap;
-import org.forester.protein.DomainId;
import org.forester.species.Species;
import org.forester.util.BasicDescriptiveStatistics;
import org.forester.util.DescriptiveStatistics;
public class DomainLengths {
- final DomainId _domain_id;
+ final String _domain_id;
final SortedMap<Species, DescriptiveStatistics> _length_statistics;
- public DomainLengths( final DomainId domain_id ) {
+ public DomainLengths( final String domain_id ) {
_domain_id = domain_id;
_length_statistics = new TreeMap<Species, DescriptiveStatistics>();
}
return ( species_mean - population_mean ) / population_sd;
}
- public DomainId getDomainId() {
+ public String getDomainId() {
return _domain_id;
}
import java.util.TreeMap;
import org.forester.protein.Domain;
-import org.forester.protein.DomainId;
import org.forester.protein.Protein;
import org.forester.species.Species;
import org.forester.util.BasicDescriptiveStatistics;
public class DomainLengthsTable {
- private final static DecimalFormat DF = new DecimalFormat( "#.0" );
- final SortedMap<DomainId, DomainLengths> _domain_lengths;
- final List<Species> _species;
+ private final static DecimalFormat DF = new DecimalFormat( "#.0" );
+ final SortedMap<String, DomainLengths> _domain_lengths;
+ final List<Species> _species;
public DomainLengthsTable() {
- _domain_lengths = new TreeMap<DomainId, DomainLengths>();
+ _domain_lengths = new TreeMap<String, DomainLengths>();
_species = new ArrayList<Species>();
}
getDomainLengths().put( domain_lengths.getDomainId(), domain_lengths );
}
- private void addLength( final DomainId domain_id, final Species species, final int domain_length ) {
+ private void addLength( final String domain_id, final Species species, final int domain_length ) {
if ( !getDomainLengths().containsKey( domain_id ) ) {
addDomainLengths( new DomainLengths( domain_id ) );
}
return stats;
}
- public DescriptiveStatistics calculateMeanBasedStatisticsForDomain( final DomainId domain_id ) {
+ public DescriptiveStatistics calculateMeanBasedStatisticsForDomain( final String domain_id ) {
return getDomainLengths( domain_id ).calculateMeanBasedStatistics();
}
return sb;
}
- private SortedMap<DomainId, DomainLengths> getDomainLengths() {
+ private SortedMap<String, DomainLengths> getDomainLengths() {
return _domain_lengths;
}
- public DomainLengths getDomainLengths( final DomainId domain_id ) {
+ public DomainLengths getDomainLengths( final String domain_id ) {
return getDomainLengths().get( domain_id );
}
return list;
}
- public DescriptiveStatistics getLengthStatistic( final DomainId domain_id, final Species species ) {
+ public DescriptiveStatistics getLengthStatistic( final String domain_id, final Species species ) {
return getDomainLengths( domain_id ).getLengthStatistic( species );
}
import org.forester.phylogeny.iterators.PhylogenyNodeIterator;
import org.forester.protein.BinaryDomainCombination;
import org.forester.protein.BinaryDomainCombination.DomainCombinationType;
-import org.forester.protein.DomainId;
import org.forester.species.Species;
import org.forester.util.ForesterUtil;
private int _total_gains;
private int _total_unchanged;
private int _cost;
- private Map<DomainId, Set<String>> _domain_id_to_secondary_features_map;
- private SortedSet<DomainId> _positive_filter;
+ private Map<String, Set<String>> _domain_id_to_secondary_features_map;
+ private SortedSet<String> _positive_filter;
private DomainParsimonyCalculator( final Phylogeny phylogeny ) {
init();
private DomainParsimonyCalculator( final Phylogeny phylogeny,
final List<GenomeWideCombinableDomains> gwcd_list,
- final Map<DomainId, Set<String>> domain_id_to_secondary_features_map ) {
+ final Map<String, Set<String>> domain_id_to_secondary_features_map ) {
init();
_phylogeny = phylogeny;
_gwcd_list = gwcd_list;
executeDolloParsimony( true );
}
- public void executeDolloParsimonyOnDomainPresence( final SortedSet<DomainId> positive_filter ) {
+ public void executeDolloParsimonyOnDomainPresence( final SortedSet<String> positive_filter ) {
setPositiveFilter( positive_filter );
executeDolloParsimony( true );
setPositiveFilter( null );
fitch.setUseLast( use_last );
fitch.setReturnGainLossMatrix( true );
fitch.setReturnInternalStates( true );
- final Map<DomainId, Set<String>> map = getDomainIdToSecondaryFeaturesMap();
- final Map<DomainId, String> newmap = new HashMap<DomainId, String>();
- final Iterator<Entry<DomainId, Set<String>>> it = map.entrySet().iterator();
+ final Map<String, Set<String>> map = getDomainIdToSecondaryFeaturesMap();
+ final Map<String, String> newmap = new HashMap<String, String>();
+ final Iterator<Entry<String, Set<String>>> it = map.entrySet().iterator();
while ( it.hasNext() ) {
- final Map.Entry<DomainId, Set<String>> pair = it.next();
+ final Map.Entry<String, Set<String>> pair = it.next();
if ( pair.getValue().size() != 1 ) {
- throw new IllegalArgumentException( pair.getKey().getId() + " mapps to " + pair.getValue().size()
- + " items" );
+ throw new IllegalArgumentException( pair.getKey() + " mapps to " + pair.getValue().size() + " items" );
}
newmap.put( pair.getKey(), ( String ) pair.getValue().toArray()[ 0 ] );
}
return _cost;
}
- private Map<DomainId, Set<String>> getDomainIdToSecondaryFeaturesMap() {
+ private Map<String, Set<String>> getDomainIdToSecondaryFeaturesMap() {
return _domain_id_to_secondary_features_map;
}
return _phylogeny;
}
- private SortedSet<DomainId> getPositiveFilter() {
+ private SortedSet<String> getPositiveFilter() {
return _positive_filter;
}
_cost = cost;
}
- private void setDomainIdToSecondaryFeaturesMap( final Map<DomainId, Set<String>> domain_id_to_secondary_features_map ) {
+ private void setDomainIdToSecondaryFeaturesMap( final Map<String, Set<String>> domain_id_to_secondary_features_map ) {
_domain_id_to_secondary_features_map = domain_id_to_secondary_features_map;
}
_gain_loss_matrix = gain_loss_matrix;
}
- private void setPositiveFilter( final SortedSet<DomainId> positive_filter ) {
+ private void setPositiveFilter( final SortedSet<String> positive_filter ) {
_positive_filter = positive_filter;
}
public static DomainParsimonyCalculator createInstance( final Phylogeny phylogeny,
final List<GenomeWideCombinableDomains> gwcd_list,
- final Map<DomainId, Set<String>> domain_id_to_secondary_features_map ) {
+ final Map<String, Set<String>> domain_id_to_secondary_features_map ) {
if ( phylogeny.getNumberOfExternalNodes() != gwcd_list.size() ) {
throw new IllegalArgumentException( "size of external nodes does not equal size of genome wide combinable domains list" );
}
* @return
*/
static CharacterStateMatrix<BinaryStates> createMatrixOfSecondaryFeaturePresenceOrAbsence( final List<GenomeWideCombinableDomains> gwcd_list,
- final Map<DomainId, Set<String>> domain_id_to_second_features_map,
+ final Map<String, Set<String>> domain_id_to_second_features_map,
final Map<Species, MappingResults> mapping_results_map ) {
if ( gwcd_list.isEmpty() ) {
throw new IllegalArgumentException( "genome wide combinable domains list is empty" );
for( final GenomeWideCombinableDomains gwcd : gwcd_list ) {
int mapped = 0;
int not_mapped = 0;
- for( final DomainId domain : gwcd.getAllDomainIds() ) {
+ for( final String domain : gwcd.getAllDomainIds() ) {
if ( domain_id_to_second_features_map.containsKey( domain ) ) {
all_secondary_features.addAll( domain_id_to_second_features_map.get( domain ) );
mapped++;
all_identifiers.add( species_id );
matrix.setIdentifier( identifier_index, species_id );
final Set<String> all_second_per_gwcd = new HashSet<String>();
- for( final DomainId domain : gwcd.getAllDomainIds() ) {
+ for( final String domain : gwcd.getAllDomainIds() ) {
if ( domain_id_to_second_features_map.containsKey( domain ) ) {
all_second_per_gwcd.addAll( domain_id_to_second_features_map.get( domain ) );
}
}
public static CharacterStateMatrix<BinaryStates> createMatrixOfSecondaryFeatureBinaryDomainCombinationPresenceOrAbsence( final List<GenomeWideCombinableDomains> gwcd_list,
- final Map<DomainId, String> domain_id_to_second_features_map ) {
+ final Map<String, String> domain_id_to_second_features_map ) {
if ( gwcd_list.isEmpty() ) {
throw new IllegalArgumentException( "genome wide combinable domains list is empty" );
}
return matrix;
}
- private static BinaryDomainCombination mapBinaryDomainCombination( final Map<DomainId, String> domain_id_to_second_features_map,
+ private static BinaryDomainCombination mapBinaryDomainCombination( final Map<String, String> domain_id_to_second_features_map,
final BinaryDomainCombination bc,
final SortedSet<String> no_mappings ) {
String id0 = "";
String id1 = "";
if ( !domain_id_to_second_features_map.containsKey( bc.getId0() ) ) {
- no_mappings.add( bc.getId0().getId() );
- id0 = bc.getId0().getId();
+ no_mappings.add( bc.getId0() );
+ id0 = bc.getId0();
}
else {
id0 = domain_id_to_second_features_map.get( bc.getId0() );
}
if ( !domain_id_to_second_features_map.containsKey( bc.getId1() ) ) {
- no_mappings.add( bc.getId1().getId() );
- id1 = bc.getId1().getId();
+ no_mappings.add( bc.getId1() );
+ id1 = bc.getId1();
}
else {
id1 = domain_id_to_second_features_map.get( bc.getId1() );
}
public static CharacterStateMatrix<BinaryStates> createMatrixOfDomainPresenceOrAbsence( final List<GenomeWideCombinableDomains> gwcd_list,
- final SortedSet<DomainId> positive_filter ) {
+ final SortedSet<String> positive_filter ) {
if ( gwcd_list.isEmpty() ) {
throw new IllegalArgumentException( "genome wide combinable domains list is empty" );
}
throw new IllegalArgumentException( "positive filter is empty" );
}
final int number_of_identifiers = gwcd_list.size();
- final SortedSet<DomainId> all_domain_ids = new TreeSet<DomainId>();
+ final SortedSet<String> all_domain_ids = new TreeSet<String>();
for( final GenomeWideCombinableDomains gwcd : gwcd_list ) {
- for( final DomainId domain : gwcd.getAllDomainIds() ) {
+ for( final String domain : gwcd.getAllDomainIds() ) {
all_domain_ids.add( domain );
}
}
if ( positive_filter != null ) {
//number_of_characters = positive_filter.size(); -- bad if doms in filter but not in genomes
number_of_characters = 0;
- for( final DomainId id : all_domain_ids ) {
+ for( final String id : all_domain_ids ) {
if ( positive_filter.contains( id ) ) {
number_of_characters++;
}
final CharacterStateMatrix<CharacterStateMatrix.BinaryStates> matrix = new BasicCharacterStateMatrix<CharacterStateMatrix.BinaryStates>( number_of_identifiers,
number_of_characters );
int character_index = 0;
- for( final DomainId id : all_domain_ids ) {
+ for( final String id : all_domain_ids ) {
if ( positive_filter == null ) {
- matrix.setCharacter( character_index++, id.getId() );
+ matrix.setCharacter( character_index++, id );
}
else {
if ( positive_filter.contains( id ) ) {
- matrix.setCharacter( character_index++, id.getId() );
+ matrix.setCharacter( character_index++, id );
}
}
}
if ( ForesterUtil.isEmpty( matrix.getCharacter( ci ) ) ) {
throw new RuntimeException( "this should not have happened: problem with character #" + ci );
}
- final DomainId id = new DomainId( matrix.getCharacter( ci ) );
+ final String id = matrix.getCharacter( ci );
if ( gwcd.contains( id ) ) {
matrix.setState( identifier_index, ci, CharacterStateMatrix.BinaryStates.PRESENT );
}
import java.util.SortedMap;
import java.util.SortedSet;
-import org.forester.protein.DomainId;
import org.forester.species.Species;
import org.forester.surfacing.PrintableDomainSimilarity.PRINT_OPTION;
MIN, MAX, SD, MEAN, ABS_MAX_COUNTS_DIFFERENCE, MAX_COUNTS_DIFFERENCE, MAX_DIFFERENCE, SPECIES_COUNT, DOMAIN_ID,
}
- public SortedSet<DomainId> getCombinableDomainIds( final Species species_of_combinable_domain );;
+ public SortedSet<String> getCombinableDomainIds( final Species species_of_combinable_domain );;
- public DomainId getDomainId();
+ public String getDomainId();
/**
* For pairwise similarities, this should return the "difference"; for example the difference in counts
import org.forester.protein.BinaryDomainCombination;
import org.forester.protein.BinaryDomainCombination.DomainCombinationType;
-import org.forester.protein.DomainId;
import org.forester.species.Species;
import org.forester.util.DescriptiveStatistics;
public interface GenomeWideCombinableDomains {
- public boolean contains( DomainId key_id );
+ public boolean contains( String key_id );
- public CombinableDomains get( DomainId key_id );
+ public CombinableDomains get( String key_id );
- public SortedMap<DomainId, CombinableDomains> getAllCombinableDomainsIds();
+ public SortedMap<String, CombinableDomains> getAllCombinableDomainsIds();
/**
* This should return all domains ids present in the genome.
*
* @return a sorted set of domains ids
*/
- public SortedSet<DomainId> getAllDomainIds();
+ public SortedSet<String> getAllDomainIds();
public DomainCombinationType getDomainCombinationType();
- SortedSet<DomainId> getMostPromiscuosDomain();
+ SortedSet<String> getMostPromiscuosDomain();
/**
* This should return a statistic for per domain
import org.forester.go.GoId;
import org.forester.go.GoNameSpace;
import org.forester.go.GoTerm;
-import org.forester.protein.DomainId;
import org.forester.species.Species;
import org.forester.surfacing.DomainSimilarityCalculator.Detailedness;
import org.forester.util.DescriptiveStatistics;
final DomainSimilarity.DomainSimilaritySortField domain_similarity_sort_field,
final PrintableDomainSimilarity.PRINT_OPTION domain_similarity_print_option,
final DomainSimilarity.DomainSimilarityScoring scoring,
- final Map<DomainId, List<GoId>> domain_id_to_go_ids_map,
+ final Map<String, List<GoId>> domain_id_to_go_ids_map,
final Map<GoId, GoTerm> go_id_to_term_map,
final GoNameSpace go_namespace_limit,
final Species[] species,
else if ( jacknife_ratio >= 1.0 ) {
throw new IllegalArgumentException( "attempt to perform jacknife resampling with jacknife ratio 1.0 or more" );
}
- final DomainId[] all_unique_domain_ids = getAllUniqueDomainIdAsArray( list_of_genome_wide_combinable_domains );
+ final String[] all_unique_domain_ids = getAllUniqueDomainIdAsArray( list_of_genome_wide_combinable_domains );
if ( verbose ) {
System.out.println();
System.out.println( "Jacknife: total of domains: " + all_unique_domain_ids.length );
if ( verbose ) {
System.out.print( " " + r );
}
- final SortedSet<DomainId> domain_ids_to_ignore = randomlyPickDomainIds( all_unique_domain_ids,
- jacknife_ratio,
- generator );
+ final SortedSet<String> domain_ids_to_ignore = randomlyPickDomainIds( all_unique_domain_ids,
+ jacknife_ratio,
+ generator );
final BasicSymmetricalDistanceMatrix shared_domains_based_distances = new BasicSymmetricalDistanceMatrix( number_of_genomes );
final BasicSymmetricalDistanceMatrix shared_binary_combinations_based_distances = new BasicSymmetricalDistanceMatrix( number_of_genomes );
for( int i = 0; i < number_of_genomes; ++i ) {
}
}
- static private DomainId[] getAllUniqueDomainIdAsArray( final List<GenomeWideCombinableDomains> list_of_genome_wide_combinable_domains ) {
- DomainId[] all_domain_ids_array;
- final SortedSet<DomainId> all_domain_ids = new TreeSet<DomainId>();
+ static private String[] getAllUniqueDomainIdAsArray( final List<GenomeWideCombinableDomains> list_of_genome_wide_combinable_domains ) {
+ String[] all_domain_ids_array;
+ final SortedSet<String> all_domain_ids = new TreeSet<String>();
for( final GenomeWideCombinableDomains genome_wide_combinable_domains : list_of_genome_wide_combinable_domains ) {
- final SortedSet<DomainId> all_domains = genome_wide_combinable_domains.getAllDomainIds();
- for( final DomainId domain : all_domains ) {
+ final SortedSet<String> all_domains = genome_wide_combinable_domains.getAllDomainIds();
+ for( final String domain : all_domains ) {
all_domain_ids.add( domain );
}
}
- all_domain_ids_array = new DomainId[ all_domain_ids.size() ];
+ all_domain_ids_array = new String[ all_domain_ids.size() ];
int n = 0;
- for( final DomainId domain_id : all_domain_ids ) {
+ for( final String domain_id : all_domain_ids ) {
all_domain_ids_array[ n++ ] = domain_id;
}
return all_domain_ids_array;
}
- static private SortedSet<DomainId> randomlyPickDomainIds( final DomainId[] all_domain_ids_array,
- final double jacknife_ratio,
- final Random generator ) {
+ static private SortedSet<String> randomlyPickDomainIds( final String[] all_domain_ids_array,
+ final double jacknife_ratio,
+ final Random generator ) {
final int size = all_domain_ids_array.length;
- final SortedSet<DomainId> random_domain_ids = new TreeSet<DomainId>();
+ final SortedSet<String> random_domain_ids = new TreeSet<String>();
final int number_of_ids_pick = ForesterUtil.roundToInt( jacknife_ratio * size );
while ( random_domain_ids.size() < number_of_ids_pick ) {
final int r = generator.nextInt( size );
import org.forester.go.GoNameSpace;
import org.forester.go.GoTerm;
import org.forester.go.GoXRef;
-import org.forester.protein.DomainId;
import org.forester.species.Species;
import org.forester.surfacing.DomainSimilarityCalculator.Detailedness;
import org.forester.surfacing.DomainSimilarityCalculator.GoAnnotationOutput;
}
}
- private void addGoInformation( final StringBuffer sb, final boolean for_table, final boolean html ) {
- if ( !for_table ) {
- sb.append( "<" );
- }
- switch ( getGoAnnotationOutput() ) {
- case ALL: {
- final int go_ids = getCombinableDomains().getKeyDomain().getNumberOfGoIds();
- boolean first = true;
- for( int i = 0; i < go_ids; ++i ) {
- final GoId go_id = getCombinableDomains().getKeyDomain().getGoId( i );
- if ( getGoIdToTermMap() != null ) {
- if ( getGoIdToTermMap().containsKey( go_id ) ) {
- first = appendGoTerm( sb, getGoIdToTermMap().get( go_id ), first, html );
- }
- else {
- sb.append( "go id \"" + go_id + "\" not found ["
- + getCombinableDomains().getKeyDomain().getId() + "]" );
- }
- }
- else {
- if ( !first ) {
- sb.append( ", " );
- }
- if ( html ) {
- sb.append( "<a href=\"" + SurfacingConstants.AMIGO_LINK + go_id
- + "\" target=\"amigo_window\">" + go_id + "</a>" );
- }
- else {
- sb.append( go_id );
- }
- first = false;
- }
- }
- break;
- }
- case NONE: {
- break;
- }
- default:
- throw new RuntimeException( "unknown " + getGoAnnotationOutput() );
- }
- if ( !for_table ) {
- sb.append( ">: " );
- }
- }
-
+ // private void addGoInformation( final StringBuffer sb, final boolean for_table, final boolean html ) {
+ // if ( !for_table ) {
+ // sb.append( "<" );
+ // }
+ // switch ( getGoAnnotationOutput() ) {
+ // case ALL: {
+ // final int go_ids = getCombinableDomains().getKeyDomain().getNumberOfGoIds();
+ // boolean first = true;
+ // for( int i = 0; i < go_ids; ++i ) {
+ // final GoId go_id = getCombinableDomains().getKeyDomain().getGoId( i );
+ // if ( getGoIdToTermMap() != null ) {
+ // if ( getGoIdToTermMap().containsKey( go_id ) ) {
+ // first = appendGoTerm( sb, getGoIdToTermMap().get( go_id ), first, html );
+ // }
+ // else {
+ // sb.append( "go id \"" + go_id + "\" not found ["
+ // + getCombinableDomains().getKeyDomain().getId() + "]" );
+ // }
+ // }
+ // else {
+ // if ( !first ) {
+ // sb.append( ", " );
+ // }
+ // if ( html ) {
+ // sb.append( "<a href=\"" + SurfacingConstants.AMIGO_LINK + go_id
+ // + "\" target=\"amigo_window\">" + go_id + "</a>" );
+ // }
+ // else {
+ // sb.append( go_id );
+ // }
+ // first = false;
+ // }
+ // }
+ // break;
+ // }
+ // case NONE: {
+ // break;
+ // }
+ // default:
+ // throw new RuntimeException( "unknown " + getGoAnnotationOutput() );
+ // }
+ // if ( !for_table ) {
+ // sb.append( ">: " );
+ // }
+ // }
private void addSpeciesSpecificDomainData( final StringBuffer sb,
final Species species,
final boolean html,
}
@Override
- public SortedSet<DomainId> getCombinableDomainIds( final Species species_of_combinable_domain ) {
- final SortedSet<DomainId> sorted_ids = new TreeSet<DomainId>();
+ public SortedSet<String> getCombinableDomainIds( final Species species_of_combinable_domain ) {
+ final SortedSet<String> sorted_ids = new TreeSet<String>();
if ( getSpeciesData().containsKey( species_of_combinable_domain ) ) {
- for( final DomainId id : getSpeciesData().get( species_of_combinable_domain )
+ for( final String id : getSpeciesData().get( species_of_combinable_domain )
.getCombinableDomainIdToCountsMap().keySet() ) {
sorted_ids.add( id );
}
}
@Override
- public DomainId getDomainId() {
+ public String getDomainId() {
return getCombinableDomains().getKeyDomain();
}
}
sb.append( "</td>" );
}
- if ( getGoAnnotationOutput() != DomainSimilarityCalculator.GoAnnotationOutput.NONE ) {
- sb.append( "<td>" );
- addGoInformation( sb, true, true );
- sb.append( "</td>" );
- }
+ // ^^ if ( getGoAnnotationOutput() != DomainSimilarityCalculator.GoAnnotationOutput.NONE ) {
+ // ^^ sb.append( "<td>" );
+ // ^^ addGoInformation( sb, true, true );
+ // ^^ sb.append( "</td>" );
+ // ^^ }
if ( ( getSpeciesCustomOrder() == null ) || getSpeciesCustomOrder().isEmpty() ) {
sb.append( "<td>" );
sb.append( getSpeciesDataInAlphabeticalOrder( true, tax_code_to_id_map ) );
default:
throw new AssertionError( "Unknown sort method: " + getSortField() );
}
- if ( getGoAnnotationOutput() != DomainSimilarityCalculator.GoAnnotationOutput.NONE ) {
- sb.append( TAB );
- addGoInformation( sb, true, false );
- }
+ // ^^ if ( getGoAnnotationOutput() != DomainSimilarityCalculator.GoAnnotationOutput.NONE ) {
+ // ^^ sb.append( TAB );
+ // ^^ addGoInformation( sb, true, false );
+ // ^^ }
return sb;
}
import java.util.SortedMap;
import java.util.TreeMap;
-import org.forester.protein.DomainId;
import org.forester.util.DescriptiveStatistics;
class PrintableSpeciesSpecificDomainSimilariyData implements SpeciesSpecificDomainSimilariyData {
private final static NumberFormat FORMATTER = new DecimalFormat( "0.0E0" );
- final SortedMap<DomainId, Integer> _combinable_domain_id_to_count_map;
+ final SortedMap<String, Integer> _combinable_domain_id_to_count_map;
final private int _key_domain_proteins_count;
final private int _key_domain_domains_count;
final private int _combinable_domains_count;
_key_domain_domains_count = key_domain_domains_count;
_combinable_domains_count = combinable_domains;
_key_domain_confidence_descriptive_statistics = key_domain_confidence_descriptive_statistics;
- _combinable_domain_id_to_count_map = new TreeMap<DomainId, Integer>();
+ _combinable_domain_id_to_count_map = new TreeMap<String, Integer>();
}
@Override
- public void addProteinsExhibitingCombinationCount( final DomainId domain_id, final int count ) {
+ public void addProteinsExhibitingCombinationCount( final String domain_id, final int count ) {
if ( getCombinableDomainIdToCountsMap().containsKey( domain_id ) ) {
throw new IllegalArgumentException( "Domain with id " + domain_id + " already exists" );
}
}
@Override
- public SortedMap<DomainId, Integer> getCombinableDomainIdToCountsMap() {
+ public SortedMap<String, Integer> getCombinableDomainIdToCountsMap() {
return _combinable_domain_id_to_count_map;
}
}
@Override
- public int getNumberOfProteinsExhibitingCombinationWith( final DomainId domain_id ) {
+ public int getNumberOfProteinsExhibitingCombinationWith( final String domain_id ) {
if ( !getCombinableDomainIdToCountsMap().containsKey( domain_id ) ) {
throw new IllegalArgumentException( "Domain with id " + domain_id + " not found" );
}
sb.append( ":" );
}
}
- final Set<DomainId> ids = getCombinableDomainIdToCountsMap().keySet();
+ final Set<String> ids = getCombinableDomainIdToCountsMap().keySet();
int i = 0;
- for( final DomainId domain_id : ids ) {
+ for( final String domain_id : ids ) {
++i;
sb.append( " " );
if ( html ) {
- sb.append( "<a href=\"" + SurfacingConstants.PFAM_FAMILY_ID_LINK + domain_id.getId() + "\">"
- + domain_id.getId() + "</a>" );
+ sb.append( "<a href=\"" + SurfacingConstants.PFAM_FAMILY_ID_LINK + domain_id + "\">" + domain_id
+ + "</a>" );
}
else {
- sb.append( domain_id.getId() );
+ sb.append( domain_id );
}
if ( detailedness == DomainSimilarityCalculator.Detailedness.PUNCTILIOUS ) {
sb.append( ":" );
package org.forester.surfacing;
-import org.forester.go.GoId;
import org.forester.protein.Domain;
-import org.forester.protein.DomainId;
import org.forester.util.ForesterUtil;
/*
*/
public class SimpleDomain implements Domain {
- final private DomainId _id;
+ final private String _id;
- public SimpleDomain( final String id_str ) {
- if ( ForesterUtil.isEmpty( id_str ) ) {
+ public SimpleDomain( final String id ) {
+ if ( ForesterUtil.isEmpty( id ) ) {
throw new IllegalArgumentException( "attempt to create protein domain with null or empty id" );
}
- _id = new DomainId( id_str );
- }
-
- @Override
- public void addGoId( final GoId go_id ) {
- throw new RuntimeException( "method not implemented" );
+ _id = id;
}
+ // ^^ @Override
+ // ^^ public void addGoId( final GoId go_id ) {
+ // ^^ throw new RuntimeException( "method not implemented" );
+ // ^^ }
@Override
public int compareTo( final Domain domain ) {
if ( this == domain ) {
}
@Override
- public DomainId getDomainId() {
+ public String getDomainId() {
return _id;
}
throw new RuntimeException( "method not implemented" );
}
- @Override
- public GoId getGoId( final int i ) {
- throw new RuntimeException( "method not implemented" );
- }
-
+ // ^^ @Override
+ // ^^ public GoId getGoId( final int i ) {
+ // ^^ throw new RuntimeException( "method not implemented" );
+ // ^^ }
@Override
public int getLength() {
throw new RuntimeException( "method not implemented" );
throw new RuntimeException( "method not implemented" );
}
- @Override
- public int getNumberOfGoIds() {
- throw new RuntimeException( "method not implemented" );
- }
-
+ // ^^ @Override
+ // ^^ public int getNumberOfGoIds() {
+ // ^^ throw new RuntimeException( "method not implemented" );
+ // ^^ }
@Override
public double getPerDomainEvalue() {
throw new RuntimeException( "method not implemented" );
import java.util.SortedMap;
-import org.forester.protein.DomainId;
-
/*
* A helper class for PrintableDomainSimilarity.
*/
interface SpeciesSpecificDomainSimilariyData {
- public void addProteinsExhibitingCombinationCount( final DomainId domain_id, final int count );
+ public void addProteinsExhibitingCombinationCount( final String domain_id, final int count );
/**
* This should return a sorted map mapping domain ids to their corresponding
*
* @return a sorted map mapping domain ids to their corresponding counts
*/
- public SortedMap<DomainId, Integer> getCombinableDomainIdToCountsMap();
+ public SortedMap<String, Integer> getCombinableDomainIdToCountsMap();
- public int getNumberOfProteinsExhibitingCombinationWith( final DomainId domain_id );
+ public int getNumberOfProteinsExhibitingCombinationWith( final String domain_id );
public StringBuffer toStringBuffer( final DomainSimilarityCalculator.Detailedness detailedness, boolean html );
}
import org.forester.protein.BasicProtein;
import org.forester.protein.BinaryDomainCombination;
import org.forester.protein.Domain;
-import org.forester.protein.DomainId;
import org.forester.protein.Protein;
import org.forester.species.Species;
import org.forester.surfacing.DomainSimilarityCalculator.Detailedness;
public static void addAllBinaryDomainCombinationToSet( final GenomeWideCombinableDomains genome,
final SortedSet<BinaryDomainCombination> binary_domain_combinations ) {
- final SortedMap<DomainId, CombinableDomains> all_cd = genome.getAllCombinableDomainsIds();
- for( final DomainId domain_id : all_cd.keySet() ) {
+ final SortedMap<String, CombinableDomains> all_cd = genome.getAllCombinableDomainsIds();
+ for( final String domain_id : all_cd.keySet() ) {
binary_domain_combinations.addAll( all_cd.get( domain_id ).toBinaryDomainCombinations() );
}
}
public static void addAllDomainIdsToSet( final GenomeWideCombinableDomains genome,
- final SortedSet<DomainId> domain_ids ) {
- final SortedSet<DomainId> domains = genome.getAllDomainIds();
- for( final DomainId domain : domains ) {
+ final SortedSet<String> domain_ids ) {
+ final SortedSet<String> domains = genome.getAllDomainIds();
+ for( final String domain : domains ) {
domain_ids.add( domain );
}
}
}
}
- public static Map<DomainId, List<GoId>> createDomainIdToGoIdMap( final List<PfamToGoMapping> pfam_to_go_mappings ) {
- final Map<DomainId, List<GoId>> domain_id_to_go_ids_map = new HashMap<DomainId, List<GoId>>( pfam_to_go_mappings
- .size() );
+ public static Map<String, List<GoId>> createDomainIdToGoIdMap( final List<PfamToGoMapping> pfam_to_go_mappings ) {
+ final Map<String, List<GoId>> domain_id_to_go_ids_map = new HashMap<String, List<GoId>>( pfam_to_go_mappings.size() );
for( final PfamToGoMapping pfam_to_go : pfam_to_go_mappings ) {
if ( !domain_id_to_go_ids_map.containsKey( pfam_to_go.getKey() ) ) {
domain_id_to_go_ids_map.put( pfam_to_go.getKey(), new ArrayList<GoId>() );
return domain_id_to_go_ids_map;
}
- public static Map<DomainId, Set<String>> createDomainIdToSecondaryFeaturesMap( final File secondary_features_map_file )
+ public static Map<String, Set<String>> createDomainIdToSecondaryFeaturesMap( final File secondary_features_map_file )
throws IOException {
final BasicTable<String> primary_table = BasicTableParser.parse( secondary_features_map_file, '\t' );
- final Map<DomainId, Set<String>> map = new TreeMap<DomainId, Set<String>>();
+ final Map<String, Set<String>> map = new TreeMap<String, Set<String>>();
for( int r = 0; r < primary_table.getNumberOfRows(); ++r ) {
- final DomainId domain_id = new DomainId( primary_table.getValue( 0, r ) );
+ final String domain_id = primary_table.getValue( 0, r );
if ( !map.containsKey( domain_id ) ) {
map.put( domain_id, new HashSet<String>() );
}
}
public static void doit( final List<Protein> proteins,
- final List<DomainId> query_domain_ids_nc_order,
+ final List<String> query_domain_ids_nc_order,
final Writer out,
final String separator,
final String limit_to_species,
out.write( protein.getProteinId().getId() );
out.write( separator );
out.write( "[" );
- final Set<DomainId> visited_domain_ids = new HashSet<DomainId>();
+ final Set<String> visited_domain_ids = new HashSet<String>();
boolean first = true;
for( final Domain domain : protein.getProteinDomains() ) {
if ( !visited_domain_ids.contains( domain.getDomainId() ) ) {
else {
out.write( " " );
}
- out.write( domain.getDomainId().getId() );
+ out.write( domain.getDomainId() );
out.write( " {" );
out.write( "" + domain.getTotalCount() );
out.write( "}" );
1 + all_genomes_domains_per_potein_histo.get( domains ) );
}
if ( domains == 1 ) {
- final String domain = protein.getProteinDomain( 0 ).getDomainId().getId();
+ final String domain = protein.getProteinDomain( 0 ).getDomainId();
if ( !domains_which_are_sometimes_single_sometimes_not.contains( domain ) ) {
if ( domains_which_never_single.contains( domain ) ) {
domains_which_never_single.remove( domain );
}
else if ( domains > 1 ) {
for( final Domain d : protein.getProteinDomains() ) {
- final String domain = d.getDomainId().getId();
+ final String domain = d.getDomainId();
// System.out.println( domain );
if ( !domains_which_are_sometimes_single_sometimes_not.contains( domain ) ) {
if ( domains_which_are_always_single.contains( domain ) ) {
final String outfile_name,
final DomainParsimonyCalculator domain_parsimony,
final Phylogeny phylogeny,
- final Map<DomainId, List<GoId>> domain_id_to_go_ids_map,
+ final Map<String, List<GoId>> domain_id_to_go_ids_map,
final Map<GoId, GoTerm> go_id_to_term_map,
final GoNameSpace go_namespace_limit,
final String parameters_str,
- final Map<DomainId, Set<String>>[] domain_id_to_secondary_features_maps,
- final SortedSet<DomainId> positive_filter,
+ final Map<String, Set<String>>[] domain_id_to_secondary_features_maps,
+ final SortedSet<String> positive_filter,
final boolean output_binary_domain_combinations_for_graphs,
final List<BinaryDomainCombination> all_binary_domains_combination_gained_fitch,
final List<BinaryDomainCombination> all_binary_domains_combination_lost_fitch,
}
public static void extractProteinNames( final List<Protein> proteins,
- final List<DomainId> query_domain_ids_nc_order,
+ final List<String> query_domain_ids_nc_order,
final Writer out,
final String separator,
final String limit_to_species ) throws IOException {
out.write( protein.getProteinId().getId() );
out.write( separator );
out.write( "[" );
- final Set<DomainId> visited_domain_ids = new HashSet<DomainId>();
+ final Set<String> visited_domain_ids = new HashSet<String>();
boolean first = true;
for( final Domain domain : protein.getProteinDomains() ) {
if ( !visited_domain_ids.contains( domain.getDomainId() ) ) {
else {
out.write( " " );
}
- out.write( domain.getDomainId().getId() );
+ out.write( domain.getDomainId() );
out.write( " {" );
out.write( "" + domain.getTotalCount() );
out.write( "}" );
}
public static void extractProteinNames( final SortedMap<Species, List<Protein>> protein_lists_per_species,
- final DomainId domain_id,
+ final String domain_id,
final Writer out,
final String separator,
final String limit_to_species,
out.flush();
}
- public static SortedSet<DomainId> getAllDomainIds( final List<GenomeWideCombinableDomains> gwcd_list ) {
- final SortedSet<DomainId> all_domains_ids = new TreeSet<DomainId>();
+ public static SortedSet<String> getAllDomainIds( final List<GenomeWideCombinableDomains> gwcd_list ) {
+ final SortedSet<String> all_domains_ids = new TreeSet<String>();
for( final GenomeWideCombinableDomains gwcd : gwcd_list ) {
- final Set<DomainId> all_domains = gwcd.getAllDomainIds();
+ final Set<String> all_domains = gwcd.getAllDomainIds();
// for( final Domain domain : all_domains ) {
all_domains_ids.addAll( all_domains );
// }
for( final Protein protein_domain_collection : protein_domain_collections ) {
for( final Object name : protein_domain_collection.getProteinDomains() ) {
final BasicDomain protein_domain = ( BasicDomain ) name;
- final String id = protein_domain.getDomainId().getId();
+ final String id = protein_domain.getDomainId();
if ( map.containsKey( id ) ) {
map.put( id, map.get( id ) + 1 );
}
if ( domains.size() > 1 ) {
final Map<String, Integer> counts = new HashMap<String, Integer>();
for( final Domain domain : domains ) {
- final String id = domain.getDomainId().getId();
+ final String id = domain.getDomainId();
if ( counts.containsKey( id ) ) {
counts.put( id, counts.get( id ) + 1 );
}
domain_n = domains.get( j );
domain_c = domains.get( i );
}
- final String dc = domain_n.getDomainId().getId() + domain_c.getDomainId().getId();
+ final String dc = domain_n.getDomainId() + domain_c.getDomainId();
if ( !dcs.contains( dc ) ) {
dcs.add( dc );
sb.append( protein.getSpecies() );
sb.append( separator );
sb.append( protein_id );
sb.append( separator );
- sb.append( domain_n.getDomainId().getId() );
+ sb.append( domain_n.getDomainId() );
sb.append( separator );
- sb.append( domain_c.getDomainId().getId() );
+ sb.append( domain_c.getDomainId() );
sb.append( separator );
sb.append( domain_n.getPerDomainEvalue() );
sb.append( separator );
sb.append( domain_c.getPerDomainEvalue() );
sb.append( separator );
- sb.append( counts.get( domain_n.getDomainId().getId() ) );
+ sb.append( counts.get( domain_n.getDomainId() ) );
sb.append( separator );
- sb.append( counts.get( domain_c.getDomainId().getId() ) );
+ sb.append( counts.get( domain_c.getDomainId() ) );
sb.append( ForesterUtil.LINE_SEPARATOR );
}
}
sb.append( separator );
sb.append( protein_id );
sb.append( separator );
- sb.append( domains.get( 0 ).getDomainId().getId() );
+ sb.append( domains.get( 0 ).getDomainId() );
sb.append( separator );
sb.append( separator );
sb.append( domains.get( 0 ).getPerDomainEvalue() );
ForesterUtil.programMessage( surfacing.PRG_NAME, "Wrote characters list: \"" + filename + "\"" );
}
- public static void writeBinaryStatesMatrixToList( final Map<DomainId, List<GoId>> domain_id_to_go_ids_map,
+ public static void writeBinaryStatesMatrixToList( final Map<String, List<GoId>> domain_id_to_go_ids_map,
final Map<GoId, GoTerm> go_id_to_term_map,
final GoNameSpace go_namespace_limit,
final boolean domain_combinations,
final String character_separator,
final String title_for_html,
final String prefix_for_html,
- final Map<DomainId, Set<String>>[] domain_id_to_secondary_features_maps,
+ final Map<String, Set<String>>[] domain_id_to_secondary_features_maps,
final SortedSet<String> all_pfams_encountered,
final SortedSet<String> pfams_gained_or_lost,
final String suffix_for_per_node_events_file,
per_genome_domain_promiscuity_statistics_writer.write( ( int ) stats.getMin() + "\t" );
per_genome_domain_promiscuity_statistics_writer.write( ( int ) stats.getMax() + "\t" );
per_genome_domain_promiscuity_statistics_writer.write( stats.getN() + "\t" );
- final SortedSet<DomainId> mpds = gwcd.getMostPromiscuosDomain();
- for( final DomainId mpd : mpds ) {
- per_genome_domain_promiscuity_statistics_writer.write( mpd.getId() + " " );
+ final SortedSet<String> mpds = gwcd.getMostPromiscuosDomain();
+ for( final String mpd : mpds ) {
+ per_genome_domain_promiscuity_statistics_writer.write( mpd + " " );
}
per_genome_domain_promiscuity_statistics_writer.write( ForesterUtil.LINE_SEPARATOR );
}
}
if ( single_writer != null ) {
single_writer.write( similarity.toStringBuffer( print_option, tax_code_to_id_map ).toString() );
+ single_writer.write( SurfacingConstants.NL );
}
else {
- Writer local_writer = split_writers.get( ( similarity.getDomainId().getId().charAt( 0 ) + "" )
- .toLowerCase().charAt( 0 ) );
+ Writer local_writer = split_writers.get( ( similarity.getDomainId().charAt( 0 ) + "" ).toLowerCase()
+ .charAt( 0 ) );
if ( local_writer == null ) {
local_writer = split_writers.get( '0' );
}
local_writer.write( similarity.toStringBuffer( print_option, tax_code_to_id_map ).toString() );
+ local_writer.write( SurfacingConstants.NL );
}
- for( final Writer w : split_writers.values() ) {
- w.write( SurfacingConstants.NL );
- }
+ // for( final Writer w : split_writers.values() ) {
+ //w.write( SurfacingConstants.NL );
+ // }
}
switch ( print_option ) {
case HTML:
}
private static SortedSet<BinaryDomainCombination> createSetOfAllBinaryDomainCombinationsPerGenome( final GenomeWideCombinableDomains gwcd ) {
- final SortedMap<DomainId, CombinableDomains> cds = gwcd.getAllCombinableDomainsIds();
+ final SortedMap<String, CombinableDomains> cds = gwcd.getAllCombinableDomainsIds();
final SortedSet<BinaryDomainCombination> binary_combinations = new TreeSet<BinaryDomainCombination>();
- for( final DomainId domain_id : cds.keySet() ) {
+ for( final String domain_id : cds.keySet() ) {
final CombinableDomains cd = cds.get( domain_id );
binary_combinations.addAll( cd.toBinaryDomainCombinations() );
}
return l;
}
- private static void writeAllEncounteredPfamsToFile( final Map<DomainId, List<GoId>> domain_id_to_go_ids_map,
+ private static void writeAllEncounteredPfamsToFile( final Map<String, List<GoId>> domain_id_to_go_ids_map,
final Map<GoId, GoTerm> go_id_to_term_map,
final String outfile_name,
final SortedSet<String> all_pfams_encountered ) {
for( final String pfam : all_pfams_encountered ) {
all_pfams_encountered_writer.write( pfam );
all_pfams_encountered_writer.write( ForesterUtil.LINE_SEPARATOR );
- final DomainId domain_id = new DomainId( pfam );
+ final String domain_id = new String( pfam );
if ( domain_id_to_go_ids_map.containsKey( domain_id ) ) {
++pfams_with_mappings_counter;
all_pfams_encountered_with_go_annotation_writer.write( pfam );
}
}
- private static void writeDomainData( final Map<DomainId, List<GoId>> domain_id_to_go_ids_map,
+ private static void writeDomainData( final Map<String, List<GoId>> domain_id_to_go_ids_map,
final Map<GoId, GoTerm> go_id_to_term_map,
final GoNameSpace go_namespace_limit,
final Writer out,
final String domain_1,
final String prefix_for_html,
final String character_separator_for_non_html_output,
- final Map<DomainId, Set<String>>[] domain_id_to_secondary_features_maps,
+ final Map<String, Set<String>>[] domain_id_to_secondary_features_maps,
final Set<GoId> all_go_ids ) throws IOException {
boolean any_go_annotation_present = false;
boolean first_has_no_go = false;
List<GoId> go_ids = null;
boolean go_annotation_present = false;
if ( d == 0 ) {
- final DomainId domain_id = new DomainId( domain_0 );
- if ( domain_id_to_go_ids_map.containsKey( domain_id ) ) {
+ if ( domain_id_to_go_ids_map.containsKey( domain_0 ) ) {
go_annotation_present = true;
any_go_annotation_present = true;
- go_ids = domain_id_to_go_ids_map.get( domain_id );
+ go_ids = domain_id_to_go_ids_map.get( domain_0 );
}
else {
first_has_no_go = true;
}
}
else {
- final DomainId domain_id = new DomainId( domain_1 );
- if ( domain_id_to_go_ids_map.containsKey( domain_id ) ) {
+ if ( domain_id_to_go_ids_map.containsKey( domain_1 ) ) {
go_annotation_present = true;
any_go_annotation_present = true;
- go_ids = domain_id_to_go_ids_map.get( domain_id );
+ go_ids = domain_id_to_go_ids_map.get( domain_1 );
}
}
if ( go_annotation_present ) {
final String domain_0,
final String domain_1,
final String prefix_for_detailed_html,
- final Map<DomainId, Set<String>>[] domain_id_to_secondary_features_maps )
+ final Map<String, Set<String>>[] domain_id_to_secondary_features_maps )
throws IOException {
out.write( "<td>" );
if ( !ForesterUtil.isEmpty( prefix_for_detailed_html ) ) {
import org.forester.protein.BinaryDomainCombination;
import org.forester.protein.BinaryDomainCombination.DomainCombinationType;
import org.forester.protein.Domain;
-import org.forester.protein.DomainId;
import org.forester.protein.Protein;
import org.forester.protein.ProteinId;
import org.forester.species.BasicSpecies;
true );
final Iterator<DomainSimilarity> sims_it = sims.iterator();
final DomainSimilarity sa = sims_it.next();
- if ( !sa.getDomainId().getId().equals( "A" ) ) {
+ if ( !sa.getDomainId().equals( "A" ) ) {
return false;
}
if ( sa.getSpeciesData().size() != 4 ) {
return false;
}
final DomainSimilarity sb = sims_it.next();
- if ( !sb.getDomainId().getId().equals( "B" ) ) {
+ if ( !sb.getDomainId().equals( "B" ) ) {
return false;
}
if ( sb.getSpeciesData().size() != 2 ) {
return false;
}
final DomainSimilarity sc = sims_it.next();
- if ( !sc.getDomainId().getId().equals( "C" ) ) {
+ if ( !sc.getDomainId().equals( "C" ) ) {
return false;
}
if ( sc.getSpeciesData().size() != 3 ) {
true );
final Iterator<DomainSimilarity> sims_it2 = sims2.iterator();
final DomainSimilarity sa2 = sims_it2.next();
- if ( !sa2.getDomainId().getId().equals( "A" ) ) {
+ if ( !sa2.getDomainId().equals( "A" ) ) {
return false;
}
if ( sa2.getSpeciesData().size() != 4 ) {
true );
final Iterator<DomainSimilarity> sims_it3 = sims3.iterator();
final DomainSimilarity sa3 = sims_it3.next();
- if ( !sa3.getDomainId().getId().equals( "A" ) ) {
+ if ( !sa3.getDomainId().equals( "A" ) ) {
return false;
}
final SpeciesSpecificDomainSimilariyData ssdsd = sa3.getSpeciesData().get( new BasicSpecies( "ciona" ) );
if ( ssdsd.getCombinableDomainIdToCountsMap().size() != 4 ) {
return false;
}
- if ( ssdsd.getNumberOfProteinsExhibitingCombinationWith( new DomainId( "B" ) ) != 2 ) {
+ if ( ssdsd.getNumberOfProteinsExhibitingCombinationWith( "B" ) != 2 ) {
return false;
}
- if ( ssdsd.getNumberOfProteinsExhibitingCombinationWith( new DomainId( "F" ) ) != 2 ) {
+ if ( ssdsd.getNumberOfProteinsExhibitingCombinationWith( "F" ) != 2 ) {
return false;
}
- if ( ssdsd.getNumberOfProteinsExhibitingCombinationWith( new DomainId( "G" ) ) != 2 ) {
+ if ( ssdsd.getNumberOfProteinsExhibitingCombinationWith( "G" ) != 2 ) {
return false;
}
- if ( ssdsd.getNumberOfProteinsExhibitingCombinationWith( new DomainId( "X" ) ) != 3 ) {
+ if ( ssdsd.getNumberOfProteinsExhibitingCombinationWith( "X" ) != 3 ) {
return false;
}
final List<GenomeWideCombinableDomains> cdc_list4 = new ArrayList<GenomeWideCombinableDomains>();
true );
final Iterator<DomainSimilarity> sims_it4 = sims4.iterator();
final DomainSimilarity sa4 = sims_it4.next();
- if ( !sa4.getDomainId().getId().equals( "A" ) ) {
+ if ( !sa4.getDomainId().equals( "A" ) ) {
return false;
}
final SpeciesSpecificDomainSimilariyData ssdsd4 = sa4.getSpeciesData().get( new BasicSpecies( "ciona" ) );
if ( ssdsd4.getCombinableDomainIdToCountsMap().size() != 5 ) {
return false;
}
- if ( ssdsd4.getNumberOfProteinsExhibitingCombinationWith( new DomainId( "A" ) ) != 3 ) {
+ if ( ssdsd4.getNumberOfProteinsExhibitingCombinationWith( "A" ) != 3 ) {
return false;
}
- if ( ssdsd4.getNumberOfProteinsExhibitingCombinationWith( new DomainId( "B" ) ) != 2 ) {
+ if ( ssdsd4.getNumberOfProteinsExhibitingCombinationWith( "B" ) != 2 ) {
return false;
}
- if ( ssdsd4.getNumberOfProteinsExhibitingCombinationWith( new DomainId( "F" ) ) != 2 ) {
+ if ( ssdsd4.getNumberOfProteinsExhibitingCombinationWith( "F" ) != 2 ) {
return false;
}
- if ( ssdsd4.getNumberOfProteinsExhibitingCombinationWith( new DomainId( "G" ) ) != 2 ) {
+ if ( ssdsd4.getNumberOfProteinsExhibitingCombinationWith( "G" ) != 2 ) {
return false;
}
- if ( ssdsd4.getNumberOfProteinsExhibitingCombinationWith( new DomainId( "X" ) ) != 3 ) {
+ if ( ssdsd4.getNumberOfProteinsExhibitingCombinationWith( "X" ) != 3 ) {
return false;
}
final SortedSet<DomainSimilarity> sims4_d = calc4
.calculateSimilarities( new DomainCountsBasedPairwiseSimilarityCalculator(), cdc_list4, false, true );
final Iterator<DomainSimilarity> sims_it4_d = sims4_d.iterator();
final DomainSimilarity sa4_d = sims_it4_d.next();
- if ( !sa4_d.getDomainId().getId().equals( "A" ) ) {
+ if ( !sa4_d.getDomainId().equals( "A" ) ) {
return false;
}
if ( sa4_d.getCombinableDomainIds( new BasicSpecies( "ciona" ) ).size() != 5 ) {
true );
final Iterator<DomainSimilarity> sims_it4_p = sims4_p.iterator();
final DomainSimilarity sa4_p = sims_it4_p.next();
- if ( !sa4_p.getDomainId().getId().equals( "A" ) ) {
+ if ( !sa4_p.getDomainId().equals( "A" ) ) {
return false;
}
if ( sa4_p.getCombinableDomainIds( new BasicSpecies( "ciona" ) ).size() != 5 ) {
return false;
}
- if ( !sa4_p.getCombinableDomainIds( new BasicSpecies( "ciona" ) ).contains( new DomainId( "A" ) ) ) {
+ if ( !sa4_p.getCombinableDomainIds( new BasicSpecies( "ciona" ) ).contains( "A" ) ) {
return false;
}
- if ( !sa4_p.getCombinableDomainIds( new BasicSpecies( "ciona" ) ).contains( new DomainId( "B" ) ) ) {
+ if ( !sa4_p.getCombinableDomainIds( new BasicSpecies( "ciona" ) ).contains( "B" ) ) {
return false;
}
- if ( !sa4_p.getCombinableDomainIds( new BasicSpecies( "ciona" ) ).contains( new DomainId( "F" ) ) ) {
+ if ( !sa4_p.getCombinableDomainIds( new BasicSpecies( "ciona" ) ).contains( "F" ) ) {
return false;
}
- if ( !sa4_p.getCombinableDomainIds( new BasicSpecies( "ciona" ) ).contains( new DomainId( "G" ) ) ) {
+ if ( !sa4_p.getCombinableDomainIds( new BasicSpecies( "ciona" ) ).contains( "G" ) ) {
return false;
}
- if ( !sa4_p.getCombinableDomainIds( new BasicSpecies( "ciona" ) ).contains( new DomainId( "X" ) ) ) {
+ if ( !sa4_p.getCombinableDomainIds( new BasicSpecies( "ciona" ) ).contains( "X" ) ) {
return false;
}
if ( !TestSurfacing
if ( ssdsd5.getCombinableDomainIdToCountsMap().size() != 4 ) {
return false;
}
- if ( ssdsd5.getNumberOfProteinsExhibitingCombinationWith( new DomainId( "B" ) ) != 2 ) {
+ if ( ssdsd5.getNumberOfProteinsExhibitingCombinationWith( "B" ) != 2 ) {
return false;
}
- if ( ssdsd5.getNumberOfProteinsExhibitingCombinationWith( new DomainId( "F" ) ) != 2 ) {
+ if ( ssdsd5.getNumberOfProteinsExhibitingCombinationWith( "F" ) != 2 ) {
return false;
}
- if ( ssdsd5.getNumberOfProteinsExhibitingCombinationWith( new DomainId( "G" ) ) != 2 ) {
+ if ( ssdsd5.getNumberOfProteinsExhibitingCombinationWith( "G" ) != 2 ) {
return false;
}
- if ( ssdsd5.getNumberOfProteinsExhibitingCombinationWith( new DomainId( "X" ) ) != 3 ) {
+ if ( ssdsd5.getNumberOfProteinsExhibitingCombinationWith( "X" ) != 3 ) {
return false;
}
- if ( !sa5_d.getDomainId().getId().equals( "A" ) ) {
+ if ( !sa5_d.getDomainId().equals( "A" ) ) {
return false;
}
final Species ciona = new BasicSpecies( "ciona" );
if ( sa5_d.getCombinableDomainIds( ciona ).size() != 4 ) {
return false;
}
- if ( sa5_d.getCombinableDomainIds( ciona ).contains( new DomainId( "A" ) ) ) {
+ if ( sa5_d.getCombinableDomainIds( ciona ).contains( "A" ) ) {
return false;
}
- if ( !sa5_d.getCombinableDomainIds( ciona ).contains( new DomainId( "B" ) ) ) {
+ if ( !sa5_d.getCombinableDomainIds( ciona ).contains( "B" ) ) {
return false;
}
- if ( !sa5_d.getCombinableDomainIds( ciona ).contains( new DomainId( "F" ) ) ) {
+ if ( !sa5_d.getCombinableDomainIds( ciona ).contains( "F" ) ) {
return false;
}
- if ( !sa5_d.getCombinableDomainIds( ciona ).contains( new DomainId( "G" ) ) ) {
+ if ( !sa5_d.getCombinableDomainIds( ciona ).contains( "G" ) ) {
return false;
}
- if ( !sa5_d.getCombinableDomainIds( ciona ).contains( new DomainId( "X" ) ) ) {
+ if ( !sa5_d.getCombinableDomainIds( ciona ).contains( "X" ) ) {
return false;
}
if ( !TestSurfacing
true );
final Iterator<DomainSimilarity> sims_it5_p = sims5_p.iterator();
final DomainSimilarity sa5_p = sims_it5_p.next();
- if ( !sa5_p.getDomainId().getId().equals( "A" ) ) {
+ if ( !sa5_p.getDomainId().equals( "A" ) ) {
return false;
}
if ( sa5_p.getCombinableDomainIds( ciona ).size() != 4 ) {
return false;
}
- if ( sa5_p.getCombinableDomainIds( ciona ).contains( new DomainId( "A" ) ) ) {
+ if ( sa5_p.getCombinableDomainIds( ciona ).contains( "A" ) ) {
return false;
}
- if ( !sa5_p.getCombinableDomainIds( ciona ).contains( new DomainId( "B" ) ) ) {
+ if ( !sa5_p.getCombinableDomainIds( ciona ).contains( "B" ) ) {
return false;
}
- if ( !sa5_p.getCombinableDomainIds( ciona ).contains( new DomainId( "F" ) ) ) {
+ if ( !sa5_p.getCombinableDomainIds( ciona ).contains( "F" ) ) {
return false;
}
- if ( !sa5_p.getCombinableDomainIds( ciona ).contains( new DomainId( "G" ) ) ) {
+ if ( !sa5_p.getCombinableDomainIds( ciona ).contains( "G" ) ) {
return false;
}
- if ( !sa5_p.getCombinableDomainIds( ciona ).contains( new DomainId( "X" ) ) ) {
+ if ( !sa5_p.getCombinableDomainIds( ciona ).contains( "X" ) ) {
return false;
}
if ( !TestSurfacing
if ( ssdsd6.getCombinableDomainIdToCountsMap().size() != 5 ) {
return false;
}
- if ( ssdsd6.getNumberOfProteinsExhibitingCombinationWith( new DomainId( "B" ) ) != 2 ) {
+ if ( ssdsd6.getNumberOfProteinsExhibitingCombinationWith( "B" ) != 2 ) {
return false;
}
- if ( ssdsd6.getNumberOfProteinsExhibitingCombinationWith( new DomainId( "F" ) ) != 2 ) {
+ if ( ssdsd6.getNumberOfProteinsExhibitingCombinationWith( "F" ) != 2 ) {
return false;
}
- if ( ssdsd6.getNumberOfProteinsExhibitingCombinationWith( new DomainId( "G" ) ) != 2 ) {
+ if ( ssdsd6.getNumberOfProteinsExhibitingCombinationWith( "G" ) != 2 ) {
return false;
}
- if ( ssdsd6.getNumberOfProteinsExhibitingCombinationWith( new DomainId( "X" ) ) != 3 ) {
+ if ( ssdsd6.getNumberOfProteinsExhibitingCombinationWith( "X" ) != 3 ) {
return false;
}
- if ( !sa5_d.getDomainId().getId().equals( "A" ) ) {
+ if ( !sa5_d.getDomainId().equals( "A" ) ) {
return false;
}
final Species ciona6 = new BasicSpecies( "ciona" );
if ( sa6_d.getCombinableDomainIds( ciona6 ).size() != 5 ) {
return false;
}
- if ( !sa6_d.getCombinableDomainIds( ciona6 ).contains( new DomainId( "A" ) ) ) {
+ if ( !sa6_d.getCombinableDomainIds( ciona6 ).contains( "A" ) ) {
return false;
}
- if ( !sa6_d.getCombinableDomainIds( ciona6 ).contains( new DomainId( "B" ) ) ) {
+ if ( !sa6_d.getCombinableDomainIds( ciona6 ).contains( "B" ) ) {
return false;
}
- if ( !sa6_d.getCombinableDomainIds( ciona6 ).contains( new DomainId( "F" ) ) ) {
+ if ( !sa6_d.getCombinableDomainIds( ciona6 ).contains( "F" ) ) {
return false;
}
- if ( !sa6_d.getCombinableDomainIds( ciona6 ).contains( new DomainId( "G" ) ) ) {
+ if ( !sa6_d.getCombinableDomainIds( ciona6 ).contains( "G" ) ) {
return false;
}
- if ( !sa6_d.getCombinableDomainIds( ciona6 ).contains( new DomainId( "X" ) ) ) {
+ if ( !sa6_d.getCombinableDomainIds( ciona6 ).contains( "X" ) ) {
return false;
}
if ( !TestSurfacing
true );
final Iterator<DomainSimilarity> sims_it6_p = sims6_p.iterator();
final DomainSimilarity sa6_p = sims_it6_p.next();
- if ( !sa6_p.getDomainId().getId().equals( "A" ) ) {
+ if ( !sa6_p.getDomainId().equals( "A" ) ) {
return false;
}
if ( sa6_p.getCombinableDomainIds( ciona ).size() != 5 ) {
return false;
}
- if ( !sa6_p.getCombinableDomainIds( ciona ).contains( new DomainId( "A" ) ) ) {
+ if ( !sa6_p.getCombinableDomainIds( ciona ).contains( "A" ) ) {
return false;
}
- if ( !sa6_p.getCombinableDomainIds( ciona ).contains( new DomainId( "B" ) ) ) {
+ if ( !sa6_p.getCombinableDomainIds( ciona ).contains( "B" ) ) {
return false;
}
- if ( !sa6_p.getCombinableDomainIds( ciona ).contains( new DomainId( "F" ) ) ) {
+ if ( !sa6_p.getCombinableDomainIds( ciona ).contains( "F" ) ) {
return false;
}
- if ( !sa6_p.getCombinableDomainIds( ciona ).contains( new DomainId( "G" ) ) ) {
+ if ( !sa6_p.getCombinableDomainIds( ciona ).contains( "G" ) ) {
return false;
}
- if ( !sa6_p.getCombinableDomainIds( ciona ).contains( new DomainId( "X" ) ) ) {
+ if ( !sa6_p.getCombinableDomainIds( ciona ).contains( "X" ) ) {
return false;
}
if ( !TestSurfacing
false );
final Iterator<DomainSimilarity> sims_it = sims.iterator();
final DomainSimilarity sa = sims_it.next();
- if ( !sa.getDomainId().getId().equals( "A" ) ) {
+ if ( !sa.getDomainId().equals( "A" ) ) {
return false;
}
if ( sa.getSpeciesData().size() != 1 ) {
return false;
}
final DomainSimilarity sb = sims_it.next();
- if ( !sb.getDomainId().getId().equals( "B" ) ) {
+ if ( !sb.getDomainId().equals( "B" ) ) {
return false;
}
if ( sb.getSpeciesData().size() != 1 ) {
true );
final Iterator<DomainSimilarity> sims_it2 = sims2.iterator();
final DomainSimilarity sa2 = sims_it2.next();
- if ( !sa2.getDomainId().getId().equals( "D" ) ) {
+ if ( !sa2.getDomainId().equals( "D" ) ) {
return false;
}
if ( sa2.getSpeciesData().size() != 2 ) {
}
final Iterator<DomainSimilarity> sims_it = sims.iterator();
final DomainSimilarity sa = sims_it.next();
- if ( !sa.getDomainId().getId().equals( "A" ) ) {
+ if ( !sa.getDomainId().equals( "A" ) ) {
return false;
}
if ( sa.getSpeciesData().size() != 4 ) {
final SortedSet<BasicBinaryDomainCombination> sorted = new TreeSet<BasicBinaryDomainCombination>();
sorted.add( s0 );
sorted.add( s1 );
- sorted.add( s2 );
+ sorted.add( s2 );//
sorted.add( s3 );
- sorted.add( s3 );
- sorted.add( s3 );
- sorted.add( s4 );
+ sorted.add( s3 );//
+ sorted.add( s3 );//
+ sorted.add( s4 );//
sorted.add( s5 );
sorted.add( s6 );
sorted.add( s7 );
- sorted.add( s7 );
+ sorted.add( s7 );//
sorted.add( s8 );
- if ( sorted.size() != 6 ) {
+ if ( sorted.size() != 7 ) {
+ System.out.println( sorted.size() );
return false;
}
final DirectedBinaryDomainCombination aa = new DirectedBinaryDomainCombination( "a", "a" );
if ( !calc_i.getSharedDomains().contains( f.getDomainId() ) ) {
return false;
}
- final Set<DomainId> all = calc_ni.getAllDomains();
+ final Set<String> all = calc_ni.getAllDomains();
if ( !all.contains( a.getDomainId() ) ) {
return false;
}
}
calc_u.setAllowDomainsToBeIgnored( true );
calc_u.addDomainIdToIgnore( u.getDomainId() );
- calc_u.addDomainIdToIgnore( new DomainId( "other" ) );
- calc_u.addDomainIdToIgnore( new DomainId( "other_too" ) );
+ calc_u.addDomainIdToIgnore( "other" );
+ calc_u.addDomainIdToIgnore( "other_too" );
if ( calc_u.getAllDomains().size() != 5 ) {
return false;
}
//------------
calc_u.setAllowDomainsToBeIgnored( true );
calc_u.deleteAllDomainIdsToIgnore();
- calc_u.addDomainIdToIgnore( new DomainId( "v" ) );
- calc_u.addDomainIdToIgnore( new DomainId( "w" ) );
- calc_u.addDomainIdToIgnore( new DomainId( "other" ) );
- calc_u.addDomainIdToIgnore( new DomainId( "other_too" ) );
+ calc_u.addDomainIdToIgnore( "v" );
+ calc_u.addDomainIdToIgnore( "w" );
+ calc_u.addDomainIdToIgnore( "other" );
+ calc_u.addDomainIdToIgnore( "other_too" );
if ( calc_u.getAllDomains().size() != 4 ) {
return false;
}
final List<Protein> domain_collections = parser.parse();
final BasicGenomeWideCombinableDomains cdcc = BasicGenomeWideCombinableDomains
.createInstance( domain_collections, false, new BasicSpecies( "human" ) );
- CombinableDomains cd = cdcc.get( new DomainId( "A" ) );
+ CombinableDomains cd = cdcc.get( "A" );
if ( cd.getKeyDomainCount() != 9 ) {
return false;
}
if ( cd.getKeyDomainCount() != 9 ) {
return false;
}
- cd = cdcc.get( new DomainId( "B" ) );
+ cd = cdcc.get( "B" );
if ( cd.getKeyDomainCount() != 12 ) {
return false;
}
if ( cd.getKeyDomainCount() != 12 ) {
return false;
}
- cd = cdcc.get( new DomainId( "C" ) );
+ cd = cdcc.get( "C" );
if ( cd.getKeyDomainCount() != 10 ) {
return false;
}
if ( cd.getNumberOfProteinsExhibitingCombination( new SimpleDomain( "NN" ).getDomainId() ) != 0 ) {
return false;
}
- cd = cdcc.get( new DomainId( "D" ) );
+ cd = cdcc.get( "D" );
if ( cd.getKeyDomainCount() != 15 ) {
return false;
}
if ( cd.getNumberOfCombinableDomains() != 11 ) {
return false;
}
- cd = cdcc.get( new DomainId( "E" ) );
+ cd = cdcc.get( "E" );
if ( cd.getNumberOfCombinableDomains() != 10 ) {
return false;
}
if ( cd.getKeyDomainProteinsCount() != 1 ) {
return false;
}
- cd = cdcc.get( new DomainId( "U" ) );
+ cd = cdcc.get( "U" );
if ( cd.getNumberOfCombinableDomains() != 11 ) {
return false;
}
if ( cd.getKeyDomainProteinsCount() != 3 ) {
return false;
}
- cd = cdcc.get( new DomainId( "V" ) );
+ cd = cdcc.get( "V" );
if ( cd.getNumberOfCombinableDomains() != 11 ) {
return false;
}
if ( cd.getKeyDomainProteinsCount() != 2 ) {
return false;
}
- cd = cdcc.get( new DomainId( "W" ) );
+ cd = cdcc.get( "W" );
if ( cd.getNumberOfCombinableDomains() != 10 ) {
return false;
}
if ( cd.getKeyDomainProteinsCount() != 2 ) {
return false;
}
- cd = cdcc.get( new DomainId( "X" ) );
+ cd = cdcc.get( "X" );
if ( cd.getNumberOfCombinableDomains() != 10 ) {
return false;
}
if ( cd.getKeyDomainCount() != 2 ) {
return false;
}
- cd = cdcc.get( new DomainId( "Y" ) );
+ cd = cdcc.get( "Y" );
if ( cd.getNumberOfCombinableDomains() != 10 ) {
return false;
}
- cd = cdcc.get( new DomainId( "Z" ) );
+ cd = cdcc.get( "Z" );
if ( cd.getNumberOfCombinableDomains() != 10 ) {
return false;
}
- cd = cdcc.get( new DomainId( "NN" ) );
+ cd = cdcc.get( "NN" );
if ( cd.getKeyDomainCount() != 1 ) {
return false;
}
if ( cd.getNumberOfProteinsExhibitingCombination( new SimpleDomain( "NN" ).getDomainId() ) != 0 ) {
return false;
}
- cd = cdcc.get( new DomainId( "MM" ) );
+ cd = cdcc.get( "MM" );
if ( cd.getNumberOfCombinableDomains() != 1 ) {
return false;
}
if ( cd.getNumberOfProteinsExhibitingCombination( new SimpleDomain( "OO" ).getDomainId() ) != 1 ) {
return false;
}
- cd = cdcc.get( new DomainId( "OO" ) );
+ cd = cdcc.get( "OO" );
if ( cd.getNumberOfCombinableDomains() != 2 ) {
return false;
}
if ( cd.getNumberOfProteinsExhibitingCombination( new SimpleDomain( "MM" ).getDomainId() ) != 1 ) {
return false;
}
- cd = cdcc.get( new DomainId( "QQ" ) );
+ cd = cdcc.get( "QQ" );
if ( cd.getNumberOfCombinableDomains() != 1 ) {
return false;
}
if ( cd.getNumberOfProteinsExhibitingCombination( new SimpleDomain( "QQ" ).getDomainId() ) != 3 ) {
return false;
}
- cd = cdcc.get( new DomainId( "PP" ) );
+ cd = cdcc.get( "PP" );
if ( cd.getNumberOfCombinableDomains() != 0 ) {
return false;
}
if ( cd.getKeyDomainProteinsCount() != 2 ) {
return false;
}
- cd = cdcc.get( new DomainId( "singlet" ) );
+ cd = cdcc.get( "singlet" );
if ( cd.getKeyDomainCount() != 1 ) {
return false;
}
if ( cd.getNumberOfProteinsExhibitingCombination( new SimpleDomain( "singlet" ).getDomainId() ) != 0 ) {
return false;
}
- cd = cdcc.get( new DomainId( "three" ) );
+ cd = cdcc.get( "three" );
if ( cd.getKeyDomainCount() != 3 ) {
return false;
}
if ( cd.getNumberOfCombinableDomains() != 1 ) {
return false;
}
- if ( cd.getNumberOfProteinsExhibitingCombination( new DomainId( "three" ) ) != 1 ) {
+ if ( cd.getNumberOfProteinsExhibitingCombination( "three" ) != 1 ) {
return false;
}
- if ( cd.getNumberOfProteinsExhibitingCombination( new DomainId( "so_far_so_bad" ) ) != 0 ) {
+ if ( cd.getNumberOfProteinsExhibitingCombination( "so_far_so_bad" ) != 0 ) {
return false;
}
// Ignore combinations with same:
DomainCombinationType.BASIC,
null,
null );
- cd = cdcc2.get( new DomainId( "A" ) );
+ cd = cdcc2.get( "A" );
if ( cd.getKeyDomainCount() != 9 ) {
return false;
}
if ( cd.getNumberOfProteinsExhibitingCombination( new SimpleDomain( "E" ).getDomainId() ) != 1 ) {
return false;
}
- if ( cd.getNumberOfProteinsExhibitingCombination( new DomainId( "U" ) ) != 1 ) {
+ if ( cd.getNumberOfProteinsExhibitingCombination( "U" ) != 1 ) {
return false;
}
- if ( cd.getNumberOfProteinsExhibitingCombination( new DomainId( "V" ) ) != 1 ) {
+ if ( cd.getNumberOfProteinsExhibitingCombination( "V" ) != 1 ) {
return false;
}
- if ( cd.getNumberOfProteinsExhibitingCombination( new DomainId( "W" ) ) != 1 ) {
+ if ( cd.getNumberOfProteinsExhibitingCombination( "W" ) != 1 ) {
return false;
}
- if ( cd.getNumberOfProteinsExhibitingCombination( new DomainId( "X" ) ) != 1 ) {
+ if ( cd.getNumberOfProteinsExhibitingCombination( "X" ) != 1 ) {
return false;
}
- if ( cd.getNumberOfProteinsExhibitingCombination( new DomainId( "Y" ) ) != 1 ) {
+ if ( cd.getNumberOfProteinsExhibitingCombination( "Y" ) != 1 ) {
return false;
}
- if ( cd.getNumberOfProteinsExhibitingCombination( new DomainId( "Z" ) ) != 1 ) {
+ if ( cd.getNumberOfProteinsExhibitingCombination( "Z" ) != 1 ) {
return false;
}
- if ( cd.getNumberOfProteinsExhibitingCombination( new DomainId( "NN" ) ) != 0 ) {
+ if ( cd.getNumberOfProteinsExhibitingCombination( "NN" ) != 0 ) {
return false;
}
- cd = cdcc2.get( new DomainId( "B" ) );
+ cd = cdcc2.get( "B" );
if ( cd.getKeyDomainCount() != 12 ) {
return false;
}
if ( cd.getNumberOfCombinableDomains() != 10 ) {
return false;
}
- if ( cd.getNumberOfProteinsExhibitingCombination( new DomainId( "A" ) ) != 6 ) {
+ if ( cd.getNumberOfProteinsExhibitingCombination( "A" ) != 6 ) {
return false;
}
- if ( cd.getNumberOfProteinsExhibitingCombination( new DomainId( "B" ) ) != 0 ) {
+ if ( cd.getNumberOfProteinsExhibitingCombination( "B" ) != 0 ) {
return false;
}
- if ( cd.getNumberOfProteinsExhibitingCombination( new DomainId( "C" ) ) != 4 ) {
+ if ( cd.getNumberOfProteinsExhibitingCombination( "C" ) != 4 ) {
return false;
}
- if ( cd.getNumberOfProteinsExhibitingCombination( new DomainId( "D" ) ) != 3 ) {
+ if ( cd.getNumberOfProteinsExhibitingCombination( "D" ) != 3 ) {
return false;
}
- if ( cd.getNumberOfProteinsExhibitingCombination( new DomainId( "E" ) ) != 1 ) {
+ if ( cd.getNumberOfProteinsExhibitingCombination( "E" ) != 1 ) {
return false;
}
- if ( cd.getNumberOfProteinsExhibitingCombination( new DomainId( "U" ) ) != 1 ) {
+ if ( cd.getNumberOfProteinsExhibitingCombination( "U" ) != 1 ) {
return false;
}
- if ( cd.getNumberOfProteinsExhibitingCombination( new DomainId( "V" ) ) != 1 ) {
+ if ( cd.getNumberOfProteinsExhibitingCombination( "V" ) != 1 ) {
return false;
}
- if ( cd.getNumberOfProteinsExhibitingCombination( new DomainId( "W" ) ) != 1 ) {
+ if ( cd.getNumberOfProteinsExhibitingCombination( "W" ) != 1 ) {
return false;
}
- if ( cd.getNumberOfProteinsExhibitingCombination( new DomainId( "X" ) ) != 1 ) {
+ if ( cd.getNumberOfProteinsExhibitingCombination( "X" ) != 1 ) {
return false;
}
- if ( cd.getNumberOfProteinsExhibitingCombination( new DomainId( "Y" ) ) != 1 ) {
+ if ( cd.getNumberOfProteinsExhibitingCombination( "Y" ) != 1 ) {
return false;
}
- if ( cd.getNumberOfProteinsExhibitingCombination( new DomainId( "Z" ) ) != 1 ) {
+ if ( cd.getNumberOfProteinsExhibitingCombination( "Z" ) != 1 ) {
return false;
}
- if ( cd.getNumberOfProteinsExhibitingCombination( new DomainId( "NN" ) ) != 0 ) {
+ if ( cd.getNumberOfProteinsExhibitingCombination( "NN" ) != 0 ) {
return false;
}
- cd = cdcc2.get( new DomainId( "C" ) );
+ cd = cdcc2.get( "C" );
if ( cd.getKeyDomainCount() != 10 ) {
return false;
}
if ( cd.getNumberOfCombinableDomains() != 10 ) {
return false;
}
- if ( cd.getNumberOfProteinsExhibitingCombination( new DomainId( "A" ) ) != 4 ) {
+ if ( cd.getNumberOfProteinsExhibitingCombination( "A" ) != 4 ) {
return false;
}
- if ( cd.getNumberOfProteinsExhibitingCombination( new DomainId( "B" ) ) != 4 ) {
+ if ( cd.getNumberOfProteinsExhibitingCombination( "B" ) != 4 ) {
return false;
}
- if ( cd.getNumberOfProteinsExhibitingCombination( new DomainId( "C" ) ) != 0 ) {
+ if ( cd.getNumberOfProteinsExhibitingCombination( "C" ) != 0 ) {
return false;
}
- if ( cd.getNumberOfProteinsExhibitingCombination( new DomainId( "D" ) ) != 3 ) {
+ if ( cd.getNumberOfProteinsExhibitingCombination( "D" ) != 3 ) {
return false;
}
- if ( cd.getNumberOfProteinsExhibitingCombination( new DomainId( "E" ) ) != 1 ) {
+ if ( cd.getNumberOfProteinsExhibitingCombination( "E" ) != 1 ) {
return false;
}
- if ( cd.getNumberOfProteinsExhibitingCombination( new DomainId( "U" ) ) != 1 ) {
+ if ( cd.getNumberOfProteinsExhibitingCombination( "U" ) != 1 ) {
return false;
}
- if ( cd.getNumberOfProteinsExhibitingCombination( new DomainId( "V" ) ) != 1 ) {
+ if ( cd.getNumberOfProteinsExhibitingCombination( "V" ) != 1 ) {
return false;
}
- if ( cd.getNumberOfProteinsExhibitingCombination( new DomainId( "W" ) ) != 1 ) {
+ if ( cd.getNumberOfProteinsExhibitingCombination( "W" ) != 1 ) {
return false;
}
- if ( cd.getNumberOfProteinsExhibitingCombination( new DomainId( "X" ) ) != 2 ) {
+ if ( cd.getNumberOfProteinsExhibitingCombination( "X" ) != 2 ) {
return false;
}
- if ( cd.getNumberOfProteinsExhibitingCombination( new DomainId( "Y" ) ) != 2 ) {
+ if ( cd.getNumberOfProteinsExhibitingCombination( "Y" ) != 2 ) {
return false;
}
- if ( cd.getNumberOfProteinsExhibitingCombination( new DomainId( "Z" ) ) != 2 ) {
+ if ( cd.getNumberOfProteinsExhibitingCombination( "Z" ) != 2 ) {
return false;
}
- if ( cd.getNumberOfProteinsExhibitingCombination( new DomainId( "NN" ) ) != 0 ) {
+ if ( cd.getNumberOfProteinsExhibitingCombination( "NN" ) != 0 ) {
return false;
}
- cd = cdcc2.get( new DomainId( "D" ) );
+ cd = cdcc2.get( "D" );
if ( cd.getNumberOfCombinableDomains() != 10 ) {
return false;
}
- cd = cdcc2.get( new DomainId( "E" ) );
+ cd = cdcc2.get( "E" );
if ( cd.getNumberOfCombinableDomains() != 10 ) {
return false;
}
if ( cd.getKeyDomainCount() != 1 ) {
return false;
}
- cd = cdcc2.get( new DomainId( "U" ) );
+ cd = cdcc2.get( "U" );
if ( cd.getNumberOfCombinableDomains() != 10 ) {
return false;
}
- cd = cdcc2.get( new DomainId( "V" ) );
+ cd = cdcc2.get( "V" );
if ( cd.getNumberOfCombinableDomains() != 10 ) {
return false;
}
- cd = cdcc2.get( new DomainId( "W" ) );
+ cd = cdcc2.get( "W" );
if ( cd.getNumberOfCombinableDomains() != 10 ) {
return false;
}
- cd = cdcc2.get( new DomainId( "X" ) );
+ cd = cdcc2.get( "X" );
if ( cd.getNumberOfCombinableDomains() != 10 ) {
return false;
}
- cd = cdcc2.get( new DomainId( "Y" ) );
+ cd = cdcc2.get( "Y" );
if ( cd.getNumberOfCombinableDomains() != 10 ) {
return false;
}
- cd = cdcc2.get( new DomainId( "Z" ) );
+ cd = cdcc2.get( "Z" );
if ( cd.getNumberOfCombinableDomains() != 10 ) {
return false;
}
- cd = cdcc2.get( new DomainId( "NN" ) );
+ cd = cdcc2.get( "NN" );
if ( cd.getNumberOfCombinableDomains() != 0 ) {
return false;
}
- if ( cd.getNumberOfProteinsExhibitingCombination( new DomainId( "NN" ) ) != 0 ) {
+ if ( cd.getNumberOfProteinsExhibitingCombination( "NN" ) != 0 ) {
return false;
}
- cd = cdcc2.get( new DomainId( "MM" ) );
+ cd = cdcc2.get( "MM" );
if ( cd.getNumberOfCombinableDomains() != 1 ) {
return false;
}
- if ( cd.getNumberOfProteinsExhibitingCombination( new DomainId( "MM" ) ) != 0 ) {
+ if ( cd.getNumberOfProteinsExhibitingCombination( "MM" ) != 0 ) {
return false;
}
- if ( cd.getNumberOfProteinsExhibitingCombination( new DomainId( "OO" ) ) != 1 ) {
+ if ( cd.getNumberOfProteinsExhibitingCombination( "OO" ) != 1 ) {
return false;
}
- cd = cdcc2.get( new DomainId( "OO" ) );
+ cd = cdcc2.get( "OO" );
if ( cd.getNumberOfCombinableDomains() != 1 ) {
return false;
}
- if ( cd.getNumberOfProteinsExhibitingCombination( new DomainId( "OO" ) ) != 0 ) {
+ if ( cd.getNumberOfProteinsExhibitingCombination( "OO" ) != 0 ) {
return false;
}
- if ( cd.getNumberOfProteinsExhibitingCombination( new DomainId( "MM" ) ) != 1 ) {
+ if ( cd.getNumberOfProteinsExhibitingCombination( "MM" ) != 1 ) {
return false;
}
- cd = cdcc2.get( new DomainId( "QQ" ) );
+ cd = cdcc2.get( "QQ" );
if ( cd.getNumberOfCombinableDomains() != 0 ) {
return false;
}
- if ( cd.getNumberOfProteinsExhibitingCombination( new DomainId( "QQ" ) ) != 0 ) {
+ if ( cd.getNumberOfProteinsExhibitingCombination( "QQ" ) != 0 ) {
return false;
}
- cd = cdcc2.get( new DomainId( "singlet" ) );
+ cd = cdcc2.get( "singlet" );
if ( cd.getKeyDomainCount() != 1 ) {
return false;
}
if ( cd.getNumberOfCombinableDomains() != 0 ) {
return false;
}
- if ( cd.getNumberOfProteinsExhibitingCombination( new DomainId( "singlet" ) ) != 0 ) {
+ if ( cd.getNumberOfProteinsExhibitingCombination( "singlet" ) != 0 ) {
return false;
}
- cd = cdcc2.get( new DomainId( "three" ) );
+ cd = cdcc2.get( "three" );
if ( cd.getKeyDomainCount() != 3 ) {
return false;
}
if ( cd.getNumberOfCombinableDomains() != 0 ) {
return false;
}
- if ( cd.getNumberOfProteinsExhibitingCombination( new DomainId( "three" ) ) != 0 ) {
+ if ( cd.getNumberOfProteinsExhibitingCombination( "three" ) != 0 ) {
return false;
}
- if ( cd.getNumberOfProteinsExhibitingCombination( new DomainId( "so_far_so_bad" ) ) != 0 ) {
+ if ( cd.getNumberOfProteinsExhibitingCombination( "so_far_so_bad" ) != 0 ) {
return false;
}
}
if ( sorted.size() != 17 ) {
return false;
}
- if ( !sorted.get( 0 ).getDomainId().getId().equals( "A" ) ) {
+ if ( !sorted.get( 0 ).getDomainId().equals( "A" ) ) {
return false;
}
if ( sorted.get( 0 ).getNumber() != 1 ) {
return false;
}
- if ( !sorted.get( 1 ).getDomainId().getId().equals( "B" ) ) {
+ if ( !sorted.get( 1 ).getDomainId().equals( "B" ) ) {
return false;
}
if ( sorted.get( 1 ).getNumber() != 1 ) {
return false;
}
- if ( !sorted.get( 2 ).getDomainId().getId().equals( "C" ) ) {
+ if ( !sorted.get( 2 ).getDomainId().equals( "C" ) ) {
return false;
}
if ( sorted.get( 2 ).getNumber() != 1 ) {
return false;
}
- if ( !sorted.get( 3 ).getDomainId().getId().equals( "D" ) ) {
+ if ( !sorted.get( 3 ).getDomainId().equals( "D" ) ) {
return false;
}
if ( sorted.get( 3 ).getNumber() != 1 ) {
return false;
}
- if ( !sorted.get( 4 ).getDomainId().getId().equals( "E" ) ) {
+ if ( !sorted.get( 4 ).getDomainId().equals( "E" ) ) {
return false;
}
if ( sorted.get( 4 ).getNumber() != 1 ) {
return false;
}
- if ( !sorted.get( 5 ).getDomainId().getId().equals( "F" ) ) {
+ if ( !sorted.get( 5 ).getDomainId().equals( "F" ) ) {
return false;
}
if ( sorted.get( 5 ).getNumber() != 1 ) {
return false;
}
- if ( !sorted.get( 6 ).getDomainId().getId().equals( "G" ) ) {
+ if ( !sorted.get( 6 ).getDomainId().equals( "G" ) ) {
return false;
}
if ( sorted.get( 6 ).getNumber() != 1 ) {
return false;
}
- if ( !sorted.get( 7 ).getDomainId().getId().equals( "H" ) ) {
+ if ( !sorted.get( 7 ).getDomainId().equals( "H" ) ) {
return false;
}
if ( sorted.get( 7 ).getNumber() != 5 ) {
return false;
}
- if ( !sorted.get( 8 ).getDomainId().getId().equals( "H" ) ) {
+ if ( !sorted.get( 8 ).getDomainId().equals( "H" ) ) {
return false;
}
if ( sorted.get( 8 ).getNumber() != 2 ) {
return false;
}
- if ( !sorted.get( 9 ).getDomainId().getId().equals( "H" ) ) {
+ if ( !sorted.get( 9 ).getDomainId().equals( "H" ) ) {
return false;
}
if ( sorted.get( 9 ).getNumber() != 6 ) {
return false;
}
- if ( !sorted.get( 10 ).getDomainId().getId().equals( "H" ) ) {
+ if ( !sorted.get( 10 ).getDomainId().equals( "H" ) ) {
return false;
}
if ( sorted.get( 10 ).getNumber() != 4 ) {
return false;
}
- if ( !sorted.get( 11 ).getDomainId().getId().equals( "H" ) ) {
+ if ( !sorted.get( 11 ).getDomainId().equals( "H" ) ) {
return false;
}
if ( sorted.get( 11 ).getNumber() != 1 ) {
if ( sorted.get( 11 ).getTotalCount() != 5 ) {
return false;
}
- if ( !sorted.get( 12 ).getDomainId().getId().equals( "H" ) ) {
+ if ( !sorted.get( 12 ).getDomainId().equals( "H" ) ) {
return false;
}
if ( sorted.get( 12 ).getNumber() != 3 ) {
return false;
}
- if ( !sorted.get( 13 ).getDomainId().getId().equals( "H7" ) ) {
+ if ( !sorted.get( 13 ).getDomainId().equals( "H7" ) ) {
return false;
}
if ( sorted.get( 13 ).getNumber() != 5 ) {
return false;
}
- if ( !sorted.get( 14 ).getDomainId().getId().equals( "H7" ) ) {
+ if ( !sorted.get( 14 ).getDomainId().equals( "H7" ) ) {
return false;
}
if ( sorted.get( 14 ).getNumber() != 5 ) {
return false;
}
- if ( !sorted.get( 15 ).getDomainId().getId().equals( "H7" ) ) {
+ if ( !sorted.get( 15 ).getDomainId().equals( "H7" ) ) {
return false;
}
if ( sorted.get( 15 ).getNumber() != 5 ) {
}
// To check if sorting is stable [as claimed by Sun for
// Collections.sort( List )]
- if ( !sorted.get( 16 ).getDomainId().getId().equals( "H7" ) ) {
+ if ( !sorted.get( 16 ).getDomainId().equals( "H7" ) ) {
return false;
}
if ( sorted.get( 16 ).getNumber() != 5 ) {
if ( abc_r2.getNumberOfProteinDomains() != 2 ) {
return false;
}
- if ( !abc_r2.getProteinDomain( 0 ).getDomainId().getId().equals( "a" ) ) {
+ if ( !abc_r2.getProteinDomain( 0 ).getDomainId().equals( "a" ) ) {
return false;
}
- if ( !abc_r2.getProteinDomain( 1 ).getDomainId().getId().equals( "b" ) ) {
+ if ( !abc_r2.getProteinDomain( 1 ).getDomainId().equals( "b" ) ) {
return false;
}
final Domain d = new BasicDomain( "d", 0, 10, ( short ) 1, ( short ) 1, 0.1, 1 );
if ( def_r2.getNumberOfProteinDomains() != 3 ) {
return false;
}
- if ( !def_r2.getProteinDomain( 0 ).getDomainId().getId().equals( "d" ) ) {
+ if ( !def_r2.getProteinDomain( 0 ).getDomainId().equals( "d" ) ) {
return false;
}
- if ( !def_r2.getProteinDomain( 1 ).getDomainId().getId().equals( "f" ) ) {
+ if ( !def_r2.getProteinDomain( 1 ).getDomainId().equals( "f" ) ) {
return false;
}
- if ( !def_r2.getProteinDomain( 2 ).getDomainId().getId().equals( "e" ) ) {
+ if ( !def_r2.getProteinDomain( 2 ).getDomainId().equals( "e" ) ) {
return false;
}
}
.createInstance( protein_list_eel, false, new BasicSpecies( "eel" ) );
final BasicGenomeWideCombinableDomains eel_ignore = BasicGenomeWideCombinableDomains
.createInstance( protein_list_eel, true, new BasicSpecies( "eel" ) );
- if ( !eel_not_ignore.contains( new DomainId( "a" ) ) ) {
+ if ( !eel_not_ignore.contains( "a" ) ) {
return false;
}
- if ( !eel_not_ignore.contains( new DomainId( "b" ) ) ) {
+ if ( !eel_not_ignore.contains( "b" ) ) {
return false;
}
- if ( !eel_not_ignore.contains( new DomainId( "c" ) ) ) {
+ if ( !eel_not_ignore.contains( "c" ) ) {
return false;
}
- if ( !eel_not_ignore.contains( new DomainId( "d" ) ) ) {
+ if ( !eel_not_ignore.contains( "d" ) ) {
return false;
}
- if ( !eel_not_ignore.contains( new DomainId( "e" ) ) ) {
+ if ( !eel_not_ignore.contains( "e" ) ) {
return false;
}
- if ( !eel_not_ignore.contains( new DomainId( "f" ) ) ) {
+ if ( !eel_not_ignore.contains( "f" ) ) {
return false;
}
- if ( !eel_not_ignore.contains( new DomainId( "g" ) ) ) {
+ if ( !eel_not_ignore.contains( "g" ) ) {
return false;
}
- if ( !eel_not_ignore.contains( new DomainId( "h" ) ) ) {
+ if ( !eel_not_ignore.contains( "h" ) ) {
return false;
}
- if ( eel_not_ignore.contains( new DomainId( "x" ) ) ) {
+ if ( eel_not_ignore.contains( "x" ) ) {
return false;
}
- if ( !eel_ignore.contains( new DomainId( "a" ) ) ) {
+ if ( !eel_ignore.contains( "a" ) ) {
return false;
}
- if ( !eel_ignore.contains( new DomainId( "b" ) ) ) {
+ if ( !eel_ignore.contains( "b" ) ) {
return false;
}
- if ( !eel_ignore.contains( new DomainId( "c" ) ) ) {
+ if ( !eel_ignore.contains( "c" ) ) {
return false;
}
- if ( !eel_ignore.contains( new DomainId( "d" ) ) ) {
+ if ( !eel_ignore.contains( "d" ) ) {
return false;
}
- if ( !eel_ignore.contains( new DomainId( "e" ) ) ) {
+ if ( !eel_ignore.contains( "e" ) ) {
return false;
}
- if ( !eel_ignore.contains( new DomainId( "f" ) ) ) {
+ if ( !eel_ignore.contains( "f" ) ) {
return false;
}
- if ( !eel_ignore.contains( new DomainId( "g" ) ) ) {
+ if ( !eel_ignore.contains( "g" ) ) {
return false;
}
- if ( !eel_ignore.contains( new DomainId( "h" ) ) ) {
+ if ( !eel_ignore.contains( "h" ) ) {
return false;
}
- if ( eel_ignore.contains( new DomainId( "x" ) ) ) {
+ if ( eel_ignore.contains( "x" ) ) {
return false;
}
if ( eel_not_ignore.getSize() != 8 ) {
if ( eel_ignore.getSize() != 8 ) {
return false;
}
- if ( eel_not_ignore.get( new DomainId( "a" ) ).getCombinableDomainsIds().size() != 5 ) {
+ if ( eel_not_ignore.get( "a" ).getCombinableDomainsIds().size() != 5 ) {
return false;
}
- if ( eel_not_ignore.get( new DomainId( "b" ) ).getCombinableDomainsIds().size() != 4 ) {
+ if ( eel_not_ignore.get( "b" ).getCombinableDomainsIds().size() != 4 ) {
return false;
}
- if ( eel_not_ignore.get( new DomainId( "c" ) ).getCombinableDomainsIds().size() != 4 ) {
+ if ( eel_not_ignore.get( "c" ).getCombinableDomainsIds().size() != 4 ) {
return false;
}
- if ( eel_not_ignore.get( new DomainId( "d" ) ).getCombinableDomainsIds().size() != 4 ) {
+ if ( eel_not_ignore.get( "d" ).getCombinableDomainsIds().size() != 4 ) {
return false;
}
- if ( eel_not_ignore.get( new DomainId( "e" ) ).getCombinableDomainsIds().size() != 6 ) {
+ if ( eel_not_ignore.get( "e" ).getCombinableDomainsIds().size() != 6 ) {
return false;
}
- if ( eel_not_ignore.get( new DomainId( "f" ) ).getCombinableDomainsIds().size() != 2 ) {
+ if ( eel_not_ignore.get( "f" ).getCombinableDomainsIds().size() != 2 ) {
return false;
}
- if ( eel_not_ignore.get( new DomainId( "g" ) ).getCombinableDomainsIds().size() != 1 ) {
+ if ( eel_not_ignore.get( "g" ).getCombinableDomainsIds().size() != 1 ) {
return false;
}
- if ( eel_not_ignore.get( new DomainId( "h" ) ).getCombinableDomainsIds().size() != 1 ) {
+ if ( eel_not_ignore.get( "h" ).getCombinableDomainsIds().size() != 1 ) {
return false;
}
- if ( eel_ignore.get( new DomainId( "a" ) ).getCombinableDomainsIds().size() != 4 ) {
+ if ( eel_ignore.get( "a" ).getCombinableDomainsIds().size() != 4 ) {
return false;
}
- if ( eel_ignore.get( new DomainId( "b" ) ).getCombinableDomainsIds().size() != 4 ) {
+ if ( eel_ignore.get( "b" ).getCombinableDomainsIds().size() != 4 ) {
return false;
}
- if ( eel_ignore.get( new DomainId( "c" ) ).getCombinableDomainsIds().size() != 4 ) {
+ if ( eel_ignore.get( "c" ).getCombinableDomainsIds().size() != 4 ) {
return false;
}
- if ( eel_ignore.get( new DomainId( "d" ) ).getCombinableDomainsIds().size() != 4 ) {
+ if ( eel_ignore.get( "d" ).getCombinableDomainsIds().size() != 4 ) {
return false;
}
- if ( eel_ignore.get( new DomainId( "e" ) ).getCombinableDomainsIds().size() != 5 ) {
+ if ( eel_ignore.get( "e" ).getCombinableDomainsIds().size() != 5 ) {
return false;
}
- if ( eel_ignore.get( new DomainId( "f" ) ).getCombinableDomainsIds().size() != 1 ) {
+ if ( eel_ignore.get( "f" ).getCombinableDomainsIds().size() != 1 ) {
return false;
}
- if ( eel_ignore.get( new DomainId( "g" ) ).getCombinableDomainsIds().size() != 1 ) {
+ if ( eel_ignore.get( "g" ).getCombinableDomainsIds().size() != 1 ) {
return false;
}
- if ( eel_ignore.get( new DomainId( "h" ) ).getCombinableDomainsIds().size() != 1 ) {
+ if ( eel_ignore.get( "h" ).getCombinableDomainsIds().size() != 1 ) {
return false;
}
if ( eel_not_ignore.getAllDomainIds().size() != 8 ) {
.equals( "pep:known chromosome:NCBI36:21:16024215:16174248:1 gene:ENSG00000155313 transcript:ENST00000285681" ) ) {
return false;
}
- final List<Domain> uba = pdc.getProteinDomains( new DomainId( "UBA" ) );
- final List<Domain> uim = pdc.getProteinDomains( new DomainId( "UIM" ) );
- final List<Domain> uch = pdc.getProteinDomains( new DomainId( "UCH" ) );
+ final List<Domain> uba = pdc.getProteinDomains( "UBA" );
+ final List<Domain> uim = pdc.getProteinDomains( "UIM" );
+ final List<Domain> uch = pdc.getProteinDomains( "UCH" );
if ( uba.size() != 1 ) {
return false;
}
return false;
}
final BasicDomain uim_domain = ( BasicDomain ) uim.get( 1 );
- if ( !uim_domain.getDomainId().equals( new DomainId( "UIM" ) ) ) {
+ if ( !uim_domain.getDomainId().equals( "UIM" ) ) {
return false;
}
if ( uim_domain.getTotalCount() != 2 ) {
return false;
}
final BasicDomain uba_domain = ( BasicDomain ) uba.get( 0 );
- if ( !uba_domain.getDomainId().equals( new DomainId( "UBA" ) ) ) {
+ if ( !uba_domain.getDomainId().equals( "UBA" ) ) {
return false;
}
if ( uba_domain.getNumber() != 1 ) {
if ( pdc2.getNumberOfProteinDomains() != 3 ) {
return false;
}
- final List<Domain> uba2 = pdc2.getProteinDomains( new DomainId( "UBA" ) );
- final List<Domain> uim2 = pdc2.getProteinDomains( new DomainId( "UIM" ) );
- final List<Domain> uch2 = pdc2.getProteinDomains( new DomainId( "UCH" ) );
+ final List<Domain> uba2 = pdc2.getProteinDomains( "UBA" );
+ final List<Domain> uim2 = pdc2.getProteinDomains( "UIM" );
+ final List<Domain> uch2 = pdc2.getProteinDomains( "UCH" );
if ( uba2.size() != 1 ) {
return false;
}
return false;
}
final BasicDomain uim_domain2 = ( BasicDomain ) uim2.get( 1 );
- if ( !uim_domain2.getDomainId().getId().equals( "UIM" ) ) {
+ if ( !uim_domain2.getDomainId().equals( "UIM" ) ) {
return false;
}
if ( uim_domain2.getTotalCount() != 2 ) {
return false;
}
final BasicDomain uba_domain2 = ( BasicDomain ) uba2.get( 0 );
- if ( !uba_domain2.getDomainId().getId().equals( "UBA" ) ) {
+ if ( !uba_domain2.getDomainId().equals( "UBA" ) ) {
return false;
}
if ( uba_domain2.getNumber() != 1 ) {
return false;
}
//
- Set<DomainId> filter = new TreeSet<DomainId>();
- filter.add( new DomainId( "beauty" ) );
- filter.add( new DomainId( "strange" ) );
+ Set<String> filter = new TreeSet<String>();
+ filter.add( "beauty" );
+ filter.add( "strange" );
parser = new HmmPfamOutputParser( new File( test_dir + ForesterUtil.getFileSeparator() + "hmmpfam_output3" ),
"human",
"ls",
return false;
}
//
- filter = new TreeSet<DomainId>();
- filter.add( new DomainId( "beauty" ) );
- filter.add( new DomainId( "strange" ) );
+ filter = new TreeSet<String>();
+ filter.add( "beauty" );
+ filter.add( "strange" );
parser = new HmmPfamOutputParser( new File( test_dir + ForesterUtil.getFileSeparator() + "hmmpfam_output3" ),
"human",
"ls",
return false;
}
//
- filter = new TreeSet<DomainId>();
- filter.add( new DomainId( "UIM" ) );
- filter.add( new DomainId( "A" ) );
- filter.add( new DomainId( "C" ) );
+ filter = new TreeSet<String>();
+ filter.add( "UIM" );
+ filter.add( "A" );
+ filter.add( "C" );
parser = new HmmPfamOutputParser( new File( test_dir + ForesterUtil.getFileSeparator() + "hmmpfam_output3" ),
"human",
"ls",
return false;
}
//
- filter = new TreeSet<DomainId>();
- filter.add( new DomainId( "UIM" ) );
- filter.add( new DomainId( "A" ) );
- filter.add( new DomainId( "C" ) );
- filter.add( new DomainId( "X" ) );
+ filter = new TreeSet<String>();
+ filter.add( "UIM" );
+ filter.add( "A" );
+ filter.add( "C" );
+ filter.add( "X" );
parser = new HmmPfamOutputParser( new File( test_dir + ForesterUtil.getFileSeparator() + "hmmpfam_output3" ),
"human",
"ls",
return false;
}
//
- filter = new TreeSet<DomainId>();
- filter.add( new DomainId( "UIM" ) );
- filter.add( new DomainId( "A" ) );
- filter.add( new DomainId( "C" ) );
+ filter = new TreeSet<String>();
+ filter.add( "UIM" );
+ filter.add( "A" );
+ filter.add( "C" );
parser = new HmmPfamOutputParser( new File( test_dir + ForesterUtil.getFileSeparator() + "hmmpfam_output3" ),
"human",
"ls",
return false;
}
//
- filter = new TreeSet<DomainId>();
- filter.add( new DomainId( "UIM" ) );
+ filter = new TreeSet<String>();
+ filter.add( "UIM" );
parser = new HmmPfamOutputParser( new File( test_dir + ForesterUtil.getFileSeparator() + "hmmpfam_output3" ),
"human",
"ls",
return false;
}
//
- filter = new TreeSet<DomainId>();
- filter.add( new DomainId( "UIM" ) );
+ filter = new TreeSet<String>();
+ filter.add( "UIM" );
parser = new HmmPfamOutputParser( new File( test_dir + ForesterUtil.getFileSeparator() + "hmmpfam_output3" ),
"human",
"ls",
return false;
}
//
- filter = new TreeSet<DomainId>();
- filter.add( new DomainId( "A" ) );
- filter.add( new DomainId( "C" ) );
+ filter = new TreeSet<String>();
+ filter.add( "A" );
+ filter.add( "C" );
parser = new HmmPfamOutputParser( new File( test_dir + ForesterUtil.getFileSeparator() + "hmmpfam_output3" ),
"human",
"ls",
if ( ab_s0.getNumberOfProteinDomains() != 1 ) {
return false;
}
- if ( !ab_s0.getProteinDomain( 0 ).getDomainId().getId().equals( "a" ) ) {
+ if ( !ab_s0.getProteinDomain( 0 ).getDomainId().equals( "a" ) ) {
return false;
}
final Protein ab_s1 = SurfacingUtil.removeOverlappingDomains( 4, false, ab );
if ( fghi_s0.getNumberOfProteinDomains() != 1 ) {
return false;
}
- if ( !fghi_s0.getProteinDomain( 0 ).getDomainId().getId().equals( "h" ) ) {
+ if ( !fghi_s0.getProteinDomain( 0 ).getDomainId().equals( "h" ) ) {
return false;
}
final Protein fghi_s1 = SurfacingUtil.removeOverlappingDomains( 11, false, fghi );
if ( jklm_s0.getNumberOfProteinDomains() != 1 ) {
return false;
}
- if ( !jklm_s0.getProteinDomain( 0 ).getDomainId().getId().equals( "l" ) ) {
+ if ( !jklm_s0.getProteinDomain( 0 ).getDomainId().equals( "l" ) ) {
return false;
}
final Protein jklm_s1 = SurfacingUtil.removeOverlappingDomains( 11, false, jklm );
gwcd_list.add( two );
gwcd_list.add( three );
gwcd_list.add( four );
- final Map<DomainId, Set<String>> map_same = new HashMap<DomainId, Set<String>>();
+ final Map<String, Set<String>> map_same = new HashMap<String, Set<String>>();
final HashSet<String> a_s = new HashSet<String>();
a_s.add( "AAA" );
final HashSet<String> b_s = new HashSet<String>();
import org.forester.protein.BasicDomain;
import org.forester.protein.BasicProtein;
import org.forester.protein.Domain;
-import org.forester.protein.DomainId;
import org.forester.protein.Protein;
import org.forester.protein.ProteinId;
import org.forester.rio.TestRIO;
System.exit( -1 );
}
final long start_time = new Date().getTime();
- System.out.print( "Domain id: " );
- if ( !testDomainId() ) {
- System.out.println( "failed." );
- failed++;
- }
- else {
- succeeded++;
- }
- System.out.println( "OK." );
System.out.print( "Protein id: " );
if ( !testProteinId() ) {
System.out.println( "failed." );
private static boolean testBasicDomain() {
try {
final Domain pd = new BasicDomain( "id", 23, 25, ( short ) 1, ( short ) 4, 0.1, -12 );
- if ( !pd.getDomainId().getId().equals( "id" ) ) {
+ if ( !pd.getDomainId().equals( "id" ) ) {
return false;
}
if ( pd.getNumber() != 1 ) {
if ( a1.compareTo( a2 ) != 0 ) {
return false;
}
- if ( a1.compareTo( a3 ) != 0 ) {
+ if ( a1.compareTo( a3 ) == 0 ) {
return false;
}
}
p.addProteinDomain( A20 );
p.addProteinDomain( B25 );
p.addProteinDomain( D80 );
- List<DomainId> domains_ids = new ArrayList<DomainId>();
- domains_ids.add( new DomainId( "A" ) );
- domains_ids.add( new DomainId( "B" ) );
- domains_ids.add( new DomainId( "C" ) );
+ List<String> domains_ids = new ArrayList<String>();
+ domains_ids.add( "A" );
+ domains_ids.add( "B" );
+ domains_ids.add( "C" );
if ( !p.contains( domains_ids, false ) ) {
return false;
}
if ( !p.contains( domains_ids, true ) ) {
return false;
}
- domains_ids.add( new DomainId( "X" ) );
+ domains_ids.add( "X" );
if ( p.contains( domains_ids, false ) ) {
return false;
}
if ( p.contains( domains_ids, true ) ) {
return false;
}
- domains_ids = new ArrayList<DomainId>();
- domains_ids.add( new DomainId( "A" ) );
- domains_ids.add( new DomainId( "C" ) );
- domains_ids.add( new DomainId( "D" ) );
+ domains_ids = new ArrayList<String>();
+ domains_ids.add( "A" );
+ domains_ids.add( "C" );
+ domains_ids.add( "D" );
if ( !p.contains( domains_ids, false ) ) {
return false;
}
if ( !p.contains( domains_ids, true ) ) {
return false;
}
- domains_ids = new ArrayList<DomainId>();
- domains_ids.add( new DomainId( "A" ) );
- domains_ids.add( new DomainId( "D" ) );
- domains_ids.add( new DomainId( "C" ) );
+ domains_ids = new ArrayList<String>();
+ domains_ids.add( "A" );
+ domains_ids.add( "D" );
+ domains_ids.add( "C" );
if ( !p.contains( domains_ids, false ) ) {
return false;
}
if ( p.contains( domains_ids, true ) ) {
return false;
}
- domains_ids = new ArrayList<DomainId>();
- domains_ids.add( new DomainId( "A" ) );
- domains_ids.add( new DomainId( "A" ) );
- domains_ids.add( new DomainId( "B" ) );
- if ( !p.contains( domains_ids, false ) ) {
- return false;
- }
- if ( !p.contains( domains_ids, true ) ) {
- return false;
- }
- domains_ids = new ArrayList<DomainId>();
- domains_ids.add( new DomainId( "A" ) );
- domains_ids.add( new DomainId( "A" ) );
- domains_ids.add( new DomainId( "A" ) );
- domains_ids.add( new DomainId( "B" ) );
- domains_ids.add( new DomainId( "B" ) );
- if ( !p.contains( domains_ids, false ) ) {
- return false;
- }
- if ( !p.contains( domains_ids, true ) ) {
- return false;
- }
- domains_ids = new ArrayList<DomainId>();
- domains_ids.add( new DomainId( "A" ) );
- domains_ids.add( new DomainId( "A" ) );
- domains_ids.add( new DomainId( "A" ) );
- domains_ids.add( new DomainId( "A" ) );
- domains_ids.add( new DomainId( "B" ) );
- domains_ids.add( new DomainId( "B" ) );
+ domains_ids = new ArrayList<String>();
+ domains_ids.add( "A" );
+ domains_ids.add( "A" );
+ domains_ids.add( "B" );
if ( !p.contains( domains_ids, false ) ) {
return false;
}
if ( !p.contains( domains_ids, true ) ) {
return false;
}
- domains_ids = new ArrayList<DomainId>();
- domains_ids.add( new DomainId( "A" ) );
- domains_ids.add( new DomainId( "A" ) );
- domains_ids.add( new DomainId( "A" ) );
- domains_ids.add( new DomainId( "A" ) );
- domains_ids.add( new DomainId( "A" ) );
- domains_ids.add( new DomainId( "B" ) );
- domains_ids.add( new DomainId( "B" ) );
- if ( !p.contains( domains_ids, false ) ) {
- return false;
- }
- if ( p.contains( domains_ids, true ) ) {
- return false;
- }
- domains_ids = new ArrayList<DomainId>();
- domains_ids.add( new DomainId( "A" ) );
- domains_ids.add( new DomainId( "A" ) );
- domains_ids.add( new DomainId( "B" ) );
- domains_ids.add( new DomainId( "A" ) );
- domains_ids.add( new DomainId( "B" ) );
- domains_ids.add( new DomainId( "A" ) );
- domains_ids.add( new DomainId( "B" ) );
- domains_ids.add( new DomainId( "B" ) );
- domains_ids.add( new DomainId( "C" ) );
- domains_ids.add( new DomainId( "A" ) );
- domains_ids.add( new DomainId( "C" ) );
- domains_ids.add( new DomainId( "D" ) );
+ domains_ids = new ArrayList<String>();
+ domains_ids.add( "A" );
+ domains_ids.add( "A" );
+ domains_ids.add( "A" );
+ domains_ids.add( "B" );
+ domains_ids.add( "B" );
if ( !p.contains( domains_ids, false ) ) {
return false;
}
if ( !p.contains( domains_ids, true ) ) {
return false;
}
- domains_ids = new ArrayList<DomainId>();
- domains_ids.add( new DomainId( "A" ) );
- domains_ids.add( new DomainId( "B" ) );
- domains_ids.add( new DomainId( "A" ) );
- domains_ids.add( new DomainId( "B" ) );
- domains_ids.add( new DomainId( "A" ) );
- domains_ids.add( new DomainId( "B" ) );
- domains_ids.add( new DomainId( "B" ) );
- domains_ids.add( new DomainId( "A" ) );
- domains_ids.add( new DomainId( "C" ) );
- domains_ids.add( new DomainId( "D" ) );
- if ( !p.contains( domains_ids, false ) ) {
- return false;
- }
- if ( !p.contains( domains_ids, true ) ) {
- return false;
- }
- domains_ids = new ArrayList<DomainId>();
- domains_ids.add( new DomainId( "A" ) );
- domains_ids.add( new DomainId( "A" ) );
- domains_ids.add( new DomainId( "B" ) );
- domains_ids.add( new DomainId( "A" ) );
- domains_ids.add( new DomainId( "B" ) );
- domains_ids.add( new DomainId( "A" ) );
- domains_ids.add( new DomainId( "B" ) );
- domains_ids.add( new DomainId( "B" ) );
- domains_ids.add( new DomainId( "C" ) );
- domains_ids.add( new DomainId( "C" ) );
- domains_ids.add( new DomainId( "A" ) );
- domains_ids.add( new DomainId( "C" ) );
- domains_ids.add( new DomainId( "D" ) );
- if ( !p.contains( domains_ids, false ) ) {
- return false;
- }
- if ( p.contains( domains_ids, true ) ) {
- return false;
- }
- domains_ids = new ArrayList<DomainId>();
- domains_ids.add( new DomainId( "A" ) );
- domains_ids.add( new DomainId( "A" ) );
- domains_ids.add( new DomainId( "A" ) );
- domains_ids.add( new DomainId( "B" ) );
- domains_ids.add( new DomainId( "A" ) );
- domains_ids.add( new DomainId( "B" ) );
- domains_ids.add( new DomainId( "A" ) );
- domains_ids.add( new DomainId( "B" ) );
- domains_ids.add( new DomainId( "B" ) );
- domains_ids.add( new DomainId( "C" ) );
- domains_ids.add( new DomainId( "A" ) );
- domains_ids.add( new DomainId( "C" ) );
- domains_ids.add( new DomainId( "D" ) );
- if ( !p.contains( domains_ids, false ) ) {
- return false;
- }
- if ( p.contains( domains_ids, true ) ) {
- return false;
- }
- domains_ids = new ArrayList<DomainId>();
- domains_ids.add( new DomainId( "A" ) );
- domains_ids.add( new DomainId( "A" ) );
- domains_ids.add( new DomainId( "B" ) );
- domains_ids.add( new DomainId( "A" ) );
- domains_ids.add( new DomainId( "B" ) );
- domains_ids.add( new DomainId( "A" ) );
- domains_ids.add( new DomainId( "B" ) );
- domains_ids.add( new DomainId( "B" ) );
- domains_ids.add( new DomainId( "A" ) );
- domains_ids.add( new DomainId( "D" ) );
- if ( !p.contains( domains_ids, false ) ) {
- return false;
- }
- if ( !p.contains( domains_ids, true ) ) {
- return false;
- }
- domains_ids = new ArrayList<DomainId>();
- domains_ids.add( new DomainId( "A" ) );
- domains_ids.add( new DomainId( "A" ) );
- domains_ids.add( new DomainId( "B" ) );
- domains_ids.add( new DomainId( "A" ) );
- domains_ids.add( new DomainId( "B" ) );
- domains_ids.add( new DomainId( "A" ) );
- domains_ids.add( new DomainId( "B" ) );
- domains_ids.add( new DomainId( "B" ) );
- domains_ids.add( new DomainId( "C" ) );
- domains_ids.add( new DomainId( "A" ) );
- domains_ids.add( new DomainId( "C" ) );
- domains_ids.add( new DomainId( "D" ) );
- domains_ids.add( new DomainId( "X" ) );
- if ( p.contains( domains_ids, false ) ) {
- return false;
- }
- if ( p.contains( domains_ids, true ) ) {
- return false;
- }
- domains_ids = new ArrayList<DomainId>();
- domains_ids.add( new DomainId( "X" ) );
- domains_ids.add( new DomainId( "A" ) );
- domains_ids.add( new DomainId( "A" ) );
- domains_ids.add( new DomainId( "B" ) );
- domains_ids.add( new DomainId( "A" ) );
- domains_ids.add( new DomainId( "B" ) );
- domains_ids.add( new DomainId( "A" ) );
- domains_ids.add( new DomainId( "B" ) );
- domains_ids.add( new DomainId( "B" ) );
- domains_ids.add( new DomainId( "C" ) );
- domains_ids.add( new DomainId( "A" ) );
- domains_ids.add( new DomainId( "C" ) );
- domains_ids.add( new DomainId( "D" ) );
- if ( p.contains( domains_ids, false ) ) {
- return false;
- }
- if ( p.contains( domains_ids, true ) ) {
- return false;
- }
- domains_ids = new ArrayList<DomainId>();
- domains_ids.add( new DomainId( "A" ) );
- domains_ids.add( new DomainId( "A" ) );
- domains_ids.add( new DomainId( "B" ) );
- domains_ids.add( new DomainId( "A" ) );
- domains_ids.add( new DomainId( "B" ) );
- domains_ids.add( new DomainId( "B" ) );
- domains_ids.add( new DomainId( "A" ) );
- domains_ids.add( new DomainId( "B" ) );
- domains_ids.add( new DomainId( "C" ) );
- domains_ids.add( new DomainId( "A" ) );
- domains_ids.add( new DomainId( "C" ) );
- domains_ids.add( new DomainId( "D" ) );
+ domains_ids = new ArrayList<String>();
+ domains_ids.add( "A" );
+ domains_ids.add( "A" );
+ domains_ids.add( "B" );
+ domains_ids.add( "A" );
+ domains_ids.add( "B" );
+ domains_ids.add( "B" );
+ domains_ids.add( "A" );
+ domains_ids.add( "B" );
+ domains_ids.add( "C" );
+ domains_ids.add( "A" );
+ domains_ids.add( "C" );
+ domains_ids.add( "D" );
if ( !p.contains( domains_ids, false ) ) {
return false;
}
return true;
}
- private static boolean testDomainId() {
- try {
- final DomainId id1 = new DomainId( "a" );
- final DomainId id2 = new DomainId( "a" );
- final DomainId id3 = new DomainId( "A" );
- final DomainId id4 = new DomainId( "b" );
- if ( !id1.equals( id1 ) ) {
- return false;
- }
- if ( id1.getId().equals( "x" ) ) {
- return false;
- }
- if ( id1.getId().equals( null ) ) {
- return false;
- }
- if ( !id1.equals( id2 ) ) {
- return false;
- }
- if ( id1.equals( id3 ) ) {
- return false;
- }
- if ( id1.hashCode() != id1.hashCode() ) {
- return false;
- }
- if ( id1.hashCode() != id2.hashCode() ) {
- return false;
- }
- if ( id1.hashCode() == id3.hashCode() ) {
- return false;
- }
- if ( id1.compareTo( id1 ) != 0 ) {
- return false;
- }
- if ( id1.compareTo( id2 ) != 0 ) {
- return false;
- }
- if ( id1.compareTo( id3 ) != 0 ) {
- return false;
- }
- if ( id1.compareTo( id4 ) >= 0 ) {
- return false;
- }
- if ( id4.compareTo( id1 ) <= 0 ) {
- return false;
- }
- if ( !id4.getId().equals( "b" ) ) {
- return false;
- }
- final DomainId id5 = new DomainId( " C " );
- if ( !id5.getId().equals( "C" ) ) {
- return false;
- }
- if ( id5.equals( id1 ) ) {
- return false;
- }
- }
- catch ( final Exception e ) {
- e.printStackTrace( System.out );
- return false;
- }
- return true;
- }
-
private static boolean testEmblEntryRetrieval() {
//The format for GenBank Accession numbers are:
//Nucleotide: 1 letter + 5 numerals OR 2 letters + 6 numerals