knitr::opts_chunk$set(eval = FALSE)
install.packages()
install.packages('remotes')
remotes::install_github("sidora-tools/sidora.core")
These steps are necessary every time you want to connect to the Pandora server (not the website!):
ssh -L 10001:pandora.eva.mpg.de:3306 \ <your username>@daghead1
This means that the database server now listens on your computer at 127.0.0.1:10001
.
We can actually send direct queries to the server there, e.g.
mysql --host=localhost --port=10001 \ --user=<secret> --password=<secret> pandora \ -e "select Sampled_Quantity from TAB_Sample"
But working with R and sidora.core might be more convinient for many applications
.credentials
file somewhere on your computer<host name of the database server> <port of the database server> <database username> <database password>
127.0.0.1 10001 <database username> <database password>
.credentials
filecon <- sidora.core::get_pandora_connection( "<path to your .credentials file>" )
con
object is what most functions in sidora.core need to run and retrieve information from the Pandora databaseThere are two options:
data.frame
s into your computer's memory and run all computations theresidora.core::get_df("TAB_Site", con) %>% dplyr::filter(site.Country == "Germany")
get_df()
is directly compatible with the tidyverseCountry
-> site.Country
Creation_Date
-> library.Creation_Date
sidora.core::get_con("TAB_Site", con) %>% dplyr::filter(Country == "Germany") %>% tibble::as_tibble()
Multiple tables can be downloaded with get_df_list()
and automatically joined with join_pandora_tables()
sidora.core::get_df_list(c( "TAB_Individual", "TAB_Sample" ), con = con) %>% sidora.core::join_pandora_tables()
TAB_Site > TAB_Individual > TAB_Sample > TAB_Extract > TAB_Library > TAB_Capture > TAB_Sequencing > TAB_Raw_Data > TAB_Analysis
sidora.core::make_complete_table_list( c("TAB_Site", "TAB_Capture") )
Some values in Pandora are only ids referencing lookup tables (e.g. Worker
).
sidora.core::get_df("TAB_Library", con) %$% library.Worker %>% unique()
c(22, 4, 15, ...)
sidora.core::get_df("TAB_Library", con) %>% sidora.core::convert_all_ids_to_values(con) %$% library.Worker %>% unique()
c("Marieke van de Loosdrecht","Alissa Mittnik","Antje Wissgott", ...)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.