BigQuery (relational database)
Introduction
BigQuery is a database technology useful in storing and analyzing large and complex datasets like longitudinal data in FinnGen. This makes it easier for user to query, using SQL, subset of data much faster than reading entire dataset and then filter out. Queried data can be directly inserted into downstream analysis.
Data
finngen-production-library project/database contains phenotype data for different release of FINNGEN data. The data in this project/database comes from LIBRARY_RED and LIBRARY_GREEN folders within Sandbox IVM folders.
The table below lists the available BigQuery tables. Additionally, to get the most recent list directly in Sandbox, type the below commands in RStudio. The list of tables will be visible under the "Connections" tab.
library(bigrquery)
projectid<-"fg-production-sandbox-nro" ##replace nro with your sandbox number
bq_con<-dbConnect(bigrquery::bigquery(),
project="finngen-production-library",
billing=projectid)finngen-production-library
sandbox_tools_r{RELEASE}
finngen_r13_service_sector_detailed_longitudinal_v1
LIBRARY_RED
DF13
code_counts_r12_v1
Code Counts
LIBRARY_RED
DF12
fg_codes_info_v10
Code translation info table
LIBRARY_GREEN
finngen_results_r13
Achilles tables
LIBRARY_RED
DF13
bq command-line tool
It is also possible to access the BigQuery tables using bq command-line tool which is a Python-based command-line tool. bq command-line tool can be used to run queries.
Before running a query, users can check how much does it cost of running query using bq command-line tool
The dry run will not execute the query but rather gives out how much data it consumes. In general, queries are priced using on-demand with estimate of $6.25 per Tebibyte (TiB). More details on pricing structure can be found here.
Google Cloud BigQuery python and R drivers
It is also possible to use google cloud BigQuery python and R drivers to access data directly from IVM.
See a tutorial video about how to conduct BigQuery using Python and R scripts from Users' meeting recordings (at 30min 2sec).
Use cases
Links on how to connect to BigQuery in R and Python along with some use cases for downstream analysis
Example Python script:
Example R script:
Last updated
Was this helpful?