metaGE.collect {metaGE}R Documentation

Collect the results of GWAS data from different files

Description

This function merges files containing the summary statistics of GWAS in different environments (one file per environment).

Usage

metaGE.collect(
  FileNames,
  VariableNames,
  MinFreq = 0,
  DropDuplicates = TRUE,
  Verbose = FALSE,
  NA.rmv = TRUE
)

Arguments

FileNames

A list containing the file paths to merge (one trait only) or a list of such lists

VariableNames

A named list containing the column names in the original files corresponding to the variables below:

  • MARKER, CHR, POS, EFFECT, EFFECT_SE, PVAL,

  • (optional: FREQ, ALLELE0, ALLELE1, WEIGHT) or a list of such lists.

MinFreq

A numeric value allowing to filter markers based on the maf. (optional)

DropDuplicates

A boolean indicating whether duplicate markers should be removed or not. (TRUE by default)

Verbose

A boolean indicating whether progression messages should be printed or not. (FALSE by default)

NA.rmv

A boolean should the NA be removed or not (TRUE by default)

Details

Each file MUST contain the variables below:

Value

A list of:

Examples

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)

[Package metaGE version 1.0.3 Index]