-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathapply_SoptSC.m
45 lines (41 loc) · 2.21 KB
/
apply_SoptSC.m
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
40
41
42
43
44
45
% Using SoptSC to qualitatively characterize cell-cell communications
%Wang, Shuxiong, et al. "Cell lineage and communication network inference
%via optimization for single-cell transcriptomics." Nucleic acids research
%47.11 (2019): e66-e66.
%TGFB signaling pathway
%load SCC gene expression matrix with clustring result
addpath('data');
load('SCC_SoptSC.mat')
%ligands
Lig = {'Tgfb1','Tgfb2','Tgfb3','Tgfb1','Tgfb2','Tgfb3','Tgfb1','Tgfb2','Tgfb3','Tgfb1','Tgfb2','Tgfb3'};
%rescprtors
Rec = {'Tgfbr1','Tgfbr1','Tgfbr1','Tgfbr2','Tgfbr2','Tgfbr2','Acvr1','Acvr1','Acvr1','Acvr1b','Acvr1b','Acvr1b','Acvr1c','Acvr1c','Acvr1c'};
%targer genes
target_up = {'Fn1','Vtn','Cdh2','Col1a1','Col1a2','Mmp2','Mmp3','Mmp9'...
,'Twist1','Twist2','Ids','Zeb1','Zeb2'...
,'Sparc','Itga5','Itgb3','Ncam','Vim','Acta2','Plau','Dab2','Hic5','Tgfb1i1','Hmga2'};
target_down = {'Ocln','Cldn1','Cldn2','Cldn3','Cldn4','Cldn5','Cldn6','Cldn7','Cldn8'...
,'Cldn9','Cldn10','Cldn11','Cldn12','Cldn13','Cldn14','Cldn15','Cldn16'...
,'Cldn17','Cldn18','Cldn19','Cldn20','Cldn21','Cldn22','Cldn23','Cd34'...
,'Cdh1','Dsp','Pkp1','Pkp2','Pkp3','Crb3','Ck5','Ck14','Ck8','Ck18'...
,'Crb3','Esr1'};
%find the above genes in the entire gene set
%use Matlab code of SoptSC
addpath('Cell_Cell_Communication');
[Lig,Rec] = ligand_receptor_in_list(allgenes,Lig,Rec);
target_up = intersect(allgenes,target_up,'stable');
target_down = intersect(allgenes,target_down,'stable');
%compute cell-cell & cluster_cluster interactions
[P_cell_each_lr,P_cell_agg,P_cluster_each_lr,P_cluster_agg] = ...
LR_Interaction(data_raw_log',allgenes,cell_clustering_index,Lig,Rec,target_up,target_down);
%% plot aggegration of cluster-cluster interations (aggegration of all l-r pair)
figname = 'Cluster-cluster-interaction-agg';
threshold = 0;
cluster_id = 1:No_cluster;
folder='Plot';
plot_sig_network(P_cluster_agg,cluster_id,threshold,cluster_label,folder,figname,mycolor1);
%% plot heatmap of each L-R pairs
cluster_lab_lr = ones(size(Lig,1),1);
P_dot_size = dot_size_LR(data_raw_log',Lig,Rec,allgenes,cell_clustering_index);
plot_dot_heatmap(P_cluster_each_lr,P_dot_size,Lig,Rec,cluster_label',...
mycolor1,color_map,cluster_id,cluster_lab_lr,1,folder,'Dot_heatmap');