def convert_otu_table_relative(otu_table):
 (sample_ids, otu_ids, otu_counts, consensus) = otu_table
 otu_counts = asarray(otu_counts, float)
 otu_counts = (otu_counts / otu_counts.sum())
 otu_counts = where(isnan(otu_counts), 0.0, otu_counts)
 return (sample_ids, otu_ids, otu_counts, consensus)

def convert_otu_table_relative ( otu_table ) : ( sample_ids , otu_ids , otu_counts , consensus ) = otu_table otu_counts = asarray ( otu_counts , float ) otu_counts = ( otu_counts / otu_counts . sum ( ) ) otu_counts = where ( isnan ( otu_counts ) , 0.0 , otu_counts ) return ( sample_ids , otu_ids , otu_counts , consensus )
convert the otu table to relative abundances this method works on a parsed otu table .