Added function to subset samples
add  subset samples tests