Skip to content

Commit c7114e6

Browse files
committed
updates
1 parent 4d66290 commit c7114e6

File tree

2 files changed

+27
-11
lines changed

2 files changed

+27
-11
lines changed

figures_run.R

Lines changed: 23 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2994,7 +2994,7 @@ ggplot(table.m[grepl("F1|Balanced", table.m$variable),], aes(stim, value, fill =
29942994
theme_bw(base_size = 20)+facet_grid(~variable)+theme(axis.text.x = element_text(angle = 45, vjust = 1, hjust=1))
29952995

29962996

2997-
# Figure 5h
2997+
# Figure 5h Gene Ontology----
29982998
# biological functions---
29992999
library(clusterProfiler)
30003000
library(enrichplot)
@@ -3007,6 +3007,7 @@ library(enrichplot)
30073007
library(enrichTF);library(RcisTarget)
30083008
library(org.Mm.eg.db)
30093009
library(DOSE)
3010+
library(reshape2)
30103011

30113012
collect_all = read.delim("./infotheo/SLEMI_singlegene_M0M1M2_ISnorm_500genes.txt")
30123013
dcast0 = dcast(collect_all[!grepl("0.25|0.5hr|^5hr|1hr|8h|24hr", collect_all$time),], gene~type+time, value.var = "cc")
@@ -3022,6 +3023,7 @@ dcast0$groups = ifelse((dcast0$clusterM1=="DOWN" & dcast0$clusterM2=="DOWN"), "b
30223023
ifelse(dcast0$clusterM2=="DOWN" , "M2onlyDOWN",
30233024
"bothUP"
30243025
)))
3026+
write.table(dcast0,"F://scRNAseq_macro/SuppTables/TableS6_GOgroups.txt", quote=F,row.names = F, sep = "\t")
30253027

30263028
genes.to.label = c("Cxcl10","Tgtp1","Rsad2","Irf7","Trim21","Ifi205","Gbp7",
30273029
"Ccl5", "Tnf", "Tnfaip3","Gclm", "Il6",
@@ -3470,8 +3472,11 @@ p1
34703472
library(scales)
34713473
macro = readRDS("./output/macrophage_PMexpts_Feb2021_rmUnstim_500genes_DBEC.rds");
34723474
# macro = readRDS("./output/macrophage_PMexpts_Feb2021_500genes_DBEC.rds");
3473-
p1=DimPlot(macro, reduction = "tsne", group.by = "type")
3474-
p2=FeaturePlot(macro, reduction = "tsne",ncol = 2, features = c("Pilra","Il1b", "Serpinb2", "Retnla"))
3475+
colors_list = (c(PM_B6.LFD="#F8766D",PM_B6.old="#00BA38",PM_B6.HFD="#619CFF"))
3476+
p1=DimPlot(macro, reduction = "tsne", group.by = "type")+
3477+
scale_color_manual(values= colors_list)
3478+
p1
3479+
p2=FeaturePlot(macro, reduction = "tsne",ncol = 2, features = c("Retnla","Serpinb2","Cd14", "Pilra" ))
34753480
p2
34763481
colors_list = c('CpG'="#F8766D", 'IFNb'="#B79F00",'LPS'= "#00BA38",'P3CSK'= "#00BFC4",'PIC'= "#619CFF",'TNF'= "#F564E3",
34773482
'Unstim'="black",'Unselected' = "gray")
@@ -4153,6 +4158,8 @@ pheatmap(frame.truncate[,c(2,4,6,5,3)]*-1, scale = "none", clustering_method = "
41534158
# annotatePeaks.pl tss mm10 -list ./../genes2GRSclusters_allNFkB.txt -size -1000,500 -hist 10 -m ap1.motif irf3.motif nfkb.motif srf.motif > output_allnfkb_genes.txt
41544159

41554160
#plot motif bars
4161+
if(1){
4162+
library(stringr)
41564163
assignGRS =readxl::read_excel("F://BACKUP_USB_20200710_active/Projects_writing/response-specificity/CellSystems_sub/TableS4_gene_regulatory_strategies_allgenes.xlsx")
41574164
assignGRS$HOMER_AP1 = gsub("\\s*\\([^\\)]+\\)","",as.character(assignGRS$HOMER_AP1))
41584165
assignGRS$HOMER_NFkB = gsub("\\s*\\([^\\)]+\\)","",as.character(assignGRS$HOMER_NFkB))
@@ -4162,23 +4169,31 @@ assignGRS$HOMER_AP1 = lapply(lapply(lapply(str_split(assignGRS$HOMER_AP1, ","),
41624169
assignGRS$HOMER_NFkB = lapply(lapply(lapply(str_split(assignGRS$HOMER_NFkB, ","), FUN = as.numeric), FUN = abs),FUN=min)
41634170
assignGRS$HOMER_IRF = lapply(lapply(lapply(str_split(assignGRS$HOMER_IRF, ","), FUN = as.numeric), FUN = abs),FUN=min)
41644171

4165-
dist2TSS = 250
4172+
dist2TSS = 300
41664173
assignGRS$HOMER_AP1 = ifelse(assignGRS$HOMER_AP1>dist2TSS|assignGRS$HOMER_AP1==0|assignGRS$HOMER_AP1=="NA"|is.na(assignGRS$HOMER_AP1),NA,"AP1")
41674174
assignGRS$HOMER_NFkB = ifelse(assignGRS$HOMER_NFkB>dist2TSS|assignGRS$HOMER_NFkB==0|assignGRS$HOMER_NFkB=="NA"|is.na(assignGRS$HOMER_NFkB),NA,"NFkB")
41684175
assignGRS$HOMER_IRF = ifelse(assignGRS$HOMER_IRF>dist2TSS|assignGRS$HOMER_IRF==0|assignGRS$HOMER_IRF=="NA"|is.na(assignGRS$HOMER_IRF),NA,"IRF")
41694176

4170-
assignGRS$AREs = ifelse(assignGRS$AREs==1, NA, assignGRS$AREs)
4177+
assignGRS$AREs = ifelse(assignGRS$AREs>=2, "NFkB&p38", NA)
41714178

4172-
assignGRS.m = melt(assignGRS[,c(1,4,5,6,7,8,10:12,3)], id.vars = "gene")
4179+
write.table(assignGRS[,c(1:3,5, 7:8, 14, 9,11:13, 4)], "F://scRNAseq_macro/SuppTables/TableS4_gene_regulatory_strategies_allgenes_refs.txt", quote =F, sep = "\t", row.names = F)
4180+
assignGRS.m = melt(assignGRS[,c(1,5, 7:8, 14, 9,11:13, 4)], id.vars = "gene")
41734181
assignGRS.m$rank = seq(1:nrow(assignGRS))
41744182
# ggplot(subset(assignGRS.m,!is.na(value)), aes(rank,variable)) +
41754183
# geom_point(aes(color = value), size =2, alpha=0.5, shape=18)+#position = position_jitter(w = 0, h = 0.2)) +
41764184
# # geom_point(subset(assignGRS.m,is.na(value)),aes(color = value), alpha =0.5,position = position_jitter(w = 0, h = 0.2)) +
41774185
# theme_bw() +
41784186
# theme(axis.text.x=element_text(angle=60, hjust=1))
41794187

4180-
ggplot(subset(assignGRS.m,!is.na(value)), aes(rank)) + facet_wrap(~variable,ncol = 1)+
4188+
ggplot(subset(assignGRS.m,!is.na(value)), aes(rank)) + facet_wrap(~variable,ncol = 1, strip.position = "left")+
41814189
geom_bar(aes(color = value), size =0.5, alpha=0.5)+#position = position_jitter(w = 0, h = 0.2)) +
41824190
# geom_point(subset(assignGRS.m,is.na(value)),aes(color = value), alpha =0.5,position = position_jitter(w = 0, h = 0.2)) +
4183-
theme_bw() +
4191+
theme_bw(base_size = 10) +
41844192
theme(axis.text.x=element_text(angle=60, hjust=1))
4193+
}
4194+
4195+
#plot ActD data----
4196+
ggplot(assignGRS, aes(clusters, (ActD_HLchange_3hr), color = clusters) )+
4197+
geom_violin()+geom_point(position = "jitter")+ylim(-500,1000)
4198+
4199+

genes2GRS/README.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,11 @@ where fA, fN, fI, and fIN are logic gates for transcription factor acitivities a
2525
fIN<-(1.0-k0)*(((ktN*nfkb)^n+(ktI*irf)^n+(ktN*ktI*nfkb*irf)^n)/(1.0+(ktN*nfkb)^n+(ktI*irf)^n+(ktN*ktI*nfkb*irf)^n))+k0
2626
```
2727

28-
Simulating these GRSs and normalizing to max across all stimuli results in distinctive gene expression patterns for each GRS, and the best match was assigned to individual genes as an initial inference of the gene's regulatory strategy.
28+
Simulating these GRSs and normalizing to max across all stimuli results in distinctive gene expression patterns for each GRS, and the best match was assigned to individual genes as an initial inference of the gene's regulatory strategy (Table S4).
2929

3030
![Simulation of all GRSs](./plots/simulation_all.png)
3131

32-
For example, Dusp8 was assigned to AP1, and Ifit1 was assigned to IRF.
32+
For example, Dusp8 was assigned to AP1, Ifit1 to IRF, and Tnf to NFκB.
3333
![Dusp8 bulk dynamics](./plots/data_Dusp8.png)
34-
![Ifit1 bulk dynamics](./plots/data_Ifit1.png)
34+
![Ifit1 bulk dynamics](./plots/data_Ifit1.png)
35+
![Tnf bulk dynamics](./plots/data_Tnf.png)

0 commit comments

Comments
 (0)