generateGDS1KG: Generate the GDS file that will contain the information from...

View source: R/process1KG.R

generateGDS1KGR Documentation

Generate the GDS file that will contain the information from 1KG

Description

This function generates the GDS file that will contain the information from 1KG. The function also add the samples information, the SNP information and the genotyping information into the GDS file.

Usage

generateGDS1KG(
  PATHGENO = file.path("data", "sampleGeno"),
  fileNamePED,
  fileListSNP,
  fileSNPSel,
  fileNameGDS,
  listSamples = NULL
)

Arguments

PATHGENO

a character string representing the path where the 1K genotyping files for each sample are located. The name of the genotyping files must correspond to the individual identification (Individual.ID) in the pedigree file. Default: "./data/sampleGeno".

fileNamePED

a character string representing the path and file name of the RDS file that contains the pedigree information. The file must exist. The file must be a RDS file.

fileListSNP

a character string representing the path and file name of the RDS file that contains the indexes of the retained SNPs. The file must exist. The file must be a RDS file.

fileSNPSel

a character string representing the path and file name of the RDS file that contains the filtered SNP information. The file must exist. The file must be a RDS file.

fileNameGDS

a character string representing the path and file name of the GDS file that will be created. The GDS file will contain the SNP information, the genotyping information and the pedigree information from 1000 Genomes. The extension of the file must be '.gds'.

listSamples

a vector of character string corresponding to samples (must be the sample.ids) that will be retained and added to the GDS file. When NULL, all the samples are retained. Default: NULL.

Details

More information about GDS file format can be found at the Bioconductor gdsfmt website: https://bioconductor.org/packages/gdsfmt/

Value

None.

Author(s)

Pascal Belleau, Astrid DeschĂȘnes and Alexander Krasnitz

Examples


## Needed package
library(withr)

## Path to the demo pedigree file is located in this package
data.dir <- system.file("extdata", package="RAIDS")

## The RDS file containing the pedigree information
pedigreeFile <- file.path(data.dir, "PedigreeDemo.rds")

## The RDS file containing the indexes of the retained SNPs
snpIndexFile <- file.path(data.dir, "listSNPIndexes_Demo.rds")

## The RDS file containing the filtered SNP information
filterSNVFile <- file.path(data.dir, "mapSNVSelected_Demo.rds")

## Temporary GDS file containing 1KG information
GDS_file <- local_file(file.path(data.dir, "1KG_TEMP.gds"))

## Create a temporary GDS file containing information from 1KG
generateGDS1KG(PATHGENO=data.dir, fileNamePED=pedigreeFile,
    fileListSNP=snpIndexFile, fileSNPSel=filterSNVFile,
    fileNameGDS=GDS_file, listSamples=NULL)

## Remove temporary files
deferred_run()


belleau/aicsPaper documentation built on Aug. 4, 2022, 1:12 a.m.