Functions for preprocessing genomic data