From 3ec6bee128dc24267e1bab926e627f287449e6df Mon Sep 17 00:00:00 2001 From: pcastellanoescuder Date: Wed, 13 Dec 2023 15:56:38 -0500 Subject: [PATCH] add protein function predictions --- NAMESPACE | 1 + R/tables.R | 24 +++++++++++++++++++ man/make_cluster_enrichment_table.Rd | 1 - ...make_protein_function_predictions_table.Rd | 21 ++++++++++++++++ 4 files changed, 46 insertions(+), 1 deletion(-) create mode 100644 man/make_protein_function_predictions_table.Rd diff --git a/NAMESPACE b/NAMESPACE index 1090583..64e6b06 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -75,6 +75,7 @@ export(make_molecular_features_table) export(make_molecule_structure) export(make_pathway_table) export(make_protein_domain) +export(make_protein_function_predictions_table) export(make_protein_sequence) export(make_proteinsize) export(make_pubmed) diff --git a/R/tables.R b/R/tables.R index 0e59ee0..bba3cb1 100644 --- a/R/tables.R +++ b/R/tables.R @@ -290,6 +290,30 @@ make_humananatogram_table <- function(input = list()) { message(e) }) } + +# CAMPBELL MODEL PREDICTIONS ----------------------------------------------- +#' Predicted Protein Functions +#' +#' @param input Expecting a list containing a content variable. +#' @return Returns a table with the predicted protein functions. +#' +#' @importFrom magrittr %>% +#' +#' @export +#' @examples +#' make_protein_function_predictions_table(input = list(content = 'ROCK1')) +#' make_protein_function_predictions_table(input = list(content = c('ROCK1', 'ROCK2'))) +make_protein_function_predictions_table <- function(input = list()) { + predicted_functions <- get_data_object(object_names = input$content, + dataset_name = "protein_function_predictions", + pivotwider = TRUE) %>% + dplyr::mutate(Pval = as.numeric(Pvalue), FDR = as.numeric(AdjPvalue)) %>% + dplyr::mutate_if(is.numeric, ~ signif(., digits = 3)) %>% + dplyr::select(Query = id, `Predicted Function` = Function, Pval, FDR) + + return(predicted_functions) +} + ## GET CLUSTER ----------------------------------------------- #' Clustering Table #' diff --git a/man/make_cluster_enrichment_table.Rd b/man/make_cluster_enrichment_table.Rd index ebeed28..c95aa54 100644 --- a/man/make_cluster_enrichment_table.Rd +++ b/man/make_cluster_enrichment_table.Rd @@ -17,7 +17,6 @@ This is a table function that takes a gene name and returns a clustering enrichm } \examples{ make_cluster_enrichment_table(input = list(type = 'gene', content = 'ROCK1')) -make_cluster_enrichment_table(input = list(type = 'gene', content = 'ROCK1'), ontology = "MF") make_cluster_enrichment_table(input = list(type = 'gene', content = c('ROCK1', 'ROCK2'))) \dontrun{ make_cluster_enrichment_table(input = list(type = 'gene', content = 'ROCK1')) diff --git a/man/make_protein_function_predictions_table.Rd b/man/make_protein_function_predictions_table.Rd new file mode 100644 index 0000000..0478af7 --- /dev/null +++ b/man/make_protein_function_predictions_table.Rd @@ -0,0 +1,21 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/tables.R +\name{make_protein_function_predictions_table} +\alias{make_protein_function_predictions_table} +\title{Predicted Protein Functions} +\usage{ +make_protein_function_predictions_table(input = list()) +} +\arguments{ +\item{input}{Expecting a list containing a content variable.} +} +\value{ +Returns a table with the predicted protein functions. +} +\description{ +Predicted Protein Functions +} +\examples{ +make_protein_function_predictions_table(input = list(content = 'ROCK1')) +make_protein_function_predictions_table(input = list(content = c('ROCK1', 'ROCK2'))) +}