R/GNapi is an R package for connecting to the GeneNetwork API.
Install GNapi from R universe:
install.packages("GNapi", repos="https://rqtl.r-universe.dev")
Alternatively, install it from GitHub with the remotes package:
#install.packages("remotes")
library(remotes)
install_github("rqtl/GNapi")
For an understanding of the GeneNetwork API, see its documentation, as well as Zachary Sloan's tutorial.
The R/GNapi package has a set of functions for connecting to the GeneNetwork API to grab different bits of information or data.
check_gn() - Check connection.list_species() - List available species.list_groups("drosophila") - List available groups of datasetslist_datasets("BXD") - List available datasets for a given group
(here, "BXD").list_datasets(dataset="CB_M_1004_P") - Get meta information about a data set.info_pheno("BXD", "10038") - Get summary information for a phenotypeget_pheno("BXD", "10646") - Get phenotype values for a classical trait.get_geno("BXD") - Get genotypes for a group.run_gemma("BXDPublish", "10015") - Perform a genome scan with gemma
run_rqtl("BXDPublish", "10015") - Perform a genome scan with R/qtl
run_correlation("HC_M2_0606_P", "BXDPublish", "1427571_at") - Finds traits that are correlated with a given trait.For further examples, see the online vignette, which is also available from within R:
vignette("GNapi")
Note that we enforce a delay between calls to the API, to slow
repeated calls within a loop. The default is 1 sec; it can be
controlled with the option GNapi_delay. For example, to make the
delay 0.5 seconds, use:
options(GNapi_delay=0.5)
R/GNapi is released under the MIT license.