split_sample_groups function

Split sample groups