R function to perform large-scale pharmacogenomic analysis