+ static final int nodeDataIntoStringBuffer( final List<String> data, final Options optz, final StringBuilder sb ) {
+ final SortedMap<String, Integer> map = new TreeMap<String, Integer>();
+ int size = 0;
+ if ( ( optz.getExtDescNodeDataToReturn() != NodeDataField.SEQUENCE_MOL_SEQ_FASTA )
+ && ( optz.getExtDescNodeDataToReturn() != NodeDataField.GO_TERM_IDS ) ) {
+ for( final String d : data ) {
+ if ( !ForesterUtil.isEmpty( d ) ) {
+ if ( map.containsKey( d ) ) {
+ map.put( d, map.get( d ) + 1 );
+ }
+ else {
+ map.put( d, 1 );
+ }
+ }
+ }
+ if ( ( optz.getExtDescNodeDataToReturn() == NodeDataField.DOMAINS_ALL )
+ || ( optz.getExtDescNodeDataToReturn() == NodeDataField.DOMAINS_COLLAPSED_PER_PROTEIN )
+ || ( optz.getExtDescNodeDataToReturn() == NodeDataField.SEQ_ANNOTATIONS ) ) {
+ final ArrayList<StringInt> sis = new ArrayList<StringInt>();
+ for( final Entry<String, Integer> e : map.entrySet() ) {
+ sis.add( new StringInt( e.getKey(), e.getValue() ) );
+ }
+ Collections.sort( sis, new StringInt.DescendingIntComparator() );
+ for( final StringInt si : sis ) {
+ sb.append( si.getString() );
+ sb.append( "\t" );
+ sb.append( si.getInt() );
+ sb.append( ForesterUtil.LINE_SEPARATOR );
+ }
+ }
+ else {
+ for( final Entry<String, Integer> e : map.entrySet() ) {
+ final String v = e.getKey();
+ final Object c = e.getValue();
+ sb.append( v );
+ sb.append( "\t" );
+ sb.append( c );
+ sb.append( ForesterUtil.LINE_SEPARATOR );
+ }
+ }
+ size = map.size();
+ }
+ else {
+ for( final String d : data ) {
+ if ( !ForesterUtil.isEmpty( d ) ) {
+ sb.append( d );
+ sb.append( ForesterUtil.LINE_SEPARATOR );
+ }
+ }
+ size = data.size();
+ }
+ return size;
+ }
+
+ final static String pdbAccToString( final List<Accession> accs, final int i ) {
+ if ( ForesterUtil.isEmpty( accs.get( i ).getComment() ) ) {
+ return accs.get( i ).getValue();
+ }
+ return accs.get( i ).getValue() + " (" + accs.get( i ).getComment().toLowerCase() + ")";