Sign inSign up

gversmee/sratoolkit

By gversmee

•Updated about 7 years ago

Image
0

1.0K

gversmee/sratoolkit repository overview

License DOI Docker Automated build

⁠Using dbgap2x, R package to explore, download and decrypt phenotypic and genomic data from dbGaP

You can test this software:

  • Using the dockerized version on your local device by running
docker run -p 80:8888 -v /var/run/docker.sock:/var/run/docker.sock  gversmee/dbgap2x

and then open your web browser at http://localhost⁠, and use the password dbgap2x

  • Using your local R by installing the package with
install.packages("devtools")
devtools::install_github("gversmee/dbgap2x")

For using the package with a fresh R installation, make sure your system has the following libraries: libcurl4-openssl-dev libssl-dev libxml2-dev. Example for a debian system:

sudo apt-get update
sudo apt-get install libcurl4-openssl-dev libssl-dev libxml2-dev -y

⁠Introduction

⁠Load the package
#devtools::install_github("gversmee/dbgap2x", force = TRUE)
library(dbgap2x)
⁠Get the list of the function for this new package
lsf.str("package:dbgap2x")
browse.dbgap : function (phs, no.browser = FALSE)  
browse.study : function (phs, no.browser = FALSE)  
consent.groups : function (phs)  
datatables.dict : function (phs)  
dbgap.data_dict : function (xml, dest)  
dbgap.decrypt : function (files, key = FALSE)  
dbgap.download : function (krt, key = FALSE)  
is.parent : function (phs)  
n.pop : function (phs, consentgroups = TRUE, gender = TRUE)  
n.tables : function (phs)  
n.variables : function (...)  
parent.study : function (phs)  
phs.version : function (phs)  
search.dbgap : function (term, no.browser = FALSE)  
study.name : function (phs)  
sub.study : function (phs)  
variables.dict : function (phs)  

⁠Search for dbGaP studies

⁠Let's try to explore the "Jackson Heart Study" cohort that exists on dbGaP.
search.dbgap("Jackson")
https://www.ncbi.nlm.nih.gov/gap/?term=Jackson%5BStudy+Name%5D 
                          
Study IDStudy NameRelease DateNb ParticipantsStudy DesignProjectDiseasesAncestor IDAncestor NameMolecular Data TypeTumor TypeUID
phs001356.v1.p2 Exome Chip Genotyping: The Jackson Heart Study 2019-05-10 2788 Prospective Longitudinal Cohort National Heart, Lung, Blood Institute Cardiovascular Diseases, Hypertension, Diabetes Mellitusphs000286.v6.p2 The Jackson Heart Study (JHS) SNP Genotypes (Array) germline 1692088
phs001098.v2.p2 T2D-GENES Multi-Ethnic Exome Sequencing Study: Jackson Heart Study 2019-05-10 1029 Case-Control NHLBI GO-ESP Diabetes Mellitus, Type 2 phs000286.v6.p2 The Jackson Heart Study (JHS) SNP/CNV Genotypes (NGS), WXS germline 1597258
phs000499.v4.p2 NHLBI Jackson Heart Study Candidate Gene Association Resource (CARe) 2019-05-10 3352 Prospective Longitudinal Cohort NHLBI CARe Longitudinal Studies phs000286.v6.p2 The Jackson Heart Study (JHS) SNP Genotypes (Array) germline, unspecified 1597257
phs000498.v4.p2 Jackson Heart Study Allelic Spectrum Project 2019-05-10 1983 Prospective Longitudinal Cohort National Heart, Lung, Blood Institute Cardiovascular Diseases phs000286.v6.p2 The Jackson Heart Study (JHS) SNP Genotypes (NGS), WXS germline 1597256
phs000286.v6.p2 The Jackson Heart Study (JHS) 2019-05-10 3889 Prospective Longitudinal Cohort National Heart, Lung, Blood Institute, NHLBI GO-ESP, NHLBI CARe Cardiovascular Diseases, Coronary Artery Disease, Diabetes Mellitus, Type 2, Obesity, Hypertension, Kidney Failure, Chronic, Stroke, Heart Failure, Peripheral Vascular Diseases, Arrhythmias, Cardiac germline, unspecified 1597254
phs000964.v3.p1 NHLBI TOPMed: The Jackson Heart Study 2018-05-18 3596 Prospective Longitudinal Cohort National Human Genome Research Institute Cardiovascular Diseases, Hypertension, Diabetes Mellitus SNP/CNV Genotypes (NGS), WGS germline 1768620
phs.version("286")

