Object that downloads, develops and uploads GWAS summary datasets for IEU OpenGWAS database
Dataset.Rd
Object that downloads, develops and uploads GWAS summary datasets for IEU OpenGWAS database
Object that downloads, develops and uploads GWAS summary datasets for IEU OpenGWAS database
Public fields
filename
Path to raw GWAS summary dataset
igd_id
ID to use for upload. If NULL then the next available ID in batch ieu-b will be used automatically
wd
Work directory in which to save processed files. Will be deleted upon completion
gwas_out
path to processed summary file
nsnp_read
Number of SNPs read initially
nsnp
Number of SNPs retained after reading
metadata
List of meta-data entries
metadata_test
List of outputs from tests of the effect allele, effect allele frequency columns and summary data using CheckSumStats
metadata_file
Path to meta-data json file
datainfo
List of GWAS file parameters
datainfo_file
Path to datainfo json file
params
Initial column identifiers specified for raw dataset
metadata_uploaded
TRUE/FALSE of whether the metadata has been uploaded
gwasdata_uploaded
TRUE/FALSE of whether the gwas data has been uploaded
metadata_upload_status
Response from server about upload process
gwasdata_upload_status
Response from server about upload process
Methods
Method new()
Initialise
Arguments
filename
Path to raw GWAS summary data file
wd
Path to directory to use as the working directory. Will be deleted upon completion - best to keep as the default randomly generated temporary directory
igd_id
Option to provide a specified ID for upload. If none provided then will use the next ieu-a batch ID
Method is_new_id()
Check if the specified ID is unique within the database. It checks published GWASs and those currently being processed
Method determine_columns()
Specify which columns in the dataset correspond to which fields.
Arguments
params
List of column identifiers. Identifiers can be numeric position or column header name. Required columns are: c("chr_col", "pos_col", "ea_col", "oa_col", "beta_col", "se_col", "pval_col","rsid_col"). Optional columns are: c("snp_col", "eaf_col", "oaf_col", "ncase_col", "imp_z_col", "imp_info_col", "ncontrol_col").
nrows
How many rows to read to check that parameters have been specified correctly
gwas_file
Filename to read
...
Further arguments to pass to data.table::fread in order to correctly read the dataset
Method format_dataset()
Process dataset ready for uploading. Determins build and lifts over to hg19/b37 if necessary.
Usage
Dataset$format_dataset(
gwas_file = self$filename,
gwas_out = file.path(self$wd, "format.txt.gz"),
params = self$params,
metadata_test = self$metadata_test,
...
)
Arguments
gwas_file
GWAS filename
gwas_out
Filename to save processed dataset to
params
Column specifications (see determine_columns for more info)
metadata_test
List of outputs from tests of the effect allele, effect allele frequency columns and summary data using CheckSumStats
...
Further arguments to pass to data.table::fread in order to correctly read the dataset
Method view_metadata_options()
View the specifications for available meta data fields, as taken from http://gwas-api.mrcieu.ac.uk/docs
Method check_meta_data()
Check that the reported effect allele and effect allele frequency columns are correct.
Method write_metadata()
Write meta data to json file
Method api_metadata_upload()
Upload meta data to API
Usage
Dataset$api_metadata_upload(
metadata = self$metadata,
metadata_test = self$metadata_test,
access_token = ieugwasr::check_access_token()
)
Method api_metadata_edit()
Upload meta data to API
Usage
Dataset$api_metadata_edit(
metadata = self$metadata,
access_token = ieugwasr::check_access_token()
)
Method api_metadata_check()
View meta-data
Usage
Dataset$api_metadata_check(
id = self$igd_id,
access_token = ieugwasr::check_access_token()
)
Method api_metadata_delete()
Delete a dataset. This deletes the metadata AND any uploaded GWAS data (and related processing files)
Usage
Dataset$api_metadata_delete(
id = self$igd_id,
access_token = ieugwasr::check_access_token()
)
Method api_gwasdata_upload()
Upload gwas dataset
Usage
Dataset$api_gwasdata_upload(
datainfo = self$datainfo,
gwasfile = self$gwas_out,
metadata_test = self$metadata_test,
access_token = ieugwasr::check_access_token()
)
Method api_gwasdata_check()
Check status of API processing pipeline
Usage
Dataset$api_gwasdata_check(
id = self$igd_id,
access_token = ieugwasr::check_access_token()
)
Method api_gwasdata_delete()
Delete a dataset. This deletes the metadata AND any uploaded GWAS data (and related processing files)
Usage
Dataset$api_gwasdata_delete(
id = self$igd_id,
access_token = ieugwasr::check_access_token()
)
Method api_qc_status()
Check the status of the GWAS QC processing pipeline
Usage
Dataset$api_qc_status(
id = self$igd_id,
access_token = ieugwasr::check_access_token()
)
Method api_report()
View the html report for a processed dataset
Usage
Dataset$api_report(
id = self$igd_id,
access_token = ieugwasr::check_access_token()
)
Method api_gwas_release()
Release a dataset
Usage
Dataset$api_gwas_release(
comments = NULL,
passed_qc = "True",
id = self$igd_id,
access_token = ieugwasr::check_access_token()
)