require(dplyr)
require(tibble)
require(stringr)
RepData <- system.file("extdata", package = "metaGE")
# Get the complete list of association files
File.list <- list.files(RepData ,full.names = TRUE) %>%
tibble(Names = .) %>%
mutate(ShortNames = Names %>%
str_remove(pattern = paste0(RepData,"/")) %>%
str_remove(pattern = "_DF.txt")) %>%
select(ShortNames,Names) %>%
deframe
###Build the dataset
## First provide the list of variable names
Names.list <- list(MARKER="Marker_Name",
CHR="Chromosome",
POS="Marker_Position",
FREQ="Maf",
EFFECT="SNP_Weight",
PVAL="Pvalue",
ALLELE0="Allele1",
ALLELE1="Allele2")
MinFreq <- 0.07
## Now collect
metaData <- metaGE.collect(File.list, Names.list,MinFreq = MinFreq)
Run the code above in your browser using DataLab