Functions

Server functions

GeneNetworkAPI.gn_url — Function
gn_url()

Return the default GeneNetwork server API URL.

All user-level functions optionally take a GeneNetwork server URL that could be different from the standard URL in case one wanted to query a different instance of the server.

Example

julia> gn_url()
"https://genenetwork.org/api/v_pre1/"
source
GeneNetworkAPI.check_gn — Function
check_gn(url::AbstractString)

Check if GeneNetwork server is responding properly.

Returns the HTTP status code (200 if successful) and prints a message.

Example

julia> check_gn()
GeneNetwork is alive.
200
source

List what's in the database

GeneNetworkAPI.list_groups — Function
list_groups(species::String="";gn_url::String=gn_url())

If species is not specified, then it returns all groups (segregating populations) represented in the GeneNetwork database. If the string species is specified, then it returns all groups for that species.

source
GeneNetworkAPI.list_species — Function
list_species(species::String="";gn_url::String=gn_url())

Returns a data frame with a list of species respresented in the GeneNetwork database. If the species string is non-empty, it will return the information of the matched species.

source
GeneNetworkAPI.list_geno — Function
list_geno(group::String; gn_url::String=gn_url())

Returns a data frame with the location name of the different geno files of a group, and if available some metadata such as strain of the first filial generation, maternal and paternal strain. If there exist more than one location, the default location is indicated by a *.

source

Get data and information

GeneNetworkAPI.get_geno — Function
get_geno(group::String,format::String="geno";gn_url::String=gn_url())

Returns the genotype matrix for a group in a given format.

Currently works only for files in the geno format.

source
GeneNetworkAPI.get_pheno — Function
get_pheno(dataset::String;gn_url::String=gn_url())

Returns the non-omic ("clinical") phenotypes for a given dataset.


get_pheno(dataset::String,trait::String; gn_url::String=gn_url())

Returns a given trait in a group.

source
GeneNetworkAPI.info_dataset — Function
info_dataset(dataset::String, trait::String=""; gn_url::String = gn_url())

Returns information about a dataset (if trait is empty), or else a given trait in a specified dataset.

source
GeneNetworkAPI.info_pheno — Function
info_pheno(group::String; gn_url::String=gn_url())

Returns the maximum LRS for each trait in a group`.

source
info_pheno(group::String, trait::String; gn_url::String=gn_url())

Returns the maximum LRS for each trait in a group, or alternatively a probe (use trait) in dataset (use group).

source

Download data

GeneNetworkAPI.download_geno — Function
download_geno(group::String,format::String="geno";
                gn_url::String=gn_url(),
                path::String = "")

Download the genotype matrix for a group in a given format.

Currently works only for files in the geno format.

The file will be downloaded in path location, if path is not specified, then the file will be a temporary file.

source
GeneNetworkAPI.download_pheno — Function
download_pheno(dataset::String;gn_url::String=gn_url())

Downloads the non-omic ("clinical") phenotypes for a given dataset. The file will be downloaded in path location, if path is not specified, then the file will be a temporary file.

source
GeneNetworkAPI.download_omics — Function
download_omics(dataset::String; 
                gn_url::String=gn_url(), 
                path::String = tempname())

Download the omic phenotypes for a given dataset. The file will be downloaded in path location, if path is not specified, then the file will be a temporary file.

source

Display table

Utils

GeneNetworkAPI.make_rectangular — Function

makerectangular(varrays::Vector{Vector{T}} where T)

Takes an array of arrays of any type and make it a matrix of String. Arrays can be of different type and length. To make the data rectangular, it uses the filler argument, by default filler is an empty string.

Example 1

julia> myArrayOfArrays = [["A1","A2", "A3"], ["B1", "B2"], ["C1","C2"]];
julia> make_rectangular(test)
3×3 Matrix{String}:
"A1"  "B1"  "C1"
"A2"  "B2"  "C2"
"A3"  ""    ""

Example 2

julia> myArrayOfArrays = [["A1","A2", "A3"], [1, 2], ["C1","C2"]];
julia> make_rectangular(test)
3×3 Matrix{String}:
"A1"  "1"  "C1"
"A2"  "2"  "C2"
"A3"  ""    ""
source
GeneNetworkAPI.has_error_500 — Function
has_error_500(s::String)

Returns true if the server encountered an internal error and was unable to complete the request, otherwise it returns false.

source
GeneNetworkAPI.genofile_location — Function
genofile_location(json_parsed::Dict)

Returns a vector of String containing the location of geno files for a group.


genofile_location(group::String)

Returns a vector of String containing the location of geno files for a group.

source
GeneNetworkAPI.has_genofile_meta — Function
has_genofile_meta(group::String; gn_url::String=gn_url())

Returns true if the group's genotype files possesse metadata that may contain alternative location of the files.

source

Run jobs on the server

GeneNetworkAPI.run_correlation — Function
run_correlation(trait::String, dataset::String, group::String; tp:;String="sample",
                method::String="pearson", n_result::Int64=500,
                gn_url::String=gn_url())

This function correlates a trait in a dataset against all traits in a target database (group).

This query currently takes the following parameters:

  • trait (required): trait ID for which the correlation is wanted
  • dataset (required): dataset in which the trait occurs (use the short abbreviation)
  • group (required): group in which which the comparisons will be performed
  • tp: sample (default) | tissue
  • method: pearson (default) | spearman
  • n_result: maximum number of results to return (default = 500)
source
GeneNetworkAPI.run_gemma — Function
run_gemma(dataset::String,trait::String; use_loco::Bool=false, maf::Float64=0.01,
    gn_url::String=gn_url())

Runs GEMMA with the specified trait in the specified dataset. Optional arguments include:

  • use_loco (default=false): if LOCO (leave one chromosome out) should be used
  • maf (default=0.01): the minimum minor allele frequency of the markers to be scanned
source
GeneNetworkAPI.run_rqtl — Function
function run_rqtl(dataset::String, trait::String; method::String="hk",
              model::String="normal", n_perm::Int64=0,
              control_marker::String="",
              gn_url::String=gn_url())

Runs R/qtl's scanone function with the specified trait in the specified dataset.

Some optional arguments have analogs in options in the parent scanone function. See the help for that function.

Optional arguments inlcude:

  • method (default="hk"): possible values are
    • hk: Haley-Knott method
    • em: EM algorithm
    • ehk: Extended EM algorithm
    • imp: multiple imputation
    • mr: marker regression dropping individuals with missing genotypes
    • mr-imp: marker regression filling in missing data with a single imputation
    • mr-argmax: marker regression filling in by the Viterbi algorithm
  • model (default="normal"): model for trait given genotypes; possible values are
    • normal: equivalent to linear regression with complete data
    • binary: equivalent to logistic regression with complete data
    • 2part: two-part model for trait given genotype
    • np: non-parametric analysis
  • n_perm (default=0) number of permutations to perform
  • control_marker: name of marker to control for as an additive covariate
source