forked from SCA-IRCM/Demo
-
Notifications
You must be signed in to change notification settings - Fork 0
/
example.R
41 lines (28 loc) · 1.23 KB
/
example.R
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
library(SingleCellSignalR)
# Define your working directory
setwd("~/example/")
# Define the file of interest you want to work with
file = "example_dataset.txt"
# Prepare the data for the analysis
data = data_prepare(file = file)
genes = rownames(data)
# Proceed to clustering
clust = clustering(data = data,n = 10, method = "simlr")
cluster = clust$cluster
tsne = clust$`t-SNE`
# Cell classification
my.markers = markers(c("immune"))
class = cell_classifier(data=data, genes=genes, markers = my.markers)
# Cluster analysis
clust.ana = cluster_analysis(data = data, genes = genes, cluster = cluster, markers = my.markers)
# Proceed to cell signaling
signal = cell_signaling(data = data, genes = genes, cluster = cluster,species = "homo sapiens")
# Visualization
visualize(inter = signal)
visualize(inter = signal, show.in = c(5))
expression.plot(data = data, name = "CD14", tsne = tsne)
expression.plot.2(data = data, name.1 = "CD40LG", name.2 = "CD40", tsne = tsne)
# Create interface network
inter.net = inter_network(data = data, signal = signal, genes = genes, cluster = cluster)
# Show interactions downstream a specific receptor
intra = intra_network(goi = "S1PR1",data = data,genes = genes,cluster = cluster,coi="cluster 3",signal=signal)