def _calc_shared_phylotypes_multiple(otu_table, idxs):
 if (len(idxs) < 2):
  raise ValueError('calc_shared_phylotypes_multiple needs at least two sampleIDs to comapre')
 shared_phylos = ones(len(otu_table.ids(axis='observation')))
 for id_ in idxs:
  shared_phylos = logical_and(shared_phylos, otu_table.data(id_, 'sample'))
 return shared_phylos.sum()

def _calc_shared_phylotypes_multiple ( otu_table , idxs ) : if ( len ( idxs ) < 2 ) : raise ValueError ( 'calc_shared_phylotypes_multiple needs at least two sampleIDs to comapre' ) shared_phylos = ones ( len ( otu_table . ids ( axis = 'observation' ) ) ) for id_ in idxs : shared_phylos = logical_and ( shared_phylos , otu_table . data ( id_ , 'sample' ) ) return shared_phylos . sum ( )
calculate shared otus between several samples indexed by values in idxes .