def condense_otus(otuF, nuniqueF):
uniqueOTUs = set()<EOL>nuOTUs = {}<EOL>for line in nuniqueF:<EOL><INDENT>line = line.split()<EOL>uOTU = line[<NUM_LIT:0>]<EOL>for nuOTU in line[<NUM_LIT:1>:]:<EOL><INDENT>nuOTUs[nuOTU] = uOTU<EOL><DEDENT>uniqueOTUs.add(uOTU)<EOL><DEDENT>otuFilter = defaultdict(list)<EOL>for line in otuF:<EOL><INDENT>line = line.split()<EOL>otuID, seqIDs = line[<NUM_LIT:0>], line[<NUM_LIT:1>:]<EOL>if otuID in uniqueOTUs:<EOL><INDENT>otuFilter[otuID].extend(seqIDs)<EOL><DEDENT>elif otuID in nuOTUs:<EOL><INDENT>otuFilter[nuOTUs[otuID]].extend(seqIDs)<EOL><DEDENT><DEDENT>return otuFilter<EOL>
Traverse the input otu-sequence file, collect the non-unique OTU IDs and
file the sequences associated with then under the unique OTU ID as defined
by the input matrix.

:@type otuF: file
:@param otuF: The output file from QIIME's pick_otus.py
:@type nuniqueF: file
:@param nuniqueF: The matrix of unique OTU IDs associated to the list of
                  non-unique OTU IDs they replaced.

:@rtype: dict
:@return: The new condensed table of unique OTU IDs and the sequence IDs
          associated with them.