private Set<Integer> computeTaxonomyId2DataRec(int numberOfDataSets,Node v,Map<Integer,Integer[]> id2counts,Map<Integer,NodeData> id2data){
  int taxonomyId=(Integer)v.getInfo();
  for (Edge e=v.getFirstOutEdge(); e != null; e=v.getNextOutEdge(e)) {
    Node w=e.getTarget();
    computeTaxonomyId2DataRec(numberOfDataSets,w,id2counts,id2data);
  }
  int[] assigned=new int[numberOfDataSets];
  int[] summarized=new int[numberOfDataSets];
  long total=0;
  Integer[] counts=id2counts.get(taxonomyId);
  if (counts != null) {
    int top=Math.min(assigned.length,counts.length);
    for (int i=0; i < top; i++) {
      if (counts[i] != null) {
        assigned[i]=counts[i];
        summarized[i]=counts[i];
        total+=counts[i];
      }
    }
  }
  for (Edge e=v.getFirstOutEdge(); e != null; e=v.getNextOutEdge(e)) {
    Node w=e.getTarget();
    int wId=(Integer)w.getInfo();
    NodeData dataW=id2data.get(wId);
    if (dataW != null) {
      int[] below=dataW.getSummarized();
      int top=Math.min(summarized.length,below.length);
      for (int i=0; i < top; i++) {
        summarized[i]+=below[i];
        total+=below[i];
      }
    }
  }
  if (total > 0)   id2data.put(taxonomyId,new NodeData(assigned,summarized));
  return null;
}

private Set < Integer > computeTaxonomyId2DataRec ( int numberOfDataSets , Node v , Map < Integer , Integer [ ] > id2counts , Map < Integer , NodeData > id2data ) { int taxonomyId = ( Integer ) v . getInfo ( ) ; for ( Edge e = v . getFirstOutEdge ( ) ; e != null ; e = v . getNextOutEdge ( e ) ) { Node w = e . getTarget ( ) ; computeTaxonomyId2DataRec ( numberOfDataSets , w , id2counts , id2data ) ; } int [ ] assigned = new int [ numberOfDataSets ] ; int [ ] summarized = new int [ numberOfDataSets ] ; long total = 0 ; Integer [ ] counts = id2counts . get ( taxonomyId ) ; if ( counts != null ) { int top = Math . min ( assigned . length , counts . length ) ; for ( int i = 0 ; i < top ; i ++ ) { if ( counts [ i ] != null ) { assigned [ i ] = counts [ i ] ; summarized [ i ] = counts [ i ] ; total += counts [ i ] ; } } } for ( Edge e = v . getFirstOutEdge ( ) ; e != null ; e = v . getNextOutEdge ( e ) ) { Node w = e . getTarget ( ) ; int wId = ( Integer ) w . getInfo ( ) ; NodeData dataW = id2data . get ( wId ) ; if ( dataW != null ) { int [ ] below = dataW . getSummarized ( ) ; int top = Math . min ( summarized . length , below . length ) ; for ( int i = 0 ; i < top ; i ++ ) { summarized [ i ] += below [ i ] ; total += below [ i ] ; } } } if ( total > 0 ) id2data . put ( taxonomyId , new NodeData ( assigned , summarized ) ) ; return null ; }
recursively computes the taxon - id 2 assigned and taxon - id 2 summarized maps
