R/extendr-wrappers.R

Defines functions nta_rust rust_multiomics_ora ora_rust gsea_rust fill_input_data_frame

Documented in fill_input_data_frame gsea_rust nta_rust ora_rust rust_multiomics_ora

# Generated by extendr: Do not edit by hand

# nolint start

#
# This file was created with the following call:
#   .Call("wrap__make_WebGestaltR_wrappers", use_symbols = TRUE, package_name = "WebGestaltR")

#' @docType package
#' @usage NULL
#' @useDynLib WebGestaltR, .registration = TRUE
NULL

#' Fill relation data frame for GSEA input
#'
#' Fill 1 for gene in gene set
#'
#' See https://github.com/extendr/extendr/issues/612 for how to export DataFrame
#'
#' ## Diagram
#' ```shell
#'         Gene Sets
#'       ┌───────────┐  First column named 'gene' containing gene name
#'       │A0100110100│  1 = in set
#' Genes │B0100101000│  0 = not in set
#'       │C1011101001│  Due to limitiations with extendr-api v 0.6.0,
#'       └───────────┘  function returns a list, and the R package will
#'                      add the first 'gene' column
#' ```
#' @param gmt A Data Frame with geneSet and gene columns from the GMT file
#' @param genes A vector of genes
#' @param gene_sets A vector of gene sets
#'
#' @return A Data Frame with the first column of gene and 1 or 0 for other columns of gene sets.
#' @author John Elizarraras
#' @name fill_input_data_frame
#' @keywords internal
fill_input_data_frame <- function(gmt, genes, gene_sets) .Call(wrap__fill_input_data_frame, gmt, genes, gene_sets)

#' Run GSEA using rust library
#' @param min_overlap the minimum overlap between analyte set and analyte list
#' @param max_overlap the maximum overlap between analyte set and analyte list
#' @param permutations the number of permutations to run
#' @param sets A vector of analyte set names
#' @param parts A list of the analytse in the analyte sets
#' @param analytes A vector of analytes names in the GSEA list
#' @param ranks A vector of ranks for the analytes in the GSEA list
#' @return List of the results of GSEA
#' @author John Elizarraras
#' @keywords internal
#' @name gsea_rust
gsea_rust <- function(min_overlap, max_overlap, permutations, sets, parts, analytes, ranks) .Call(wrap__gsea_rust, min_overlap, max_overlap, permutations, sets, parts, analytes, ranks)

#' Run ORA using Rust library
#' @name ora_rust
#' @param sets A vector of analyte set names
#' @param parts A list of the analyte in the analyte sets
#' @param interest A vector of analytes of interest
#' @param reference A vector of analytes in the reference set
#' @returns A list of the results of ORA
#' @author John Elizarraras
#' @keywords internal
ora_rust <- function(sets, parts, interest, reference) .Call(wrap__ora_rust, sets, parts, interest, reference)

#' Run multiomics ORA using Rust library
#' @param sets list of  the names of the analyte sets
#' @param big_part_vec list of the analyte in the analyte sets
#' @param interest list of analytes of interest
#' @param reference list of analytes in the reference set
#' @param method meta-analysis method to get meta-p values
#' @returns A list of vectors containing the results of ORA, with each list corresponding to each input list
#' @author John Elizarraras
#' @keywords internal
rust_multiomics_ora <- function(sets, big_part_vec, interest, reference, method) .Call(wrap__rust_multiomics_ora, sets, big_part_vec, interest, reference, method)

#' Calculate random walk permutations for a network from seeds
#' @name nta_rust
#' @param edge_list A list of edges
#' @param seeds A list of seeds
#' @return A list of nodes and scores
#' @author John Elizarraras
#' @keywords internal
nta_rust <- function(edge_list, seeds) .Call(wrap__nta_rust, edge_list, seeds)


# nolint end
bzhanglab/WebGestaltR documentation built on May 3, 2024, 12:19 a.m.