The function applies a cut-off filter to the SNP information file to retain only the SNP that have a frequency superior or equal to the specified cut-off in at least one super population. The information about the retained SNPs is saved in a RDS format file. A RDS file containing the indexes of the retained SNP is also created.

generateMapSnvSel(cutOff = 0.01, fileSNV, fileSNPsRDS, fileFREQ)

Arguments

cutOff

a single numeric value, the cut-off for the frequency in at least one super population. Default: 0.01.

fileSNV

a character string representing the path and file name of the bulk SNP information file from Reference. The file must be in text format. The file must exist.

fileSNPsRDS

a character string representing the path and file name of the RDS file that will contain the indexes of the retained SNPs. The file extension must be '.rds'.

fileFREQ

a character string representing the path and file name of the RDS file that will contain the filtered SNP information. The file extension must be '.rds'.

Value

The integer 0 when successful.

Details

The filtered SNP information RDS file (parameter fileFREQ), contains a data.frame with those columns:

CHROM

a character string representing the chromosome where the SNV is located.

POS

a character string representing the SNV position on the chromosome.

REF

a character string representing the reference DNA base for the SNV.

ALT

a character string representing the alternative DNA base for the SNV.

\
EAS_AF

a character string representing the allele frequency of the EAS super population.

AFR_AF

a character string representing the allele frequency of the AFR super population.

AMR_AF

a character string representing the allele frequency of the AMR super population.

SAS_AF

a character string representing the allele frequency of the SAS super population.

Author

Pascal Belleau, Astrid Deschênes and Alexander Krasnitz

Examples


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

## Demo SNV information file used as input
snvFile <- file.path(dataDir, "matFreqSNV_Demo.txt.bz2")

## Temporary output files
## The first file contains the indexes of the retained SNPs
## The second file contains the filtered SNP information
snpIndexFile <- file.path(tempdir(), "listSNP_TEMP.rds")
filterSNVFile <- file.path(tempdir(), "mapSNVSel_TEMP.rds")

## Create a data.frame containing the information of the retained
## samples (samples with existing genotyping files)
generateMapSnvSel(cutOff=0.01, fileSNV=snvFile,
        fileSNPsRDS=snpIndexFile, fileFREQ=filterSNVFile)
#> [1] 0

## Remove temporary files
unlink(snpIndexFile, force=TRUE)
unlink(filterSNVFile, force=TRUE)