rarefy_sample_count_by_modality function

Rarefy (equalize) the number of samples per modality of a factor