getStudyVariableData: Get study variable data by accession

Description Usage Arguments Value Methods (by class) Examples

Description

The method retrieves the variable data given a list of dbGaP variable accessions or a dataset accession.

Usage

1
2
3
4
5
6
getStudyVariableData(object, ...)

## S4 method for signature 'Study'
getStudyVariableData(object, ..., phtAcc = "",
  phvAccList = vector(), dbgapIdsOrFile = NULL, emptyToNa = FALSE,
  colNameWithAcc = FALSE)

Arguments

object

Study class object.

...

There are optional arguments.

phtAcc

a character string. (optional) The dbGaP phenotype dataset accession.

phvAccList

a character vector. (optional) The dbGaP variable accessions. The list only accepts subject level variables. The sample level variables are not accepted.

dbgapIdsOrFile

a character vector or a character string. (optional) This argument can be either a vector of ID list or a path to a file that contains a list of IDs. The IDs can be dbGaP_Subject_ID or dbGaP_Sample_ID denpending on type of the data. When the list of IDs is provided by a file, it should be a plain text file with one ID per line.

emptyToNa

a logical value. (optional). If TRUE, converts the empty values to NA; If FALSE (default), not convert.

colNameWithAcc

a logical value. (optional) If TRUE, the variable column name is concatenated with the respective variable accession (e.g. AGEPHOT_phv00000027.v2); If FALSE (default), keep the original column name unchanged (e.g. AGEPHOT).

Value

a data frame. Merged data of the input variables.

Methods (by class)

Examples

1
2
3
4
5
6
7
8
9
## Not run: 

s <- Study(phsAcc = 'phs000001.v3.p1')
var_list <- c('phv00054119.v1.p1.c2', 'phv00054118.v1.p1', 'phv00053733.v2')
getStudyVariableData(s, phvAccList = var_list)
# or
getStudyVariableData(s, phtAcc = 'pht000370.v2.p1', colNameWithAcc = TRUE)

## End(Not run)

jameslhao/dbgapr_dev documentation built on May 8, 2019, 11:03 p.m.