knitr::opts_chunk$set( fig.path = "figure/graphics-", cache.path = "cache/graphics-", fig.align = "center", external = TRUE, echo = TRUE, warning = FALSE ) library(rPHG) logFile <- tempfile(fileext = ".txt") configFile <- tempfile() rPHG:::createConfigFile(configFile)
The basic workflow of the rPHG
package is as follows:
This document introduces you to rPHG
's methods and grammar, and
shows you how to apply them to the previously mentioned workflow.
PHG databases can be connected through two primary sources:
Local connections are for databases set up to use PostgreSQL or SQLite management systems, typically located either on a local machine or hosted on a high performance compute cluster which are accessed via the PHG API.
Conversely, server connections are for databases served on publicly available web services leveraging Breeding API (BrAPI) endpoints for data retrieval. For example, demo.hub.maizegenetics.net is a publicly available PHG database housing information many known diversity populations in maize.
To set up a local connection, prior knowledge about how configuration files are set up is needed. If you would like more information about this topic, please see the vignette "Overview of configuration files"
We can supply a path to a valid configuration file to the constructor,
PHGLocalCon()
:
configFile |> PHGLocalCon()
Here, our configuration file path (configFilePath
) is parsed to
create an object of type PHGLocalCon
.
If you would like to use a PHG web service, we can use the following similar method:
"phg.maizegdb.org" |> PHGServerCon()
Here, a URL pointing to a PHG web service is supplied to the
constructor PHGServerCon()
which will be parsed to create an object
of type PHGServerCon
.
configFile |> PHGLocalCon() |> showPHGMethods()
configFile |> PHGLocalCon() |> PHGMethod("PATH_METHOD")
configFile |> PHGLocalCon() |> PHGMethod("PATH_METHOD") |> readSamples()
configFile |> PHGLocalCon() |> PHGMethod("PATH_METHOD") |> readRefRanges()
configFile |> PHGLocalCon() |> PHGMethod("PATH_METHOD") |> readHaplotypeIds()
PHGDataSet
objectsconfigFile |> PHGLocalCon() |> PHGMethod("PATH_METHOD") |> readPHGDataSet()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.