Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
184 commits
Select commit Hold shift + click to select a range
df2f956
initial exploration with signaturesearch
lizzyjoan Nov 24, 2025
5a0ece6
initial exploration with signaturesearch
lizzyjoan Nov 24, 2025
b85bfe0
Update signatures by prioritizing ENTREZ-mappable genes (required for…
lizzyjoan Nov 24, 2025
18f480b
Update signatures by prioritizing ENTREZ-mappable genes (required for…
lizzyjoan Nov 24, 2025
e780823
annotate LINCS drugs, analyze signature reversion results
lizzyjoan Nov 24, 2025
c9a37e8
annotate LINCS drugs, analyze signature reversion results
lizzyjoan Nov 24, 2025
389dc59
drug target analyses
lizzyjoan Nov 25, 2025
0afe1bb
drug target analyses
lizzyjoan Nov 25, 2025
4df6dd2
cleanup code, comment out argparse for nvim interactive coding
lizzyjoan Nov 25, 2025
501f07c
cleanup code, comment out argparse for nvim interactive coding
lizzyjoan Nov 25, 2025
c94a02c
prep for analyzing other signatures from otehr methods
lizzyjoan Nov 25, 2025
4f6f76e
prep for analyzing other signatures from otehr methods
lizzyjoan Nov 25, 2025
6302176
rm accidental file
lizzyjoan Nov 25, 2025
3e14ca9
rm accidental file
lizzyjoan Nov 25, 2025
a8f769b
Merge branch 'dea' of github.com:lasseignelab/setbp1_hd into sigsearch
lizzyjoan Nov 25, 2025
6575b4b
Merge branch 'dea' of github.com:lasseignelab/setbp1_hd into sigsearch
lizzyjoan Nov 25, 2025
7f4dd47
updated run with fixed signatures
lizzyjoan Nov 25, 2025
120ea0f
updated run with fixed signatures
lizzyjoan Nov 25, 2025
ce68020
run signaturesearch with meta analysis signature (instead of composit…
lizzyjoan Nov 25, 2025
ae2f1d7
run signaturesearch with meta analysis signature (instead of composit…
lizzyjoan Nov 25, 2025
3d69c35
analysis for each method signature and fixed filenames
lizzyjoan Nov 25, 2025
d590240
analysis for each method signature and fixed filenames
lizzyjoan Nov 25, 2025
cac9cf4
update composite sig analysis -- select top 100 up/down by genes in l…
lizzyjoan Dec 1, 2025
5342112
update composite sig analysis -- select top 100 up/down by genes in l…
lizzyjoan Dec 1, 2025
83b2d47
Merge branch 'dea' of github.com:lasseignelab/setbp1_hd into sigsearch
lizzyjoan Dec 2, 2025
c3d77b2
Merge branch 'dea' of github.com:lasseignelab/setbp1_hd into sigsearch
lizzyjoan Dec 2, 2025
a165b18
further exploration of drug targets:
lizzyjoan Dec 3, 2025
83a22eb
further exploration of drug targets:
lizzyjoan Dec 3, 2025
31d5efb
rm dea verifications -- seperate PR
lizzyjoan Dec 3, 2025
5aee535
use all contrasts for finding signatures
lizzyjoan Dec 4, 2025
f3464ee
Merge branch 'consensus' of github.com:lasseignelab/setbp1_hd into co…
lizzyjoan Dec 4, 2025
9a44c49
exclude redundant contrasts for signatures
lizzyjoan Dec 4, 2025
963c399
update with prioritzed setbp1 targets
lizzyjoan Dec 4, 2025
077cb83
update with prioritzed setbp1 targets
lizzyjoan Dec 4, 2025
df9995c
comparing to 'core genes' indicated in previous studies and added cov…
lizzyjoan Dec 8, 2025
597ab3b
add wong et al DEGs for validation
lizzyjoan Dec 10, 2025
9b1c5e4
save meta analysis logFC with RRA for directionality, updated arg parse
lizzyjoan Dec 10, 2025
4d01a2e
Merge branch 'consensus' of github.com:lasseignelab/setbp1_hd into si…
lizzyjoan Dec 10, 2025
6518a38
Merge branch 'consensus' of github.com:lasseignelab/setbp1_hd into si…
lizzyjoan Dec 10, 2025
1b03795
run with updated RRA signature
lizzyjoan Dec 10, 2025
6faebea
run with updated RRA signature
lizzyjoan Dec 10, 2025
7d7e48d
simplify ORA code, improve plots
lizzyjoan Dec 10, 2025
92ead6e
reorganize code, rm dead code, improve commenting
lizzyjoan Dec 11, 2025
c7f51f3
adjust thresholds for RRA, meta-analysis signature
lizzyjoan Dec 11, 2025
5eb7e2f
update with refined RRA-meta analysis signature
lizzyjoan Dec 11, 2025
47e3ac9
update with refined RRA-meta analysis signature
lizzyjoan Dec 11, 2025
9277258
add gene set pathways as heatmap annotations
lizzyjoan Dec 12, 2025
cd174e4
RRA: split gene lists by direction prior to ranking -- very messy code
lizzyjoan Dec 12, 2025
079e5e7
Merge branch 'consensus' of github.com:lasseignelab/setbp1_hd into si…
lizzyjoan Dec 12, 2025
6e91420
Merge branch 'consensus' of github.com:lasseignelab/setbp1_hd into si…
lizzyjoan Dec 12, 2025
e574714
run with direction-split RRA signature
lizzyjoan Dec 12, 2025
688cdd0
run with direction-split RRA signature
lizzyjoan Dec 12, 2025
779d1ab
returned to RRA without splitting by direction first
lizzyjoan Dec 14, 2025
4aadfe6
simplify code, rm dead code
lizzyjoan Dec 14, 2025
e79fa11
rearrange code, improve variable names
lizzyjoan Dec 15, 2025
e75b3d3
update filenames, clean up old files
lizzyjoan Dec 15, 2025
b0415a4
update filenames, clean up old files
lizzyjoan Dec 15, 2025
a6bc336
cleanup plots, files
lizzyjoan Dec 15, 2025
a36fc28
Merge branch 'main' of github.com:lasseignelab/setbp1_hd into consensus
lizzyjoan Dec 15, 2025
a6668d4
fresh run after merging main
lizzyjoan Dec 15, 2025
fa6a8e5
rm msigdb download -- switched to pulling genesets via gprofiler2
lizzyjoan Dec 15, 2025
6d1bd41
add number for selecting top n DEGs by method as a user argument
lizzyjoan Dec 15, 2025
dcb7881
update for symlinking wong data
lizzyjoan Dec 15, 2025
ebcb038
Merge branch 'consensus' of github.com:lasseignelab/setbp1_hd into si…
lizzyjoan Dec 15, 2025
4f1602e
Merge branch 'consensus' of github.com:lasseignelab/setbp1_hd into si…
lizzyjoan Dec 15, 2025
00c6f10
running with RRA signature without direction-splitting prior to RRA
lizzyjoan Dec 15, 2025
6306dd8
running with RRA signature without direction-splitting prior to RRA
lizzyjoan Dec 15, 2025
f04da86
moved files around, added slurm job script, removed dead code
lizzyjoan Dec 17, 2025
852fd78
moved files around, added slurm job script, removed dead code
lizzyjoan Dec 17, 2025
b07adf7
rm old remnant code
lizzyjoan Dec 17, 2025
83992d3
Merge branch 'main' of github.com:lasseignelab/setbp1_hd into consensus
lizzyjoan Dec 17, 2025
bb67ca9
clean up filenames and plots
lizzyjoan Dec 17, 2025
e2e55f6
clean up filenames and plots
lizzyjoan Dec 17, 2025
cb27acf
plot drugs with inverse signature in multiple cell lines
lizzyjoan Dec 19, 2025
18263b0
plot drugs with inverse signature in multiple cell lines
lizzyjoan Dec 19, 2025
0049091
fix plotting to include all cell lines for drugs with a top WTCS
lizzyjoan Dec 19, 2025
294bc49
fix plotting to include all cell lines for drugs with a top WTCS
lizzyjoan Dec 19, 2025
2488cd8
Merge pull request #6 from lasseignelab/consensus
lizzyjoan Jan 6, 2026
bc406d4
Merge branch 'main' of github.com:lasseignelab/setbp1_hd into sigsearch
lizzyjoan Jan 6, 2026
85181c8
Merge branch 'main' of github.com:lasseignelab/setbp1_hd into sigsearch
lizzyjoan Jan 6, 2026
815db67
update run with updated consensus signature
lizzyjoan Jan 8, 2026
e82b22f
update run with updated consensus signature
lizzyjoan Jan 8, 2026
a83d5ee
analyze drug target results
lizzyjoan Jan 8, 2026
0322579
analyze drug target results
lizzyjoan Jan 8, 2026
b1e68d2
attempt to pull dailymed data for a set of test drugs
lizzyjoan Jan 16, 2026
eac325c
attempt to pull dailymed data for a set of test drugs
lizzyjoan Jan 16, 2026
60e5443
more specific searching for sections and keywords
lizzyjoan Jan 20, 2026
3f3203c
more specific searching for sections and keywords
lizzyjoan Jan 20, 2026
bf0af42
successfully runs but not finding sections using LIONC codes for any …
lizzyjoan Jan 26, 2026
4beaa9a
successfully runs but not finding sections using LIONC codes for any …
lizzyjoan Jan 26, 2026
bb7085b
temp workaround to format results for dailymed API script
lizzyjoan Jan 27, 2026
13c71c5
temp workaround to format results for dailymed API script
lizzyjoan Jan 27, 2026
948ffb6
updated script to pull XML isntead of JSON for individual drug SPLs
lizzyjoan Jan 27, 2026
decdfff
updated script to pull XML isntead of JSON for individual drug SPLs
lizzyjoan Jan 27, 2026
a5f9e71
update gitignore
Feb 3, 2026
7a54de0
update gitignore
Feb 3, 2026
dc98760
linting, formatting
Feb 3, 2026
0a89573
linting, formatting
Feb 3, 2026
c0158ca
linting, formatting
Feb 3, 2026
e52cf66
linting, formatting
Feb 3, 2026
6717b01
lint and style
lizzyjoan Feb 4, 2026
11eaf85
lint and style
lizzyjoan Feb 4, 2026
0b19d56
linting and formatting
Feb 4, 2026
efc2b77
linting and formatting
Feb 4, 2026
042693e
linting and formatting
Feb 4, 2026
892a2d0
linting and formatting
Feb 4, 2026
ba5e2fa
linting and formatting
Feb 4, 2026
65a6549
linting and formatting
Feb 4, 2026
25528d2
linting and formatting
Feb 4, 2026
89095c9
linting and formatting
Feb 4, 2026
9c7e2d7
lint and style
lizzyjoan Feb 4, 2026
7fc171e
lint and style
lizzyjoan Feb 4, 2026
ead0273
lint and sytle
lizzyjoan Feb 4, 2026
82aacf5
lint and sytle
lizzyjoan Feb 4, 2026
8b1f1db
update docker image to handle conflict between specific biocfilecache…
lizzyjoan Feb 9, 2026
d75c74e
update docker image to handle conflict between specific biocfilecache…
lizzyjoan Feb 9, 2026
0c2631e
add verification for sigsearch results
lizzyjoan Feb 11, 2026
c659a52
add verification for sigsearch results
lizzyjoan Feb 11, 2026
270ce6d
format and lint
lizzyjoan Feb 11, 2026
9a5a8ae
format and lint
lizzyjoan Feb 11, 2026
c46695b
move plotting script
lizzyjoan Feb 12, 2026
9ed148e
move plotting script
lizzyjoan Feb 12, 2026
fbcf719
compile figure 5
lizzyjoan Feb 12, 2026
4677b6c
compile figure 5
lizzyjoan Feb 12, 2026
2903d97
fix lintr errors
lizzyjoan Feb 12, 2026
5820134
fix lintr errors
lizzyjoan Feb 12, 2026
e5c1ae4
update comments and filepaths
lizzyjoan Feb 12, 2026
af2c6a5
update comments and filepaths
lizzyjoan Feb 12, 2026
f860818
update file and variable neames
lizzyjoan Feb 12, 2026
3221e7b
update file and variable neames
lizzyjoan Feb 12, 2026
a15bc46
combine DailyMed safety data with drug annotations
lizzyjoan Feb 12, 2026
db322ad
combine DailyMed safety data with drug annotations
lizzyjoan Feb 12, 2026
7b6a932
update filenames, add slurm script
lizzyjoan Feb 12, 2026
bd6688e
update filenames, add slurm script
lizzyjoan Feb 12, 2026
f16d497
cleanup commenting and print messages
lizzyjoan Feb 12, 2026
01c39ba
cleanup commenting and print messages
lizzyjoan Feb 12, 2026
a202fe3
rm old files
lizzyjoan Feb 12, 2026
1709b77
rm old files
lizzyjoan Feb 12, 2026
a88b7f2
rm old files
lizzyjoan Feb 13, 2026
e84d9bf
rm old files
lizzyjoan Feb 13, 2026
4711b09
updated files
lizzyjoan Feb 13, 2026
6301d4f
updated files
lizzyjoan Feb 13, 2026
a96f76c
make log messages prettier
lizzyjoan Feb 13, 2026
112dc83
make log messages prettier
lizzyjoan Feb 13, 2026
5efcd3e
rm old files
lizzyjoan Feb 13, 2026
efa4fc1
rm old files
lizzyjoan Feb 13, 2026
1696ef1
ignore helper lint/style script
lizzyjoan Feb 13, 2026
a1b67e1
ignore helper lint/style script
lizzyjoan Feb 13, 2026
67e91a1
ignore helper lint/style script
lizzyjoan Feb 13, 2026
fd40b8c
ignore helper lint/style script
lizzyjoan Feb 13, 2026
3dbba03
swapped plot, updated filenames
lizzyjoan Feb 13, 2026
77321e0
swapped plot, updated filenames
lizzyjoan Feb 13, 2026
168a1aa
force push SETBP1 target lists
lizzyjoan Feb 17, 2026
c626e27
force push SETBP1 target lists
lizzyjoan Feb 17, 2026
7cf761c
rm unused and redundant code
lizzyjoan Feb 17, 2026
6fc8a7a
rm unused and redundant code
lizzyjoan Feb 17, 2026
fa9de22
rm unnecessary code
lizzyjoan Feb 19, 2026
be6da26
rm unnecessary code
lizzyjoan Feb 19, 2026
828efb7
add non-reproducible disclaimer for DailyMed API use
lizzyjoan Feb 19, 2026
9cbe0f8
add non-reproducible disclaimer for DailyMed API use
lizzyjoan Feb 19, 2026
9e7a72a
API outputs not reproducible--removed verification
lizzyjoan Feb 19, 2026
b2e07f4
API outputs not reproducible--removed verification
lizzyjoan Feb 19, 2026
512d733
update verification for capture updates
lizzyjoan Mar 9, 2026
bdb1269
rm conflicting files before merging with main
lizzyjoan Mar 9, 2026
70eef9b
Merge branch 'sigsearch' of github.com:lasseignelab/setbp1_hd into si…
lizzyjoan Mar 9, 2026
ebd05c0
resolve gitignore merge conflict
lizzyjoan Mar 9, 2026
f6334aa
rm old verification output
lizzyjoan Mar 9, 2026
9145e90
ignore lintr/styler helper script
lizzyjoan Apr 1, 2026
304eb28
run with updated SETBP1 targets + prioritized targets
lizzyjoan Apr 2, 2026
fe2b421
add pediatric drug safety excerpts
lizzyjoan Apr 2, 2026
9b39e6c
run with updated SETBP1 targets + prioritized targets
lizzyjoan Apr 2, 2026
9aae5b3
update verifications
lizzyjoan Apr 2, 2026
35b18f2
lint and style
lizzyjoan Apr 2, 2026
6b4ccbd
update drug safety filepath
lizzyjoan Apr 2, 2026
e15d9aa
update safety data run and filepath
lizzyjoan Apr 2, 2026
0956053
update safety data run and filepath
lizzyjoan Apr 2, 2026
389a583
fix filepath to rm redundancy
lizzyjoan Apr 2, 2026
5368f69
fix linter error
lizzyjoan Apr 2, 2026
6635091
update full SETBP1 targets list
lizzyjoan Apr 3, 2026
7b79f92
Merge branch 'prioritize_targets' of github.com:lasseignelab/setbp1_h…
lizzyjoan Apr 10, 2026
15337d9
update SETBP1 targets and prioritized targets
lizzyjoan Apr 10, 2026
0f7b963
update run with updated SETBP1 targets
lizzyjoan Apr 10, 2026
a096250
Merge branch 'main' of github.com:lasseignelab/setbp1_hd into sigsearch
lizzyjoan Apr 14, 2026
66215a8
fixed plot label and added convergent drug candidates table
lizzyjoan Apr 14, 2026
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
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -241,6 +241,10 @@ bin/conda/work/
bin/conda/work/*
bin/conda/.nextflow/
bin/container/*
<<<<<<< HEAD
bin/docker/
src/lint_and_style.sh
src/lint_and_style.sh
results/permutation_analysis/aggregate_gene_exp_mat.csv
Rplots.pdf
src/lint_and_style.sh
Expand Down
3 changes: 3 additions & 0 deletions config/environments/lasseignelab.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ cap_data_link "$LASSEIGNE_LAB_PATH/PROJECT_dir/setbp1_hd/tanaka"
# Wong et al 2025 source data to validate DEGs
cap_data_link "$LASSEIGNE_LAB_PATH/PROJECT_dir/setbp1_hd/wong"

# DailyMed drug safety data
cap_data_link "$LASSEIGNE_LAB_PATH/PROJECT_dir/setbp1_hd/dailymed"

# Brainspan and GTEx counts data
cap_data_link "$LASSEIGNE_LAB_PATH/DATASET_dir/brainspan"
cap_data_link "$LASSEIGNE_LAB_PATH/DATASET_dir/gtex"
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added results/figures/approved_drugs_top_moa.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added results/figures/drug_targets_histogram.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added results/figures/figure_5.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
161 changes: 161 additions & 0 deletions results/figures/full_drug_safety_anno_table.csv

Large diffs are not rendered by default.

137 changes: 137 additions & 0 deletions results/figures/setbp1_converge_drug_anno_table.csv

Large diffs are not rendered by default.

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added results/figures/setbp1_drugs_shared.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added results/figures/setbp1_drugs_shared_phase.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added results/figures/setbp1_drugs_shared_targets.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
137 changes: 137 additions & 0 deletions results/signature_reversion/approved_drugs_res.csv

Large diffs are not rendered by default.

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
282 changes: 282 additions & 0 deletions results/signature_reversion/brain_drugs_filtered.csv

Large diffs are not rendered by default.

2,366 changes: 2,366 additions & 0 deletions results/signature_reversion/drug_target_degs.csv

Large diffs are not rendered by default.

Binary file not shown.
1,165 changes: 1,165 additions & 0 deletions results/signature_reversion/lincs_braincells_results.csv

Large diffs are not rendered by default.

Binary file added results/signature_reversion/lincs_results.rds
Binary file not shown.
33 changes: 33 additions & 0 deletions results/signature_reversion/setbp1_drug_targets.csv

Large diffs are not rendered by default.

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
16 changes: 16 additions & 0 deletions src/11_job_sigsearch.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#!/bin/bash

#SBATCH --ntasks=1
#SBATCH --mem-per-cpu=32G
#SBATCH --partition=express

cap_container -c singularity "lizzyr/sigsearch:1.0.0"

singularity exec --cleanenv \
--containall \
-B "${CAP_PROJECT_PATH}" \
-B "${LASSEIGNE_LAB_PATH}" \
"${CAP_CONTAINER_PATH}"/sigsearch_1.0.0.sif \
Rscript --vanilla "${CAP_PROJECT_PATH}"/src/11_signature_reversion.R \
-i "${CAP_DATA_PATH}"/ \
-o "${CAP_RESULTS_PATH}"/
202 changes: 202 additions & 0 deletions src/11_signature_reversion.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,202 @@
suppressPackageStartupMessages({
library(argparse)
library(tidyverse)
library(recount3)
library(signatureSearch)
library(ExperimentHub)
library(rhdf5)
})

# create parser object
parser <- ArgumentParser()

parser$add_argument("-i", "--input_dir",
type = "character",
metavar = "PATH",
help = "Path to data directory"
)
parser$add_argument("-o", "--output_dir",
type = "character",
metavar = "PATH",
help = "Path to the results directory to read consensus signature and write signatureSearch results" # nolint
)

# get command line options, if help option encountered print help and exit
args <- parser$parse_args()

# source functions file if supplied
if (!is.null(args$functions)) source(args$functions)

# start timer
ptm <- proc.time()

#### Set variables for dataset ####

datapath <- args$input_dir
resdir <- args$output_dir
filepath <- paste0(resdir, "signature_reversion/")
querypath <- paste0(resdir, "consensus_signature/")
cachedir <- paste0(datapath, "ExperimentHubCache")
message("Location of cache directory: ", cachedir)

# create dirs if needed
if (!dir.exists(filepath)) dir.create(filepath, recursive = TRUE)
if (!dir.exists(cachedir)) dir.create(cachedir, recursive = TRUE)

###### EXPERIMENT HUB SET UP ######

setExperimentHubOption("ASK", FALSE)
setExperimentHubOption("CACHE", cachedir)

# Force a clean load of the hub
Sys.setenv(EXPERIMENT_HUB_CACHE = cachedir)
eh <- ExperimentHub(localHub = FALSE)

# lincs 2020 filepath and db exploration
message("Loading in lincs2 EH db...")
lincs2 <- eh[["EH7297"]]

# load LINCS perturbation annotations
data(lincs_pert_info2)
message("Loading in lincs2 annotation EH db...")

###### READ IN DATA ######

# RRA signature
rra_degs <- read_csv(
paste0(querypath, "rankaggregate_consensus_signature.csv")
)
# SETBP1 regulatory targets
# Curated targets by Sasha Taluri
setbp1_targets_all <- read_csv(paste0(
datapath, "260403_setbp1_targets.csv"
))
# Prioritized targets from coexpression & pathway analysis
setbp1_targets_top <- read_csv(paste0(
resdir, "permutation_analysis/prioritized_setbp1_targets.csv"
))
Comment thread
lizzyjoan marked this conversation as resolved.

###### PREPARE QUERY SIGNATURE ######

# genes available in LINCS DB
db_genes <- h5read(lincs2, "rownames", drop = TRUE)

# up vs down DEGs in signature
degs_up <- rra_degs %>%
mutate(entrez = as.character(entrez)) %>%
filter(meta_logFC > 0.1) %>%
filter(entrez %in% db_genes) %>%
slice_min(Score, n = 100)
cat("Up genes summary... ", summary(degs_up), "\n", sep = " ")

degs_down <- rra_degs %>%
mutate(entrez = as.character(entrez)) %>%
filter(meta_logFC < -0.1) %>%
filter(entrez %in% db_genes) %>%
slice_min(Score, n = 100)
cat("Down genes summary... ", summary(degs_down), "\n", sep = " ")

###### SIGNATURE REVERSION ######

# query LINCS signatures
qsig_lincs <- qSig(
query = list(upset = degs_up$entrez, downset = degs_down$entrez),
gess_method = "LINCS",
refdb = lincs2
)

# calculate signature reversion metrics of query vs LINCS DB
lincs <- gess_lincs(qsig_lincs, sortby = "WTCS", tau = FALSE, workers = 1)
str(lincs)
write_rds(lincs, paste0(filepath, "lincs_results.rds"))

# filter for brain/CNS-derived/relevant cells (HEK cells often used in neuro)
brain_cells <- c("NEU", "SHSY5Y", "NPC", "HEK293", "HEK293T")
lincs_brain <- lincs@result %>%
filter(cell %in% brain_cells) %>%
filter(WTCS < 0) %>%
arrange(WTCS)
head(lincs_brain)
write_csv(lincs_brain, paste0(filepath, "lincs_braincells_results.csv"))

# annotate drugs
brain_drugs_anno <- lincs_brain %>%
left_join(lincs_pert_info2, by = c("pert" = "pert_id"))
cat(
"Number of unique reversion drugs in brain-relevant cells: ",
length(unique(brain_drugs_anno$pert)), "\n",
sep = " "
)

write_rds(
brain_drugs_anno, paste0(filepath, "lincs_anno_braincell_results.rds")
)

###### TARGET ANALYSIS ######
# separate targets by rows to compare drug targets
brain_drug_targets <- brain_drugs_anno %>%
dplyr::select(
pert, pref_name, max_phase, cell, WTCS,
WTCS_Pval, mergeTargets, Target_pathway
) %>%
separate_longer_delim(mergeTargets, delim = "; ") %>%
filter(!is.na(mergeTargets)) %>%
add_count(mergeTargets) %>%
# annotate targets that are prioritized SETBP1 regulatory targets
mutate(
SETBP1_target = ifelse(
mergeTargets %in% setbp1_targets_all$Target, TRUE, FALSE
),
SETBP1_top_target = ifelse(
mergeTargets %in% setbp1_targets_top$Target_Gene, TRUE, FALSE
)
)

# filter for drugs that target any SETBP1 regulatory targets
drug_targets_setbp1 <- brain_drug_targets %>%
filter(SETBP1_target == TRUE) %>%
distinct()
str(drug_targets_setbp1)
print(n = 21, arrange(drug_targets_setbp1, pref_name))

cat(
"Drugs that target SETBP1 targets: ",
unique(drug_targets_setbp1$pref_name),
"\n",
sep = " "
)
cat(
"Drug target SETBP1 targets: ",
unique(drug_targets_setbp1$mergeTargets),
"\n",
sep = " "
)
write_csv(
drug_targets_setbp1, paste0(filepath, "setbp1_drug_targets.csv")
)

# full drug annotations for setbp1-target-targeting drugs

setbp1_drugs <- brain_drugs_anno %>%
filter(pert %in% drug_targets_setbp1$pert)


#### APPROVED/POST-MARKET DRUGS ####
approved_drugs <- brain_drugs_anno %>%
# max WTCS to help with plot ordering
group_by(pref_name) %>%
mutate(drug_top_WTCS = min(WTCS)) %>%
ungroup() %>%
add_count(pert) %>%
# filter for approved drugs
filter(max_phase == 4)

write_csv(approved_drugs, paste0(filepath, "approved_drugs_res.csv"))


# end timer
fptm <- proc.time()
(fptm[3] / 60)

# session info
print(sessionInfo())
Loading
Loading