Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
custom
Zonari_mPBHSCexp_2025
Zonari_mPBHSCexp_2025_scRNAseq
Commits
fe1537a3
Commit
fe1537a3
authored
Apr 14, 2026
by
Matteo Barcella
Browse files
Updating script adding code for producing fig2D
parent
6eee7648
Changes
1
Show whitespace changes
Inline
Side-by-side
Senescence_HSC_Bulk_Focus_fig2C_dataset.R
View file @
fe1537a3
...
...
@@ -11,7 +11,7 @@ library(clusterProfiler)
library
(
ComplexHeatmap
)
library
(
circlize
)
outdir
<-
"HSC_vs_Bulk_Focus_Supplemental_2C/"
outdir
<-
"HSC_vs_Bulk_Focus_Supplemental_2C
D
/"
dir.create
(
outdir
)
obj_fig2C
<-
readRDS
(
"Fig2C_Dataset.rds"
)
...
...
@@ -141,3 +141,60 @@ p <- Heatmap(heatmap_mat_t,
draw
(
p
,
padding
=
unit
(
c
(
2
,
2
,
2
,
10
),
"mm"
))
# c(bottom, left, top, right)
dev.off
()
# fig Supplemental 2D
######### only TP53 ########
genes
<-
c
(
"TP53"
)
df
<-
FetchData
(
object
=
obj_fig2C_Cs
,
vars
=
c
(
genes
,
"Timepoint.f"
,
"Group"
,
"GroupTimepoint"
)
)
df_long
<-
df
|>
tidyr
::
pivot_longer
(
cols
=
all_of
(
genes
),
names_to
=
"Gene"
,
values_to
=
"expr"
)
ggplot
(
df_long
,
aes
(
x
=
Timepoint.f
,
y
=
expr
,
fill
=
Group
))
+
geom_boxplot
(
position
=
position_dodge
(
width
=
0.8
))
+
#facet_wrap(~ Gene, nrow = 1) +
theme_bw
()
+
labs
(
x
=
"Timepoint"
,
y
=
"Expression"
,
fill
=
"Group"
)
# line plot
df_summary
<-
df_long
|>
group_by
(
Gene
,
Timepoint.f
,
Group
)
|>
summarise
(
mean_expr
=
mean
(
expr
),
median_expr
=
median
(
expr
),
.groups
=
"drop"
)
mean_plot
<-
ggplot
(
df_summary
,
aes
(
x
=
Timepoint.f
,
y
=
mean_expr
,
color
=
Group
,
group
=
Group
))
+
geom_line
()
+
geom_point
()
+
# facet_wrap(~ Gene, nrow = 1) +
theme_bw
()
+
theme
(
axis.title.x
=
element_blank
())
median_plot
<-
ggplot
(
df_summary
,
aes
(
x
=
Timepoint.f
,
y
=
median_expr
,
color
=
Group
,
group
=
Group
))
+
geom_line
()
+
geom_point
()
+
# facet_wrap(~ Gene, nrow = 1) +
theme_bw
()
+
theme
(
axis.title.x
=
element_blank
())
pdf
(
file
=
paste0
(
outdir
,
"Fig_S2D_p53_expression_across_culture.pdf"
),
width
=
3
,
height
=
3
)
mean_plot
+
labs
(
color
=
""
)
+
ylab
(
"Average Expression"
)
+
ggtitle
(
"TP53 expression"
)
+
theme
(
legend.position
=
c
(
0.8
,
0.2
),
axis.text
=
element_text
(
size
=
10
),
plot.title
=
element_text
(
hjust
=
0.5
))
dev.off
()
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment