def get_taxa_prevalence(tax_counts):
 tax_ratios = apply_along_axis((lambda x: (x / float(sum(x)))), 0, tax_counts)
 lineage_sums = apply_along_axis((lambda x: sum(x)), 1, tax_ratios)
 total_count = sum(lineage_sums)
 prevalence = (lineage_sums / float(total_count))
 prevalence = ((prevalence - min(prevalence)) / (max(prevalence) - min(prevalence)))
 return prevalence

def get_taxa_prevalence ( tax_counts ) : tax_ratios = apply_along_axis ( ( lambda x : ( x / float ( sum ( x ) ) ) ) , 0 , tax_counts ) lineage_sums = apply_along_axis ( ( lambda x : sum ( x ) ) , 1 , tax_ratios ) total_count = sum ( lineage_sums ) prevalence = ( lineage_sums / float ( total_count ) ) prevalence = ( ( prevalence - min ( prevalence ) ) / ( max ( prevalence ) - min ( prevalence ) ) ) return prevalence
returns the each lineages portion of the total count takes an otu_table .