add a function to read subsets of data matrix.