'phs000286.v6.p2'

⁠The is.parent() function is usefull to test if a study is a parent study or a substudy
is.parent("000286") # JHS main cohort
is.parent("phs499") # substudy "CARe" for JHS

TRUE

FALSE

⁠If you don't know the parent study of a substudy, try parent.study()
parent.study("phs000499")
  1. 'phs000286.v6.p2'
  2. 'Jackson Heart Study (JHS) Cohort'
⁠On the other side, use sub.study() to get the name and IDs of the substudies from a parent one
sub.study("286")
phsname
phs001356.v1.p2 Exome Chip Genotyping: The Jackson Heart Study
phs000498.v4.p2 Jackson Heart Study Allelic Spectrum Project
phs001069.v1.p2 MIGen_ExS: JHS
phs000402.v4.p2 NHLBI GO-ESP: Heart Cohorts Exome Sequencing Project (JHS)
phs000499.v4.p2 NHLBI Jackson Heart Study Candidate Gene Association Resource (CARe)
phs001098.v2.p2 T2D-GENES Multi-Ethnic Exome Sequencing Study: Jackson Heart Study
⁠If you want to get the name of a study from its dbGaP id, use study.name()
study.name("286")

'Jackson Heart Study (JHS) Cohort'

⁠Finally, you can watch your study on dbGaP with browse.dbgap().
⁠If a website exists for this study, you can browse it using browse.study()
browse.dbgap("286", no.browser = TRUE)
browse.study("286", no.browser = TRUE)

'https://www.ncbi.nlm.nih.gov/projects/gap/cgi-bin/study.cgi?study_id=phs000286.v6.p2⁠'

'https://www.jacksonheartstudy.org⁠'

⁠Explore the characteristics of your study

JHS <- "phs000286"
consent.groups(JHS)
shortNamelongName
0NRUP Subjects did not participate in the study, did not complete a consent document and are included only for the pedigree structure and/or genotype controls, such as HapMap subjects
1HMB-IRB-NPU Health/Medical/Biomedical (IRB, NPU)
2DS-FDO-IRB-NPU Disease-Specific (Focused Disease Only, IRB, NPU)
3HMB-IRB Health/Medical/Biomedical (IRB)
4DS-FDO-IRB Disease-Specific (Focused Disease Only, IRB)
⁠Use n.pop() to know the number of patient included in each groups
n.pop(JHS)
n.pop(JHS, consentgroups = FALSE)
consent_groupmalefemaletotal
HMB-IRB 2409 3046 5885
HMB-IRB-NPU 265 511 883
DS-FDO-IRB-NPU 63 109 201
HMB-IRB 793 1249 2289
DS-FDO-IRB 174 295 516
TOTAL 3704 5210 9774

9774

⁠Use n.tables() and n.variables() to get the number of datatables in your study and the total number of variables
n.tables(JHS)
n.variables(JHS)

112

4856

⁠datatables.dict() will return a data frame with the datatables IDs (phtxxxxxx) and description of your study
tablesdict <- datatables.dict(JHS)
head(tablesdict)
phtdt_study_namedt_label
pht008811.v1 MIGen_JHS_AA_Subject_Phenotypes Subject ID, age, sex, cohort, consortium, T2D affection status, weight, BMI, waist circumference, height, LDL, HDL, total cholesterol, blood pressure, adiponectin, debates age, creatinine, fasting glucose, fasting insulin, HbA1C, leptin, triglycerides, and medication of participants involved in the "Myocardial Infarction Genetics Exome Sequencing Consortium: Jackson Heart Study" project.
pht008783.v1 sbpc sbpc
pht008727.v1 allevthf allevthf
pht001959.v2 loca loca
pht001945.v2 cena cena
pht001957.v2 hcaa hcaa
⁠variables.dict() will return a data frame with the variables IDs (phvxxxxxx), their name in the study, the datatable where they come from and their description
vardict <- variables.dict(JHS)
head(vardict)
dt_study_namephvvar_namevar_desc
MIGen_JHS_AA_Subject_Phenotypes phv00404354.v1 SUBJECT_ID De-identified Subject ID
MIGen_JHS_AA_Subject_Phenotypes phv00404355.v1

Tag summary

Content type

Image

Digest

Size

152.7 MB

Last updated

about 7 years ago

docker pull gversmee/sratoolkit