Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release 3 17 #33

Merged
merged 9 commits into from
May 26, 2023
6 changes: 5 additions & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ Imports:
progeny,
easierData,
dorothea (>= 1.6.0),
decoupleR,
quantiseqr,
ROCR,
grDevices,
Expand All @@ -51,18 +52,21 @@ Imports:
DESeq2,
utils,
dplyr,
tidyr,
tibble,
matrixStats,
rlang,
BiocParallel,
reshape2,
rstatix,
ggrepel,
magrittr,
coin
Suggests:
knitr, rmarkdown, BiocStyle, testthat, SummarizedExperiment
biocViews: GeneExpression, Software, Transcription, SystemsBiology, Pathways, GeneSetEnrichment, ImmunoOncology, Epigenetics, Classification, BiomedicalInformatics, Regression, ExperimentHubSoftware
VignetteBuilder: knitr
Encoding: UTF-8
Roxygen: list(markdown = TRUE)
RoxygenNote: 7.2.1
RoxygenNote: 7.2.3
Config/testthat/edition: 3
5 changes: 4 additions & 1 deletion NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ export(explore_biomarkers)
export(predict_immune_response)
export(retrieve_easier_score)
import(ggplot2)
import(magrittr)
importFrom(BiocParallel,MulticoreParam)
importFrom(BiocParallel,bplapply)
importFrom(BiocParallel,register)
Expand All @@ -24,7 +25,7 @@ importFrom(ROCR,performance)
importFrom(ROCR,plot)
importFrom(ROCR,prediction)
importFrom(coin,pvalue)
importFrom(dorothea,run_viper)
importFrom(decoupleR,run_viper)
importFrom(dplyr,filter)
importFrom(easierData,get_HGNC_annotation)
importFrom(easierData,get_TCGA_mean_pancancer)
Expand Down Expand Up @@ -64,6 +65,8 @@ importFrom(stats,prcomp)
importFrom(stats,quantile)
importFrom(stats,sd)
importFrom(stats,var)
importFrom(tibble,column_to_rownames)
importFrom(tidyr,pivot_wider)
importFrom(utils,View)
importFrom(utils,combn)
importFrom(utils,data)
Expand Down
2 changes: 2 additions & 0 deletions R/compute_LR_pairs.R
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,8 @@ compute_LR_pairs <- function(RNA_tpm = NULL,
colnames(LR_pairs_computed)[pos_keep] <- combo_name
LR_pairs_computed <- LR_pairs_computed[, -pos_remove]
}
# Remove LR pairs with all NA values
LR_pairs_computed <- LR_pairs_computed[, !is.na(apply(LR_pairs_computed, 2, sum))]

if (verbose) message("Ligand-Receptor pair weights computed \n")
return(as.data.frame(LR_pairs_computed))
Expand Down
33 changes: 22 additions & 11 deletions R/compute_TF_activity.R
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,12 @@
#' the estimation of human transcription factor activities."
#' Genome Research. 2019. DOI: 10.1101/gr.240663.118.
#'
#' @importFrom dorothea run_viper
#' @import magrittr
#' @importFrom stats na.exclude
#' @importFrom dplyr filter
#' @importFrom decoupleR run_viper
#' @importFrom tidyr pivot_wider
#' @importFrom tibble column_to_rownames
#' @importFrom easierData get_TCGA_mean_pancancer get_TCGA_sd_pancancer
#'
#' @param RNA_tpm data.frame containing TPM values with HGNC symbols
Expand Down Expand Up @@ -93,17 +96,25 @@ compute_TF_activity <- function(RNA_tpm = NULL,
round(length(genes_kept) / length(all_regulated_transcripts), 3) * 100, "%)"
)
}
# TF activity: run viper
tf_activity <- dorothea::run_viper(
input = E, regulons = regulons,
options = list(
method = "none", minsize = 4, eset.filter = FALSE,
cores = 1, verbose = FALSE
)
)

# Samples as rows, TFs as columns
tf_activity <- t(tf_activity)
# Remove genes with all NA/Inf values
E <- E[!is.na(apply(E, 1, sum)), ]
E <- E[!is.infinite(apply(E, 1, sum)), ]

# TF activity: run viper
tf_activity_df <- decoupleR::run_viper(mat = E,
network = regulons,
.source = "tf",
minsize = 4,
eset.filter = FALSE,
method = "none",
verbose = FALSE)
# To matrix
tf_activity <- tf_activity_df %>%
tidyr::pivot_wider(id_cols = condition,
names_from = source,
values_from = score) %>%
tibble::column_to_rownames("condition")

if (verbose) message("TF activity computed! \n")

Expand Down
2 changes: 1 addition & 1 deletion vignettes/easier_user_manual.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ knitr::opts_chunk$set(
```

```{r setup, include = FALSE}
library("easier")
#library("easier")
```

# Introduction {#introduction}
Expand Down
Loading