- //FIXME really needs to be tested!
- private static void addCounts( final SortedMap<BinaryDomainCombination, List<Integer>> copy_counts,
- final BinaryDomainCombination dc,
- final GenomeWideCombinableDomains genome,
- final Set<BinaryDomainCombination> bdc ) {
- if ( !copy_counts.containsKey( dc ) ) {
- copy_counts.put( dc, new ArrayList<Integer>() );
- }
- if ( bdc.contains( dc )
- && ( ( ( BasicCombinableDomains ) genome.get( dc.getId0() ) ).getCombiningDomains().get( dc.getId1() ) != null ) ) {
- final int count = ( ( BasicCombinableDomains ) genome.get( dc.getId0() ) ).getCombiningDomains()
- .get( dc.getId1() );
- copy_counts.get( dc ).add( count );
- }
- else {
- copy_counts.get( dc ).add( 0 );
- }
- }
-
- private static void addCounts( final SortedMap<DomainId, List<Integer>> copy_counts,
- final DomainId domain,
- final GenomeWideCombinableDomains genome ) {
- if ( !copy_counts.containsKey( domain ) ) {
- copy_counts.put( domain, new ArrayList<Integer>() );
- }
- if ( genome.contains( domain ) ) {
- copy_counts.get( domain ).add( genome.get( domain ).getKeyDomainProteinsCount() );
- }
- else {
- copy_counts.get( domain ).add( 0 );
- }
- }
-
- private static StringBuilder addGoInformation( final DomainId d,
- final Map<DomainId, 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()
- || !domain_id_to_go_ids_map.containsKey( d ) ) {
- return sb;
- }
- final List<GoId> go_ids = domain_id_to_go_ids_map.get( d );
- for( int i = 0; i < go_ids.size(); ++i ) {
- final GoId go_id = go_ids.get( i );
- if ( go_id_to_term_map.containsKey( go_id ) ) {
- appendGoTerm( sb, go_id_to_term_map.get( go_id ) );
- sb.append( "<br>" );
- }
- else {
- sb.append( "go id \"" + go_id + "\" not found [" + d.getId() + "]" );
- }
- }
- return sb;
- }
-
- private static void appendGoTerm( final StringBuilder sb, final GoTerm go_term ) {
- final GoId go_id = go_term.getGoId();
- sb.append( "<a href=\"" + SurfacingConstants.AMIGO_LINK + go_id + "\" target=\"amigo_window\">" + go_id
- + "</a>" );
- sb.append( ":" );
- sb.append( go_term.getName() );
- sb.append( " [" );
- sb.append( go_term.getGoNameSpace().toShortString() );
- sb.append( "]" );
- }
-