Skip to content

Commit

Permalink
check no-tumor
Browse files Browse the repository at this point in the history
  • Loading branch information
olapuentesantana committed May 24, 2024
1 parent 13fce9c commit f79a240
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions R/compute_TF_activity.R
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,8 @@
#' )
compute_TF_activity <- function(RNA_tpm = NULL,
regulon_net = c("collectri", "dorothea"),
verbose = TRUE) {
verbose = TRUE,
tumor = TRUE) {
# Some checks
if (is.null(RNA_tpm)) stop("TPM gene expression data not found")
if (length(regulon_net) > 1) stop("Please select just one regulon network")
Expand All @@ -73,10 +74,14 @@ compute_TF_activity <- function(RNA_tpm = NULL,

# Log transformed expression matrix (log2[tpm+1]):
# expression matrix scaled and recentered.
gene_expr <- calc_z_score(t(tpm),
mean = TCGA_mean_pancancer,
sd = TCGA_sd_pancancer
)
if(tumor){
gene_expr <- calc_z_score(t(tpm),
mean = TCGA_mean_pancancer,
sd = TCGA_sd_pancancer
)
}else{
gene_expr <- calc_z_score(t(tpm))
}

# redefine gene names to match TF-target network
E <- t(gene_expr)
Expand Down

0 comments on commit f79a240

Please sign in to comment.