Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 8 additions & 7 deletions 3-SOCIAL & SPECIAL/SOCIAL & SPECIAL Function/SOCIAL_SPECIAL.R
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
## SOCIAL & SPECIAL
## Correction on 03/05/26
library(tidyverse)
library(Matrix)
library(parallel)
Expand Down Expand Up @@ -101,9 +102,9 @@ SOCIAL.calculate_interaction_score <- function(expr,ct_map, pairs, n_iterations
else
ligand_exp = as.numeric(summary_expr[g1,ct1])
if(length(g2) > 1)
receptor_exp = min(as.numeric(summary_expr[g2,ct1]))
receptor_exp = min(as.numeric(summary_expr[g2,ct2])) # 3/5/26: corrected ct1 to ct2
else
receptor_exp = as.numeric(summary_expr[g2,ct1])
receptor_exp = as.numeric(summary_expr[g2,ct2]) # 3/5/26: corrected ct1 to ct2

#interaction score
sc = ligand_exp*receptor_exp
Expand Down Expand Up @@ -139,9 +140,9 @@ SOCIAL.calculate_interaction_score <- function(expr,ct_map, pairs, n_iterations
score = c()
receptor_exp = NULL
if(length(g2) > 1)
receptor_exp = min(as.numeric(summary_expr[g2,ct1]))
receptor_exp = min(as.numeric(summary_expr[g2,ct2])) # 3/5/26: corrected ct1 to ct2
else
receptor_exp = as.numeric(summary_expr[g2,ct1])
receptor_exp = as.numeric(summary_expr[g2,ct2]) # 3/5/26: corrected ct1 to ct2

#receptor expression
sc = receptor_exp
Expand Down Expand Up @@ -191,9 +192,9 @@ SOCIAL.calculate_interaction_score <- function(expr,ct_map, pairs, n_iterations
else
ligand_exp = as.numeric(summary_expr[g1,ct1])
if(length(g2) > 1)
receptor_exp = min(as.numeric(summary_expr[g2,ct1]))
receptor_exp = min(as.numeric(summary_expr[g2,ct2])) # 3/5/26: corrected ct1 to ct2
else
receptor_exp = as.numeric(summary_expr[g2,ct1])
receptor_exp = as.numeric(summary_expr[g2,ct2]) # 3/5/26: corrected ct1 to ct2

#null score
sc = ligand_exp*receptor_exp
Expand Down Expand Up @@ -747,4 +748,4 @@ run_special_rslurm <- function(index, path_input, path_special, name, n_iteratio
#run SPECIAL step 1 and 2
results = SPECIAL(expr, pairs, loc, name, n_iterations, path_special, distance, platform, puck_diameter)
return(results)
}
}