// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
//
// Contact: phylosoft @ gmail . com
-// WWW: www.phylosoft.org/forester
+// WWW: https://sites.google.com/site/cmzmasek/home/software/forester
package org.forester.surfacing;
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;
return ( ( Math.abs( a - b ) ) < TestSurfacing.ZERO_DIFF );
}
- private static StringBuffer mapToStringBuffer( final Map<PhylogenyNode, CharacterStateMatrix.BinaryStates> map ) {
- final StringBuffer sb = new StringBuffer();
- for( final PhylogenyNode key : map.keySet() ) {
- if ( !key.isExternal() ) {
- sb.append( key.getName() );
- sb.append( " : " );
- sb.append( map.get( key ).toString() );
- sb.append( ForesterUtil.getLineSeparator() );
- }
- }
- return sb;
- }
-
public static boolean test( final File test_dir ) {
- System.out.print( " Domain id: " );
- if ( !TestSurfacing.testDomainId() ) {
- System.out.println( "failed." );
- return false;
- }
- System.out.println( "OK." );
- System.out.print( " Protein id: " );
- if ( !TestSurfacing.testProteinId() ) {
- System.out.println( "failed." );
- return false;
- }
- System.out.println( "OK." );
- System.out.print( " Species: " );
- if ( !TestSurfacing.testSpecies() ) {
- System.out.println( "failed." );
- return false;
- }
- System.out.println( "OK." );
- System.out.print( " Basic domain: " );
- if ( !TestSurfacing.testBasicDomain() ) {
- System.out.println( "failed." );
- return false;
- }
- System.out.println( "OK." );
- System.out.print( " Basic protein: " );
- if ( !TestSurfacing.testBasicProtein() ) {
- System.out.println( "failed." );
- return false;
- }
- System.out.println( "OK." );
System.out.print( " Combinable domains: " );
if ( !TestSurfacing.testCombinableDomains() ) {
System.out.println( "failed." );
return true;
}
- 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" ) ) {
- return false;
- }
- if ( pd.getNumber() != 1 ) {
- return false;
- }
- if ( pd.getTotalCount() != 4 ) {
- return false;
- }
- if ( !pd.equals( new BasicDomain( "id", 22, 111, ( short ) 1, ( short ) 4, 0.2, -12 ) ) ) {
- return false;
- }
- final Domain a1 = new BasicDomain( "a", 1, 10, ( short ) 1, ( short ) 4, 0.1, -12 );
- final BasicDomain a1_copy = new BasicDomain( "a", 1, 10, ( short ) 1, ( short ) 4, 0.1, -12 );
- final BasicDomain a1_equal = new BasicDomain( "a", 524, 743994, ( short ) 1, ( short ) 300, 3.0005, 230 );
- final BasicDomain a2 = new BasicDomain( "a", 1, 10, ( short ) 2, ( short ) 4, 0.1, -12 );
- final BasicDomain a3 = new BasicDomain( "A", 1, 10, ( short ) 1, ( short ) 4, 0.1, -12 );
- if ( !a1.equals( a1 ) ) {
- return false;
- }
- if ( !a1.equals( a1_copy ) ) {
- return false;
- }
- if ( !a1.equals( a1_equal ) ) {
- return false;
- }
- if ( !a1.equals( a2 ) ) {
- return false;
- }
- if ( a1.equals( a3 ) ) {
- return false;
- }
- if ( a1.compareTo( a1 ) != 0 ) {
- return false;
- }
- if ( a1.compareTo( a1_copy ) != 0 ) {
- return false;
- }
- if ( a1.compareTo( a1_equal ) != 0 ) {
- return false;
- }
- if ( a1.compareTo( a2 ) != 0 ) {
- return false;
- }
- if ( a1.compareTo( a3 ) != 0 ) {
- return false;
+ private static StringBuffer mapToStringBuffer( final Map<PhylogenyNode, CharacterStateMatrix.BinaryStates> map ) {
+ final StringBuffer sb = new StringBuffer();
+ for( final PhylogenyNode key : map.keySet() ) {
+ if ( !key.isExternal() ) {
+ sb.append( key.getName() );
+ sb.append( " : " );
+ sb.append( map.get( key ).toString() );
+ sb.append( ForesterUtil.getLineSeparator() );
}
}
- catch ( final Exception e ) {
- e.printStackTrace( System.out );
- return false;
- }
- return true;
+ return sb;
}
private static boolean testBasicDomainSimilarityCalculator() {
new BasicSpecies( "nemve" ) ) );
final DomainSimilarityCalculator calc = new BasicDomainSimilarityCalculator( DomainSimilarity.DomainSimilaritySortField.DOMAIN_ID,
false,
- false );
+ false,
+ true );
final SortedSet<DomainSimilarity> sims = calc
.calculateSimilarities( new CombinationsBasedPairwiseDomainSimilarityCalculator(),
cdc_list,
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 ) {
new BasicSpecies( "nemve" ) ) );
final DomainSimilarityCalculator calc2 = new BasicDomainSimilarityCalculator( DomainSimilarity.DomainSimilaritySortField.DOMAIN_ID,
false,
- false );
+ false,
+ true );
final SortedSet<DomainSimilarity> sims2 = calc2
.calculateSimilarities( new CombinationsBasedPairwiseDomainSimilarityCalculator(),
cdc_list2,
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 ) {
new BasicSpecies( "nemve" ) ) );
final DomainSimilarityCalculator calc3 = new BasicDomainSimilarityCalculator( DomainSimilarity.DomainSimilaritySortField.DOMAIN_ID,
false,
- false );
+ false,
+ true );
final SortedSet<DomainSimilarity> sims3 = calc3
.calculateSimilarities( new CombinationsBasedPairwiseDomainSimilarityCalculator(),
cdc_list3,
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" ) );
+ final SpeciesSpecificDcData 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>();
new BasicSpecies( "nemve" ) ) );
final DomainSimilarityCalculator calc4 = new BasicDomainSimilarityCalculator( DomainSimilarity.DomainSimilaritySortField.DOMAIN_ID,
true,
- false );
+ false,
+ true );
final SortedSet<DomainSimilarity> sims4 = calc4
.calculateSimilarities( new CombinationsBasedPairwiseDomainSimilarityCalculator(),
cdc_list4,
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" ) );
+ final SpeciesSpecificDcData 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 ( !sa5_d.getSpecies().last().equals( new BasicSpecies( "rabbit" ) ) ) {
return false;
}
- final SpeciesSpecificDomainSimilariyData ssdsd5 = sa5_d.getSpeciesData().get( new BasicSpecies( "ciona" ) );
+ final SpeciesSpecificDcData ssdsd5 = sa5_d.getSpeciesData().get( new BasicSpecies( "ciona" ) );
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 ( !sa6_d.getSpecies().last().equals( new BasicSpecies( "rabbit" ) ) ) {
return false;
}
- final SpeciesSpecificDomainSimilariyData ssdsd6 = sa6_d.getSpeciesData().get( new BasicSpecies( "ciona" ) );
+ final SpeciesSpecificDcData ssdsd6 = sa6_d.getSpeciesData().get( new BasicSpecies( "ciona" ) );
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
new BasicSpecies( "nemve" ) ) );
final DomainSimilarityCalculator calc = new BasicDomainSimilarityCalculator( DomainSimilarity.DomainSimilaritySortField.DOMAIN_ID,
false,
- false );
+ false,
+ true );
final SortedSet<DomainSimilarity> sims = calc
.calculateSimilarities( new CombinationsBasedPairwiseDomainSimilarityCalculator(),
cdc_list,
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 ) {
new BasicSpecies( "nemve" ) ) );
final DomainSimilarityCalculator calc = new BasicDomainSimilarityCalculator( DomainSimilarity.DomainSimilaritySortField.DOMAIN_ID,
false,
- false );
+ false,
+ true );
final SortedSet<DomainSimilarity> sims = calc
.calculateSimilarities( new CombinationsBasedPairwiseDomainSimilarityCalculator(),
cdc_list,
}
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 true;
}
- private static boolean testBasicProtein() {
- try {
- // A0 A10 B15 A20 B25 A30 B35 B40 C50 A60 C70 D80
- final Domain A0 = new BasicDomain( "A", 0, 25, ( short ) 1, ( short ) 4, 0.1, -12 );
- final Domain A10 = new BasicDomain( "A", 10, 11, ( short ) 1, ( short ) 4, 0.1, -12 );
- final Domain B15 = new BasicDomain( "B", 11, 16, ( short ) 1, ( short ) 4, 0.1, -12 );
- final Domain A20 = new BasicDomain( "A", 20, 100, ( short ) 1, ( short ) 4, 0.1, -12 );
- final Domain B25 = new BasicDomain( "B", 25, 26, ( short ) 1, ( short ) 4, 0.1, -12 );
- final Domain A30 = new BasicDomain( "A", 30, 31, ( short ) 1, ( short ) 4, 0.1, -12 );
- final Domain B35 = new BasicDomain( "B", 31, 40, ( short ) 1, ( short ) 4, 0.1, -12 );
- final Domain B40 = new BasicDomain( "B", 40, 600, ( short ) 1, ( short ) 4, 0.1, -12 );
- final Domain C50 = new BasicDomain( "C", 50, 59, ( short ) 1, ( short ) 4, 0.1, -12 );
- final Domain A60 = new BasicDomain( "A", 60, 395, ( short ) 1, ( short ) 4, 0.1, -12 );
- final Domain C70 = new BasicDomain( "C", 70, 71, ( short ) 1, ( short ) 4, 0.1, -12 );
- final Domain D80 = new BasicDomain( "D", 80, 81, ( short ) 1, ( short ) 4, 0.1, -12 );
- final BasicProtein p = new BasicProtein( "p", "owl", 0 );
- p.addProteinDomain( B15 );
- p.addProteinDomain( C50 );
- p.addProteinDomain( A60 );
- p.addProteinDomain( A30 );
- p.addProteinDomain( C70 );
- p.addProteinDomain( B35 );
- p.addProteinDomain( B40 );
- p.addProteinDomain( A0 );
- p.addProteinDomain( A10 );
- 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" ) );
- if ( !p.contains( domains_ids, false ) ) {
- return false;
- }
- if ( !p.contains( domains_ids, true ) ) {
- return false;
- }
- 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( "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( "D" ) );
- domains_ids.add( new DomainId( "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" ) );
- 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" ) );
- 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" ) );
- if ( !p.contains( domains_ids, false ) ) {
- return false;
- }
- if ( p.contains( domains_ids, true ) ) {
- return false;
- }
- }
- catch ( final Exception e ) {
- e.printStackTrace( System.out );
- return false;
- }
- return true;
- }
-
private static boolean testBinaryDomainCombination() {
try {
final BasicBinaryDomainCombination s0 = new BasicBinaryDomainCombination( "a", "a" );
final BasicBinaryDomainCombination s6 = new BasicBinaryDomainCombination( "b", "c" );
final BasicBinaryDomainCombination s7 = new BasicBinaryDomainCombination( "d", "a" );
final BasicBinaryDomainCombination s8 = new BasicBinaryDomainCombination( "b", "d" );
- final BinaryDomainCombination s9 = BasicBinaryDomainCombination.createInstance( " z-z=a-aa " );
+ final BinaryDomainCombination s9 = BasicBinaryDomainCombination.createInstance( "z-z=a-aa" );
if ( !s9.toString().equals( "a-aa=z-z" ) ) {
System.out.println( s9.toString() );
return false;
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 ) {
- return false;
- }
- if ( cd.getNumberOfProteinsExhibitingCombination( new DomainId( "so_far_so_bad" ) ) != 0 ) {
- return false;
- }
- }
- catch ( final Exception e ) {
- e.printStackTrace( System.out );
- 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 ) {
+ if ( cd.getNumberOfProteinsExhibitingCombination( "three" ) != 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 ) ) {
+ 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>();
}
return true;
}
-
- private static boolean testProteinId() {
- try {
- final ProteinId id1 = new ProteinId( "a" );
- final ProteinId id2 = new ProteinId( "a" );
- final ProteinId id3 = new ProteinId( "A" );
- final ProteinId id4 = new ProteinId( "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 ProteinId id5 = new ProteinId( " 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 testSpecies() {
- try {
- final Species s1 = new BasicSpecies( "a" );
- final Species s2 = new BasicSpecies( "a" );
- final Species s3 = new BasicSpecies( "A" );
- final Species s4 = new BasicSpecies( "b" );
- if ( !s1.equals( s1 ) ) {
- return false;
- }
- if ( s1.getSpeciesId().equals( "x" ) ) {
- return false;
- }
- if ( s1.getSpeciesId().equals( null ) ) {
- return false;
- }
- if ( !s1.equals( s2 ) ) {
- return false;
- }
- if ( s1.equals( s3 ) ) {
- return false;
- }
- if ( s1.hashCode() != s1.hashCode() ) {
- return false;
- }
- if ( s1.hashCode() != s2.hashCode() ) {
- return false;
- }
- if ( s1.hashCode() == s3.hashCode() ) {
- return false;
- }
- if ( s1.compareTo( s1 ) != 0 ) {
- return false;
- }
- if ( s1.compareTo( s2 ) != 0 ) {
- return false;
- }
- if ( s1.compareTo( s3 ) != 0 ) {
- return false;
- }
- if ( s1.compareTo( s4 ) >= 0 ) {
- return false;
- }
- if ( s4.compareTo( s1 ) <= 0 ) {
- return false;
- }
- if ( !s4.getSpeciesId().equals( "b" ) ) {
- return false;
- }
- final Species s5 = new BasicSpecies( " C " );
- if ( !s5.getSpeciesId().equals( "C" ) ) {
- return false;
- }
- if ( s5.equals( s1 ) ) {
- return false;
- }
- }
- catch ( final Exception e ) {
- e.printStackTrace( System.out );
- return false;
- }
- return true;
- }
}