Repository navigation
Expand file tree
/
Copy pathdownstream.py
More file actions
40 lines (33 loc) · 2.3 KB
/
Copy pathdownstream.py
File metadata and controls
40 lines (33 loc) · 2.3 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
"""
aggregate analysis for after we do analysis of each dataset and each method
"""
from library import *
unique_perturbations = set(['SH3PXD2A', 'EMCN', 'RAB11FIP3', 'CKAP5', 'POLR2K'] + ['VWF', 'HNRNPA3', 'TRIM13', 'CORO1C', 'DDX27', 'PACSIN2']) ##set of perturbations that are only present in either treated OR untreated condition, but not both
control_strings = set(["SAFE_TARGET", "NO-TARGET"])
min_sample = 10
significance_thresh = 0.05 ####sometimes we want a higher significance threshold than 0.05 to decrease false negative error (type II) at cost of having higher false positive error (type I)
##analyses related to latent spaces
compare_method_replicate_similarity()
enrichment_runner(min_sample=min_sample)
plot_de_per_target()
plot_cosines(top_n=500000, plot_type="similarity", min_sample=min_sample)
compare_method_rankings(ranking_method="RBO", min_sample=min_sample)
compare_method_rankings(ranking_method="Percent Overlap at Top 10", min_sample=min_sample)
compare_method_rankings(ranking_method="Percent Overlap at Top 25", min_sample=min_sample)
compare_method_rankings(ranking_method="Percent Overlap at Top 50", min_sample=min_sample)
method_ranking_heatmap(top_n=10, weighted=False, min_sample=min_sample)
volcano_plot_target_genes(target_genes=["RELA", "ST8SIA6", "FBXW11", "RBCK1", "NFKBIZ"], logfc_threshold=1.0, pval_threshold=0.05)
##cell count representation analysis
cell_count_representation_analysis(metric="cosine") ##compute intensive
plot_cell_count_representation_analysis(metric="cosine")
##enrichr + gsea
for desired_anchor_state in ["SAFE_TARGET"]:
call_gsea(statistic="FDR q-val", significance_thresh=0.05, rank_score="similarity", desired_anchor_state=desired_anchor_state, methods=["random", "state", "scgpt", "scimilarity", "umap", "raw", "chatgpt5.0", "compbio_direct", "compbio_untreated_direct", "pca"], min_sample=0.0, top_ns=[100, 50])
for gene_set_type in ["top_n"]:
rank_vs_enrichment(batch_size=64, min_sample=0.0, gene_set_type=gene_set_type) ##compute intensive
plot_rank_vs_enrichment(gene_set_type=gene_set_type)
##analyze dataset
plot_replicate_count(adata_path="data/scgpt_imru_full_processed.h5ad", control_strings=set(["SAFE_TARGET", "NO-TARGET"]))
data_stats("data/imru_full.h5ad")
get_knockdown_efficiencies_Replogle(control_strings)
plot_knockdown_efficiencies()