The function extract the specified column for the 'sample.ref' node present in the Reference GDS file. The column must be present in the data.frame saved in the 'sample.ref' node. Only the information for the reference profiles is returned. The values represent the known ancestry assignation.

getRef1KGPop(gdsReference, popName = "superPop")

Arguments

gdsReference

an object of class gds.class (a GDS file), the opened Reference GDS file.

popName

a character string representing the name of the column that will be fetched in the data.frame present in the Reference GDS "sample.ref" node. The column must be present in the data.frame. Default: "superPop".

Value

vector of character strings representing the content of the extracted column for the 1KG GDS 'sample.ref' node. The values represent the known ancestry assignation. The profile identifiers are used as names for the vector.

Author

Pascal Belleau, Astrid Deschênes and Alexander Krasnitz

Examples


## Required library
library(gdsfmt)

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

## Open existing demo 1K GDS file with "sample.ref" node
nameFileGDS <- file.path(dataDir, "PopulationReferenceDemo.gds")
fileGDS <- snpgdsOpen(nameFileGDS)

## Extract super population information for the 1KG profiles
getRef1KGPop(gdsReference=fileGDS, popName="superPop")
#> HG00100 HG00101 HG00102 HG00103 HG00104 HG00105 HG00106 HG00109 
#>   "EUR"   "SAS"   "EAS"   "EUR"   "AFR"   "AFR"   "AFR"   "AMR" 

## Close 1K GDS file
closefn.gds(fileGDS)