public int computeId(BitSet activeMatches,IReadBlock readBlock){
  if (readBlock.getNumberOfMatches() == 0)   return IdMapper.NOHITS_ID;
  if (activeMatches.cardinality() > 0) {
    boolean hasDisabledMatches=false;
    int numberOfAddresses=0;
    for (int i=activeMatches.nextSetBit(0); i != -1; i=activeMatches.nextSetBit(i + 1)) {
      final IMatchBlock matchBlock=readBlock.getMatchBlock(i);
      final int id=matchBlock.getId(cName);
      if (id > 0) {
        String address=fullTree.getAddress(id);
        if (address != null) {
          if (numberOfAddresses >= addresses.length) {
            String[] tmp=new String[2 * addresses.length];
            System.arraycopy(addresses,0,tmp,0,addresses.length);
            addresses=tmp;
          }
          addresses[numberOfAddresses++]=address;
        }
      }
 else       hasDisabledMatches=true;
    }
    if (numberOfAddresses == 0 && hasDisabledMatches) {
      for (int i=activeMatches.nextSetBit(0); i != -1; i=activeMatches.nextSetBit(i + 1)) {
        final IMatchBlock matchBlock=readBlock.getMatchBlock(i);
        final int id=matchBlock.getId(cName);
        if (id > 0) {
          String address=fullTree.getAddress(id);
          if (address != null) {
            if (numberOfAddresses >= addresses.length) {
              String[] tmp=new String[2 * addresses.length];
              System.arraycopy(addresses,0,tmp,0,addresses.length);
              addresses=tmp;
            }
            addresses[numberOfAddresses++]=address;
          }
        }
      }
    }
    if (numberOfAddresses > 0) {
      final String address=LCAAddressing.getCommonPrefix(addresses,numberOfAddresses,true);
      final int id=fullTree.getAddress2Id(address);
      if (id > 0) {
        return id;
      }
    }
  }
  return IdMapper.UNASSIGNED_ID;
}

public int computeId ( BitSet activeMatches , IReadBlock readBlock ) { if ( readBlock . getNumberOfMatches ( ) == 0 ) return IdMapper . NOHITS_ID ; if ( activeMatches . cardinality ( ) > 0 ) { boolean hasDisabledMatches = false ; int numberOfAddresses = 0 ; for ( int i = activeMatches . nextSetBit ( 0 ) ; i != - 1 ; i = activeMatches . nextSetBit ( i + 1 ) ) { final IMatchBlock matchBlock = readBlock . getMatchBlock ( i ) ; final int id = matchBlock . getId ( cName ) ; if ( id > 0 ) { String address = fullTree . getAddress ( id ) ; if ( address != null ) { if ( numberOfAddresses >= addresses . length ) { String [ ] tmp = new String [ 2 * addresses . length ] ; System . arraycopy ( addresses , 0 , tmp , 0 , addresses . length ) ; addresses = tmp ; } addresses [ numberOfAddresses ++ ] = address ; } } else hasDisabledMatches = true ; } if ( numberOfAddresses == 0 && hasDisabledMatches ) { for ( int i = activeMatches . nextSetBit ( 0 ) ; i != - 1 ; i = activeMatches . nextSetBit ( i + 1 ) ) { final IMatchBlock matchBlock = readBlock . getMatchBlock ( i ) ; final int id = matchBlock . getId ( cName ) ; if ( id > 0 ) { String address = fullTree . getAddress ( id ) ; if ( address != null ) { if ( numberOfAddresses >= addresses . length ) { String [ ] tmp = new String [ 2 * addresses . length ] ; System . arraycopy ( addresses , 0 , tmp , 0 , addresses . length ) ; addresses = tmp ; } addresses [ numberOfAddresses ++ ] = address ; } } } } if ( numberOfAddresses > 0 ) { final String address = LCAAddressing . getCommonPrefix ( addresses , numberOfAddresses , true ) ; final int id = fullTree . getAddress2Id ( address ) ; if ( id > 0 ) { return id ; } } } return IdMapper . UNASSIGNED_ID ; }
determine the taxon id of a read from its matches
