#' A tools4ukbb function
#' Function output: grouped datframe to be used in get_genotype. Do not use this function alone except for unit testing.
#'
#' @param variants a list of variants you are interested in
#' @param variants_df dataframe with 3 columns: variant names, their chromosome, and their index
#' @param pgen_list list of pgens generated from get_pgen_list
#' @keywords get_genotypes_from_pgen
#' @export
#' @examples
#' get_genotypes_from_pgen()
get_genotypes_from_pgen <- function(variants, variants_df, pgen_list) {
chr_name <- unique(variants_df$chromosome)
print(chr_name)
pgen_handle <- pgen_list[[chr_name]]
geno_mat <- ReadList(pgen_handle, variants$index, meanimpute=F)
colnames(geno_mat) <- variants$variant_id
geno_mat
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.