Build dict of sampleids by category, slice data array with sampleid indices