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
73467876
Commit
73467876
authored
Aug 04, 2025
by
Matteo Barcella
Browse files
Adding scripts for reproducing images 2C to 2G
parent
f6fb9139
Changes
2
Show whitespace changes
Inline
Side-by-side
Figures_2CDEF.R
0 → 100644
View file @
73467876
# script for figures 2C,D,E,F
## loading libraries
library
(
Seurat
)
library
(
ggplot2
)
library
(
ggplotify
)
library
(
ggraph
)
library
(
ggrepel
)
library
(
ggpubr
)
library
(
ComplexHeatmap
)
library
(
gridExtra
)
library
(
RColorBrewer
)
library
(
dittoSeq
)
library
(
openxlsx
)
library
(
reshape2
)
library
(
ggalluvial
)
library
(
dplyr
)
# load seurat object
obj
<-
readRDS
(
"CultureDataset.rds"
)
# setting color palette:
colpalette
<-
c
(
"#A6CEE3"
,
"#B2DF8A"
,
"#FDBF6F"
,
"#E78AC3"
,
"#FFFF99"
,
"#E31A1C"
,
"darkgrey"
)
## Figure 2C
pdf
(
file
=
"Fig2C.pdf"
,
width
=
4
,
height
=
4
)
dittoSeq
::
dittoDimPlot
(
object
=
obj
,
reduction.use
=
"umap.harmony.orig.ident"
,
var
=
"Population"
,
opacity
=
0.6
,
do.label
=
T
,
labels.size
=
5
,
labels.highlight
=
F
,
labels.repel
=
T
,
size
=
0.6
)
+
scale_color_manual
(
values
=
colpalette
)
+
theme
(
legend.position
=
"none"
,
plot.title
=
element_blank
(),
axis.text
=
element_text
(
size
=
16
,
color
=
"black"
))
dev.off
()
## Figure 2D
pdf
(
file
=
"Fig2D.pdf"
,
width
=
4
,
height
=
4
)
ggplot
(
data
=
g
,
aes
(
x
=
Sample
,
y
=
Frequency
,
alluvium
=
Population
))
+
geom_alluvium
(
aes
(
fill
=
Population
),
alpha
=
.5
,
decreasing
=
FALSE
,
width
=
1
/
4
)
+
geom_stratum
(
aes
(
stratum
=
Population
,
fill
=
Population
),
alpha
=
.50
,
decreasing
=
FALSE
,
width
=
1
/
4
)
+
scale_fill_manual
(
values
=
alpha
(
colour
=
colpalette
,
alpha
=
0.50
))
+
theme_void
()
+
theme
(
legend.position
=
"none"
,
plot.title
=
element_blank
(),
axis.title
=
element_blank
(),
panel.background
=
element_rect
(
fill
=
"white"
),
axis.text
=
element_text
(
size
=
16
,
color
=
"black"
))
dev.off
()
## Figure 2E
obj_sorted
<-
subset
(
obj
,
cells
=
WhichCells
(
object
=
obj
,
expression
=
orig.ident
%in%
c
(
"S10"
,
"S11"
,
"S12"
)))
obj_sorted
$
Sorting
<-
obj_sorted
$
orig.ident
obj_sorted
$
Sorting
<-
gsub
(
x
=
obj_sorted
$
Sorting
,
pattern
=
"S10"
,
replacement
=
"CD38-"
)
obj_sorted
$
Sorting
<-
gsub
(
x
=
obj_sorted
$
Sorting
,
pattern
=
"S11"
,
replacement
=
"GMP"
)
obj_sorted
$
Sorting
<-
gsub
(
x
=
obj_sorted
$
Sorting
,
pattern
=
"S12"
,
replacement
=
"MEP"
)
obj_sorted
$
Sorting
<-
factor
(
obj_sorted
$
Sorting
,
levels
=
c
(
"CD38-"
,
"GMP"
,
"MEP"
))
cols_sorted
<-
list
(
"CD38-"
=
"#008744"
,
"GMP"
=
"#0057e7"
,
"MEP"
=
"#d62d20"
)
obj_sorted
<-
SetIdent
(
obj_sorted
,
value
=
"Sorting"
)
obj_sorted
$
sortcol
<-
cols_sorted
$
`CD38-`
obj_sorted
$
sortcol
[
which
(
obj_sorted
$
Sorting
==
"GMP"
)]
<-
cols_sorted
$
GMP
obj_sorted
$
sortcol
[
which
(
obj_sorted
$
Sorting
==
"MEP"
)]
<-
cols_sorted
$
MEP
p
<-
dittoDimPlot
(
object
=
obj_sorted
,
var
=
"Sorting"
,
color.panel
=
cols_sorted
,
show.others
=
T
,
split.nrow
=
1
,
split.by
=
"Sorting"
,
labels.highlight
=
F
,
labels.repel
=
T
,
contour.color
=
"darkgrey"
,
labels.size
=
3.5
,
do.contour
=
T
,
contour.linetype
=
2
,
reduction.use
=
"umap.harmony.orig.ident"
,
size
=
0.5
,
do.label
=
F
)
+
theme
(
legend.position
=
"none"
,
legend.key.size
=
unit
(
x
=
0.1
,
units
=
"in"
),
strip.background.x
=
element_rect
(
fill
=
"white"
),
strip.text.x.bottom
=
element_text
(
size
=
12
),
plot.title
=
element_blank
(),
axis.title
=
element_blank
(),
axis.text
=
element_text
(
size
=
12
),
panel.border
=
element_rect
())
pdf
(
"Fig2E.pdf"
,
width
=
6
,
height
=
2.5
)
p
dev.off
()
## Figure 2F
pdf
(
file
=
"Fig2F.pdf"
,
width
=
4
,
height
=
4
)
ggplot
(
data
=
g
,
aes
(
x
=
Sample
,
y
=
Frequency
,
fill
=
Population
))
+
geom_bar
(
stat
=
"identity"
,
width
=
0.5
,
color
=
"black"
)
+
scale_fill_manual
(
values
=
alpha
(
colour
=
colpalette
,
alpha
=
0.50
))
+
theme_void
()
+
theme
(
legend.position
=
"none"
,
plot.title
=
element_blank
(),
axis.title
=
element_blank
(),
panel.background
=
element_rect
(
fill
=
"white"
),
axis.text
=
element_text
(
size
=
16
,
color
=
"black"
))
dev.off
()
Figures_2G.R
0 → 100644
View file @
73467876
# script for figures 2G
## loading libraries
library
(
Seurat
)
library
(
ggplot2
)
library
(
ggplotify
)
library
(
ggraph
)
library
(
ggrepel
)
library
(
ggpubr
)
library
(
ComplexHeatmap
)
library
(
gridExtra
)
library
(
RColorBrewer
)
library
(
dittoSeq
)
library
(
openxlsx
)
library
(
reshape2
)
library
(
ggalluvial
)
library
(
dplyr
)
# load seurat object
obj
<-
readRDS
(
"CultureDataset.rds"
)
obj
<-
subset
(
obj
,
cells
=
WhichCells
(
object
=
obj
,
expression
=
orig.ident
%in%
c
(
"C04"
,
"C02"
,
"C03"
)))
obj
<-
SetIdent
(
object
=
obj
,
value
=
"Population"
)
citokine_dotplot_C04_C02_C03
<-
DotPlot
(
object
=
obj
,
features
=
c
(
"KIT"
,
"MPL"
,
"FLT3"
,
"IL6R"
,
"IL3RA"
),
dot.min
=
0.05
,
scale.by
=
"size"
)
+
labs
(
color
=
"ZscoreExpr"
,
size
=
"PctExpr"
)
+
scale_color_gradient2
(
low
=
"blue"
,
mid
=
"lightgrey"
,
high
=
"red"
)
+
theme
(
axis.title
=
element_blank
(),
legend.position
=
"none"
,
# Places the legend at the bottom
legend.justification
=
"left"
,
# Justifies the legend to the left
legend.box
=
"vertical"
)
+
scale_x_discrete
(
guide
=
guide_axis
(
n.dodge
=
2
))
pdf
(
file
=
"Fig2G.pdf"
,
width
=
3
,
height
=
4
)
citokine_dotplot_C04_C02_C03
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