nfc22 commited on
Commit
0a476ff
·
verified ·
1 Parent(s): 163d624

Upload remaining files except Core data

Browse files
.gitignore ADDED
@@ -0,0 +1,5 @@
 
 
 
 
 
 
1
+
2
+ .idea/material_theme_project_new.xml
3
+
4
+ *.pyc
5
+ __pycache__/
.idea/.gitignore ADDED
@@ -0,0 +1,8 @@
 
 
 
 
 
 
 
 
 
1
+ # Default ignored files
2
+ /shelf/
3
+ /workspace.xml
4
+ # Editor-based HTTP Client requests
5
+ /httpRequests/
6
+ # Datasource local storage ignored files
7
+ /dataSources/
8
+ /dataSources.local.xml
.idea/inspectionProfiles/profiles_settings.xml ADDED
@@ -0,0 +1,6 @@
 
 
 
 
 
 
 
1
+ <component name="InspectionProjectProfileManager">
2
+ <settings>
3
+ <option name="USE_PROJECT_PROFILE" value="false" />
4
+ <version value="1.0" />
5
+ </settings>
6
+ </component>
.idea/misc.xml ADDED
@@ -0,0 +1,7 @@
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <project version="4">
3
+ <component name="Black">
4
+ <option name="sdkName" value="Python 3.11 (name1)" />
5
+ </component>
6
+ <component name="ProjectRootManager" version="2" project-jdk-name="Python 3.12" project-jdk-type="Python SDK" />
7
+ </project>
.idea/modules.xml ADDED
@@ -0,0 +1,8 @@
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <project version="4">
3
+ <component name="ProjectModuleManager">
4
+ <modules>
5
+ <module fileurl="file://$PROJECT_DIR$/.idea/name1.iml" filepath="$PROJECT_DIR$/.idea/name1.iml" />
6
+ </modules>
7
+ </component>
8
+ </project>
.idea/name1.iml ADDED
@@ -0,0 +1,17 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <module type="PYTHON_MODULE" version="4">
3
+ <component name="NewModuleRootManager">
4
+ <content url="file://$MODULE_DIR$">
5
+ <excludeFolder url="file://$MODULE_DIR$/.venv" />
6
+ </content>
7
+ <orderEntry type="jdk" jdkName="Python 3.12" jdkType="Python SDK" />
8
+ <orderEntry type="sourceFolder" forTests="false" />
9
+ </component>
10
+ <component name="PyDocumentationSettings">
11
+ <option name="format" value="PLAIN" />
12
+ <option name="myDocStringFormat" value="Plain" />
13
+ </component>
14
+ <component name="TestRunnerService">
15
+ <option name="PROJECT_TEST_RUNNER" value="py.test" />
16
+ </component>
17
+ </module>
.idea/vcs.xml ADDED
@@ -0,0 +1,6 @@
 
 
 
 
 
 
 
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <project version="4">
3
+ <component name="VcsDirectoryMappings">
4
+ <mapping directory="" vcs="Git" />
5
+ </component>
6
+ </project>
Example plots/MRSS_correlation_plots.png ADDED

Git LFS Details

  • SHA256: 227d28d2914e1dbf4625df52b35316885b17d758b3ab3d3034b64f64b44c12b7
  • Pointer size: 131 Bytes
  • Size of remote file: 175 kB
Example plots/SSc_high_healthy_volcano.png ADDED

Git LFS Details

  • SHA256: c31a19809101d4d4384508f269ed247fb13089143882887ab3c156db70a2a540
  • Pointer size: 131 Bytes
  • Size of remote file: 201 kB
Example plots/UMAPexampleplot.png ADDED

Git LFS Details

  • SHA256: 312feb3afc3c36e6ec1394ae0aee7c60d5087da1728390d4482ddbd5ce2c9130
  • Pointer size: 131 Bytes
  • Size of remote file: 208 kB
Example plots/grant intensities.png ADDED

Git LFS Details

  • SHA256: b6db9ac7a2026a76e14c363869ac850c7eb0ed92b0048f03570c10feddfdc66e
  • Pointer size: 130 Bytes
  • Size of remote file: 36.6 kB
Procfile ADDED
@@ -0,0 +1 @@
 
 
1
+ web: streamlit run app/main.py --server.port=$PORT --server.headless=true --server.enableCORS=false
R markdowns/MRSS_correlation_plots.Rmd ADDED
@@ -0,0 +1,293 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ title: "mrss_correlation_plots"
3
+ output: html_document
4
+ date: "2024-09-24"
5
+ ---
6
+
7
+ ```{r setup, include=FALSE}
8
+ library(devtools)
9
+ library(readat)
10
+ library(SomaDataIO)
11
+ library(ggplot2)
12
+ library(dplyr)
13
+ library(tidyr)
14
+ library(purrr)
15
+ library(readat)
16
+ library(Biobase)
17
+ library(limma)
18
+ library(magrittr)
19
+ library(tidyverse)
20
+ library(reshape2)
21
+ adat <- readAdat('D:/Data/Data_drive/Data/IS_Protein_data/SS-2342309_v4.1_other.hybNorm.medNormInt.plateScale.adat', keepOnlyPasses = T, keepOnlySamples = T, dateFormat = "%Y-%m-%d", verbose = getOption("verbose"))
22
+ rownames(adat) <- adat$ExtIdentifier
23
+ metadata <- read.csv(file ='D:/Data/Data_drive/Data/IS_Protein_data/somalogic_metadata.csv', row.names = 1)
24
+ SampleDescription <- c("VEDOSS", "Healthy_abdo", "Healthy", "Healthy_abdo", "SSC_low", "SSC_high","SSC_low","SSC_high","Healthy_abdo","Healthy_abdo","VEDOSS","SSC_high","SSC_high","SSC_low","Healthy","VEDOSS", "Healthy_abdo","Healthy")
25
+ adat$SampleDescription<- SampleDescription
26
+ SampleGroup <- c("VEDOSS", "Healthy", "Healthy", "Healthy", "SSC","SSC", "SSC", "SSC","Health
27
+ y","Healthy","VEDOSS","SSC","SSC","SSC","Healthy","VEDOSS", "Healthy","Healthy")
28
+ adat$SampleGroup <- SampleGroup
29
+ adat <- adat[!grepl("PSG", adat$SampleId), ]
30
+ rownames(metadata) ==adat$ExtIdentifier
31
+ metadata$Total_mRss
32
+ adat$SampleNotes <- metadata$Total_mRss
33
+ adat <- adat %>% rename( mrss = SampleNotes)
34
+
35
+ seq_variance <- getSequenceData(adat)
36
+ seq_variance <- seq_variance %>% filter(Organism=="Human"&Type=="Protein")
37
+ melt_proteins <- melt(adat, na.rm = T)
38
+ proteins_plot <- merge(melt_proteins, seq_variance)
39
+ order <- c("Healthy", "VEDOSS","SSC_low","SSC_high")
40
+ proteins_plot$SampleDescription <- factor(proteins_plot$SampleDescription, levels=order)
41
+ somaEset <- soma2eset(adat)
42
+ somaEset <- subset(somaEset, somaEset@featureData@data[["Organism"]] =="Human"& somaEset@featureData@data[["Type"]]=="Protein")
43
+ protein_IDs <- as.data.frame(somaEset@featureData@data)
44
+ ```
45
+
46
+ ```{r}
47
+ # Required libraries
48
+ library(broom)
49
+ library(dplyr)
50
+
51
+ # Function to calculate R-squared, correlation, and p-value for each gene (SeqId)
52
+ calc_r2_pvalue_correlation <- function(data) {
53
+
54
+ # Initialize an empty list to store results for each gene
55
+ results <- list()
56
+
57
+ # Iterate over each unique gene (SeqId)
58
+ for (gene in unique(data$SeqId)) {
59
+
60
+ # Subset data for the current gene
61
+ gene_data <- data %>% filter(SeqId == gene)
62
+
63
+ # Fit a linear model using Intensity as predictor and mrss as response
64
+ model <- lm(mrss ~ Intensity, data = gene_data)
65
+
66
+ # Calculate Pearson correlation coefficient
67
+ correlation <- cor(gene_data$Intensity, gene_data$mrss, method = "pearson")
68
+
69
+ # Extract R-squared and p-value from the model
70
+ tidy_model <- tidy(model) # For p-value
71
+ glance_model <- glance(model) # For R-squared
72
+
73
+ # Store results in a list
74
+ results[[gene]] <- data.frame(
75
+ SeqId = gene,
76
+ Correlation = correlation, # Pearson correlation coefficient (r)
77
+ R_squared = glance_model$r.squared,
78
+ P_value = tidy_model$p.value[2] # p-value for the Intensity predictor
79
+ )
80
+ }
81
+
82
+ # Combine all results into a single data frame
83
+ results_df <- do.call(rbind, results)
84
+
85
+ return(results_df)
86
+ }
87
+
88
+ # Example usage:
89
+ results_table <- calc_r2_pvalue_correlation(proteins_plot)
90
+
91
+ # Print or plot the results
92
+
93
+ results_table <- results_table %>% filter(P_value <0.05)
94
+ correlation_dataframe <- results_table %>% left_join(protein_IDs, by = "SeqId") %>% select(Correlation, R_squared, P_value, EntrezGeneSymbol, SeqId)
95
+ ```
96
+
97
+ ```{r}
98
+ positive_correlations <- correlation_dataframe %>% filter(Correlation > 0) %>% arrange(desc(R_squared)) %>% slice(1:10)
99
+ negative_correlations <- correlation_dataframe %>% filter(Correlation < 0) %>% arrange(desc(R_squared)) %>% slice(1:10)
100
+ correlation_table <- cbind(positive_correlations,negative_correlations)
101
+ write.csv(correlation_table, "D:/Data/Data_drive/Data/IS_Protein_data/correlative_proteins_mrss.csv")
102
+ ```
103
+
104
+ ```{r}
105
+ library(ggpubr)
106
+ library(ggpmisc)
107
+ library(cowplot)
108
+
109
+ CCL18 <- proteins_plot %>%
110
+ subset(SeqId =="3044-3")%>%
111
+ ggplot(aes(mrss, Intensity, label = SampleDescription))+
112
+ facet_wrap( ~ EntrezGeneSymbol)+
113
+ geom_point()+
114
+ geom_label(color = "black", show.legend = FALSE) +
115
+ stat_poly_line() +
116
+ stat_poly_eq(use_label(c("R2", "p")), p.digits = 5) +
117
+ theme(legend.position = "none")+
118
+ labs( y = "",x="Total mRSS")
119
+
120
+
121
+ HNRNPDL <- proteins_plot %>%
122
+ subset(SeqId =="10852-114")%>%
123
+ ggplot(aes(mrss, Intensity, label = SampleDescription))+
124
+ facet_wrap( ~ EntrezGeneSymbol)+
125
+ geom_point()+
126
+ geom_label(color = "black", show.legend = FALSE) +
127
+ stat_poly_line() +
128
+ stat_poly_eq(use_label(c("R2", "p")), p.digits = 3) +
129
+ theme(legend.position = "none")+
130
+ labs( y = "",x="Total mRSS")
131
+
132
+ TIMP1 <- proteins_plot %>%
133
+ subset(SeqId =="25967-34")%>%
134
+ ggplot(aes(mrss, Intensity, label = SampleDescription))+
135
+ facet_wrap( ~ EntrezGeneSymbol)+
136
+ geom_point()+
137
+ geom_label(color = "black", show.legend = FALSE) +
138
+ stat_poly_line() +
139
+ stat_poly_eq(use_label(c("R2", "p")), p.digits = 3) +
140
+ theme(legend.position = "none")+
141
+ labs( y = "",x="Total mRSS")
142
+
143
+ SFRP4 <- proteins_plot %>%
144
+ subset(SeqId =="17447-52")%>%
145
+ ggplot(aes(mrss, Intensity, label = SampleDescription))+
146
+ facet_wrap( ~ EntrezGeneSymbol)+
147
+ geom_point()+
148
+ geom_label(color = "black", show.legend = FALSE) +
149
+ stat_poly_line() +
150
+ stat_poly_eq(use_label(c("R2", "p")), p.digits = 3) +
151
+ theme(legend.position = "none")+
152
+ labs( y = "",x="Total mRSS")
153
+
154
+ SERPINE2 <- proteins_plot %>%
155
+ subset(SeqId =="19154-41")%>%
156
+ ggplot(aes(mrss, Intensity, label = SampleDescription))+
157
+ facet_wrap( ~ EntrezGeneSymbol)+
158
+ geom_point()+
159
+ geom_label(color = "black", show.legend = FALSE) +
160
+ stat_poly_line() +
161
+ stat_poly_eq(use_label(c("R2", "p")), p.digits = 3) +
162
+ theme(legend.position = "none")+
163
+ labs( y = "",x="Total mRSS")
164
+
165
+ INHBA <- proteins_plot %>%
166
+ subset(SeqId =="19622-7")%>%
167
+ ggplot(aes(mrss, Intensity, label = SampleDescription))+
168
+ facet_wrap( ~ EntrezGeneSymbol)+
169
+ geom_point()+
170
+ geom_label(color = "black", show.legend = FALSE) +
171
+ stat_poly_line() +
172
+ stat_poly_eq(use_label(c("R2", "p")), p.digits = 3) +
173
+ theme(legend.position = "none")+
174
+ labs( y = "",x="Total mRSS")
175
+
176
+
177
+ png(file='D:/Data/Data_drive/Data/IS_Protein_data/Tidied_scripts/plots/MRSS_correlation_plots.png', width = 4750, height = 750, res = 300)
178
+ plot_grid(CCL18,HNRNPDL,TIMP1,SFRP4,SERPINE2,INHBA, ncol=6,nrow = 1)
179
+ ```
180
+
181
+ ```{r}
182
+ THBS1 <- proteins_plot %>%
183
+ subset(SeqId =="3474-19")%>%
184
+ ggplot(aes(mrss, Intensity, label = SampleDescription))+
185
+ facet_wrap( ~ EntrezGeneSymbol)+
186
+ geom_point()+
187
+ geom_label(color = "black", show.legend = FALSE) +
188
+ stat_poly_line() +
189
+ stat_poly_eq(use_label(c("R2", "p")), p.digits = 3) +
190
+ theme(legend.position = "none")+
191
+ labs( y = "",x="Total mRSS")
192
+ png(file='D:/Data/Data_drive/Data/IS_Protein_data/Tidied_scripts/plots/THBS_MRSS_correlation_plots.png', width = 750, height = 750, res = 300)
193
+ THBS1
194
+ INHBA <- proteins_plot %>%
195
+ subset(SeqId =="19622-7")%>%
196
+ ggplot(aes(mrss, Intensity, label = SampleDescription))+
197
+ facet_wrap( ~ EntrezGeneSymbol)+
198
+ geom_point()+
199
+ geom_label(color = "black", show.legend = FALSE) +
200
+ stat_poly_line() +
201
+ stat_poly_eq(use_label(c("R2", "p")), p.digits = 3) +
202
+ theme(legend.position = "none")+
203
+ labs( y = "",x="Total mRSS")
204
+ png(file='D:/Data/Data_drive/Data/IS_Protein_data/Tidied_scripts/plots/INHBA_MRSS_correlation_plots.png', width = 750, height = 750, res = 300)
205
+ INHBA
206
+ ```
207
+
208
+ ```{r}
209
+ ###Becky's panel
210
+ CCL2 <- proteins_plot %>%
211
+ subset(SeqId =="2578-67")%>%
212
+ ggplot(aes(mrss, Intensity, label = SampleDescription))+
213
+ facet_wrap( ~ EntrezGeneSymbol)+
214
+ geom_point()+
215
+ geom_label(color = "black", show.legend = FALSE) +
216
+ stat_poly_line() +
217
+ stat_poly_eq(use_label(c("R2", "p")), p.digits = 3) +
218
+ theme(legend.position = "none")+
219
+ labs( y = "",x="Total mRSS")
220
+ png(file='D:/Data/Data_drive/Data/IS_Protein_data/Tidied_scripts/plots/for_becky/CCL2_MRSS_correlation_plots.png', width = 750, height = 750, res = 300)
221
+ CCL2
222
+ dev.off()
223
+
224
+ CXCL10 <- proteins_plot %>%
225
+ subset(SeqId =="4141-79")%>%
226
+ ggplot(aes(mrss, Intensity, label = SampleDescription))+
227
+ facet_wrap( ~ EntrezGeneSymbol)+
228
+ geom_point()+
229
+ geom_label(color = "black", show.legend = FALSE) +
230
+ stat_poly_line() +
231
+ stat_poly_eq(use_label(c("R2", "p")), p.digits = 3) +
232
+ theme(legend.position = "none")+
233
+ labs( y = "",x="Total mRSS")
234
+ png(file='D:/Data/Data_drive/Data/IS_Protein_data/Tidied_scripts/plots/for_becky/CXCL10_MRSS_correlation_plots.png', width = 750, height = 750, res = 300)
235
+ CXCL10
236
+ dev.off()
237
+
238
+ CCL19 <- proteins_plot %>%
239
+ subset(SeqId =="4922-13")%>%
240
+ ggplot(aes(mrss, Intensity, label = SampleDescription))+
241
+ facet_wrap( ~ EntrezGeneSymbol)+
242
+ geom_point()+
243
+ geom_label(color = "black", show.legend = FALSE) +
244
+ stat_poly_line() +
245
+ stat_poly_eq(use_label(c("R2", "p")), p.digits = 3) +
246
+ theme(legend.position = "none")+
247
+ labs( y = "",x="Total mRSS")
248
+ png(file='D:/Data/Data_drive/Data/IS_Protein_data/Tidied_scripts/plots/for_becky/CCL19_MRSS_correlation_plots.png', width = 750, height = 750, res = 300)
249
+ CCL19
250
+ dev.off()
251
+
252
+ CXCL9 <- proteins_plot %>%
253
+ subset(SeqId =="11593-21")%>%
254
+ ggplot(aes(mrss, Intensity, label = SampleDescription))+
255
+ facet_wrap( ~ EntrezGeneSymbol)+
256
+ geom_point()+
257
+ geom_label(color = "black", show.legend = FALSE) +
258
+ stat_poly_line() +
259
+ stat_poly_eq(use_label(c("R2", "p")), p.digits = 3) +
260
+ theme(legend.position = "none")+
261
+ labs( y = "",x="Total mRSS")
262
+ png(file='D:/Data/Data_drive/Data/IS_Protein_data/Tidied_scripts/plots/for_becky/CXCL9_MRSS_correlation_plots.png', width = 750, height = 750, res = 300)
263
+ CXCL9
264
+ dev.off()
265
+
266
+ CXCL11 <- proteins_plot %>%
267
+ subset(SeqId =="3038-9")%>%
268
+ ggplot(aes(mrss, Intensity, label = SampleDescription))+
269
+ facet_wrap( ~ EntrezGeneSymbol)+
270
+ geom_point()+
271
+ geom_label(color = "black", show.legend = FALSE) +
272
+ stat_poly_line() +
273
+ stat_poly_eq(use_label(c("R2", "p")), p.digits = 3) +
274
+ theme(legend.position = "none")+
275
+ labs( y = "",x="Total mRSS")
276
+ png(file='D:/Data/Data_drive/Data/IS_Protein_data/Tidied_scripts/plots/for_becky/CXCL11_MRSS_correlation_plots.png', width = 750, height = 750, res = 300)
277
+ CXCL11
278
+ dev.off()
279
+ CCL18 <- proteins_plot %>%
280
+ subset(SeqId =="3044-3")%>%
281
+ ggplot(aes(mrss, Intensity, label = SampleDescription))+
282
+ facet_wrap( ~ EntrezGeneSymbol)+
283
+ geom_point()+
284
+ geom_label(color = "black", show.legend = FALSE) +
285
+ stat_poly_line() +
286
+ stat_poly_eq(use_label(c("R2", "p")), p.digits = 5) +
287
+ theme(legend.position = "none")+
288
+ labs( y = "",x="Total mRSS")
289
+ png(file='D:/Data/Data_drive/Data/IS_Protein_data/Tidied_scripts/plots/for_becky/CCL18_MRSS_correlation_plots.png', width = 750, height = 750, res = 300)
290
+ CCL18
291
+ dev.off()
292
+ ```
293
+
R markdowns/Somalogic_deeper_metadata_analysis.Rmd ADDED
@@ -0,0 +1,443 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ title: "Differential protein expression using Limma"
3
+ output:
4
+ html_document:
5
+ df_print: paged
6
+ ---
7
+
8
+ ```{r}
9
+ library(dplyr)
10
+ library(tidyr)
11
+ library(ggplot2)
12
+ library(EnhancedVolcano)
13
+
14
+ metadata <- read.csv(file ='D:/Data/Data_drive/Data/IS_Protein_data/somalogic_metadata.csv', row.names = 1)
15
+ somaEset <- readRDS('D:/Data/Data_drive/Data/IS_Protein_data/somaEset.rds')
16
+ normalised_expression <- as.data.frame(exprs(somaEset))
17
+ protein_IDs <- as.data.frame(somaEset@featureData@data)
18
+ proteins_plot <- read.csv('D:/Data/Data_drive/Data/IS_Protein_data/proteins_plot.csv', row.names = 1)
19
+
20
+ ```
21
+
22
+
23
+ ```{r}
24
+ ### lung fibrosis
25
+ subset_metadata <- dplyr::filter(metadata, grepl("Scleroderma", category))
26
+ subset_proteins <- normalised_expression[, colnames(normalised_expression) %in% rownames(subset_metadata)]
27
+ design <- model.matrix(~ Lung_Fibrosis + 0, data = subset_metadata)
28
+ colnames(design) <- c("No","Yes")
29
+ contrastNames <- c("Yes - No")
30
+ contrasts <- makeContrasts(contrasts = contrastNames, levels=design)
31
+ limmaRes <- subset_proteins %>% lmFit(design = design)%>% contrasts.fit(contrasts) %>% eBayes()
32
+ coeffs <- coefficients(limmaRes)
33
+
34
+ stats_df <- topTable(limmaRes, number = nrow(subset_proteins))
35
+ stats_df <- merge(stats_df, protein_IDs, by = "row.names")
36
+ write.csv(stats_df, "D:/Data/Data_drive/Data/IS_Protein_data/SSc_lung_fibrosis_allproteins.csv")
37
+ writeable_SSc_lung_fibrosis <- stats_df %>% filter( P.Value <0.05) %>% filter(logFC >0.585| logFC < -0.585) %>% select(SeqId, TargetFullName,Target,UniProt,EntrezGeneSymbol,logFC,AveExpr,P.Value)
38
+ write.csv(writeable_SSc_lung_fibrosis, "D:/Data/Data_drive/Data/IS_Protein_data/SSc_lung_fibrosis.csv")
39
+
40
+ stats_df <- stats_df %>%
41
+ arrange(P.Value) %>%
42
+ mutate(EntrezGeneSymbol = as.character(EntrezGeneSymbol),
43
+ label = ifelse(P.Value < 0.05 & EntrezGeneSymbol %in% head(EntrezGeneSymbol, 50), EntrezGeneSymbol, NA))
44
+
45
+ writeable_SSc_lung_fibrosis %>%
46
+ summarise(
47
+ logFC_greater_than_0 = sum(logFC > 0),
48
+ logFC_less_than_0 = sum(logFC < 0))
49
+
50
+ SSc_lung_fibrosis <- EnhancedVolcano(data.frame(stats_df), x = 'logFC', y = 'P.Value',lab = stats_df$label,selectLab = stats_df$label,
51
+ title = 'SSc Lung Fibrosis vs SSc no Lung Fibrosis proteins',
52
+ pCutoff = 0.05,
53
+ FCcutoff = 0.585,
54
+ xlim = c(min(stats_df[['logFC']], na.rm = TRUE), max(stats_df[['logFC']], na.rm = TRUE)),
55
+ ylim = c(0, max(-log10(stats_df[['P.Value']]), na.rm = TRUE)),
56
+ pointSize = 2.0,
57
+ labSize = 4.0,
58
+ labCol = 'grey14',
59
+ colAlpha = 4/5,
60
+ boxedLabels = T,
61
+ legendPosition = 'None',
62
+ legendLabSize = 8,
63
+ legendIconSize = 3.0,
64
+ drawConnectors = T,
65
+ widthConnectors = 0.6,
66
+ colConnectors = 'black',
67
+ max.overlaps = 20,
68
+ maxoverlapsConnectors = Inf)
69
+ SSc_lung_fibrosis
70
+ png(file='D:/Data/Data_drive/Data/IS_Protein_data/Tidied_scripts/plots/SSc_lung_fibrosis_volcano.png', width = 3000, height = 2000, res = 300)
71
+ SSc_lung_fibrosis
72
+
73
+ ```
74
+ ```{r}
75
+ # Required libraries
76
+ library(broom)
77
+ library(dplyr)
78
+
79
+ # Function to calculate R-squared, correlation, and p-value for each gene (SeqId)
80
+ calc_r2_pvalue_correlation <- function(data) {
81
+
82
+ # Initialize an empty list to store results for each gene
83
+ results <- list()
84
+
85
+ # Iterate over each unique gene (SeqId)
86
+ for (gene in unique(data$SeqId)) {
87
+
88
+ # Subset data for the current gene
89
+ gene_data <- data %>% filter(SeqId == gene)
90
+
91
+ # Fit a linear model using Intensity as predictor and Lung_Fibrosis_binary as response
92
+ model <- lm(Lung_Fibrosis_binary ~ Intensity, data = gene_data)
93
+
94
+ # Calculate Pearson correlation coefficient
95
+ correlation <- cor(gene_data$Intensity, gene_data$Lung_Fibrosis_binary, method = "pearson")
96
+
97
+ # Extract R-squared and p-value from the model
98
+ tidy_model <- tidy(model) # For p-value
99
+ glance_model <- glance(model) # For R-squared
100
+
101
+ # Store results in a list
102
+ results[[gene]] <- data.frame(
103
+ SeqId = gene,
104
+ Correlation = correlation, # Pearson correlation coefficient (r)
105
+ R_squared = glance_model$r.squared,
106
+ P_value = tidy_model$p.value[2] # p-value for the Intensity predictor
107
+ )
108
+ }
109
+
110
+ # Combine all results into a single data frame
111
+ results_df <- do.call(rbind, results)
112
+
113
+ return(results_df)
114
+ }
115
+
116
+ # Example usage:
117
+ subset_proteins_plot <- proteins_plot %>% filter(SampleGroup =="SSC")
118
+ results_table <- calc_r2_pvalue_correlation(subset_proteins_plot)
119
+
120
+ # Print or plot the results
121
+
122
+ results_table <- results_table %>% filter(P_value <0.05)
123
+ correlation_dataframe <- results_table %>% left_join(protein_IDs, by = "SeqId") %>% select(Correlation, R_squared, P_value, EntrezGeneSymbol, SeqId)
124
+ ```
125
+
126
+ ```{r}
127
+ positive_correlations <- correlation_dataframe %>% filter(Correlation > 0) %>% arrange(desc(R_squared)) %>% slice(1:10)
128
+ negative_correlations <- correlation_dataframe %>% filter(Correlation < 0) %>% arrange(desc(R_squared)) %>% slice(1:10)
129
+ correlation_table <- full_join(positive_correlations,negative_correlations)
130
+ write.csv(correlation_table, "D:/Data/Data_drive/Data/IS_Protein_data/correlative_proteins_lung_fibrosis.csv")
131
+ ```
132
+
133
+ ```{r}
134
+ library(ggpubr)
135
+ library(ggpmisc)
136
+ library(cowplot)
137
+ mat_colors <- c('turquoise2','red')
138
+
139
+ SCUBE3 <- subset_proteins_plot %>%
140
+ subset(SeqId == "16773-29") %>%
141
+ ggplot(aes(Lung_Fibrosis, Intensity, label = SampleId))+
142
+ facet_wrap( ~ EntrezGeneSymbol)+
143
+ scale_y_log10()+
144
+ geom_boxplot(fill = mat_colors)+
145
+ theme_bw() +
146
+ theme(legend.position = "top")+
147
+ labs(color = "Sample", x="Lung fibrosis")
148
+ SCUBE3
149
+ ELP1 <- subset_proteins_plot %>%
150
+ subset(SeqId == "25102-23") %>%
151
+ ggplot(aes(Lung_Fibrosis, Intensity, label = SampleId))+
152
+ facet_wrap( ~ EntrezGeneSymbol)+
153
+ scale_y_log10()+
154
+ geom_boxplot(fill = mat_colors)+
155
+ theme_bw() +
156
+ theme(legend.position = "top")+
157
+ labs(color = "Sample", x="Lung fibrosis")
158
+ ELP1
159
+
160
+ SNTA1 <- subset_proteins_plot %>%
161
+ subset(SeqId == "22946-55") %>%
162
+ ggplot(aes(Lung_Fibrosis, Intensity, label = SampleId))+
163
+ facet_wrap( ~ EntrezGeneSymbol)+
164
+ scale_y_log10()+
165
+ geom_boxplot(fill = mat_colors)+
166
+ theme_bw() +
167
+ theme(legend.position = "top")+
168
+ labs(color = "Sample", x="Lung fibrosis")
169
+ SNTA1
170
+
171
+ HEXB <- subset_proteins_plot %>%
172
+ subset(SeqId == "6075-61") %>%
173
+ ggplot(aes(Lung_Fibrosis, Intensity, label = SampleId))+
174
+ facet_wrap( ~ EntrezGeneSymbol)+
175
+ scale_y_log10()+
176
+ geom_boxplot(fill = mat_colors)+
177
+ theme_bw() +
178
+ theme(legend.position = "top")+
179
+ labs(color = "Sample", x="Lung fibrosis")
180
+ HEXB
181
+
182
+ plot_grid(SCUBE3,ELP1,SNTA1,HEXB,ncol=4,nrow = 1)
183
+
184
+ ```
185
+
186
+ ```{r}
187
+ ### Immunosuppression
188
+ subset_metadata <- dplyr::filter(metadata, grepl("Scleroderma", category))
189
+ subset_proteins <- normalised_expression[, colnames(normalised_expression) %in% rownames(subset_metadata)]
190
+ design <- model.matrix(~ Immunosupression_bin + 0, data = subset_metadata)
191
+ colnames(design) <- c("No","Yes")
192
+ contrastNames <- c("Yes - No")
193
+ contrasts <- makeContrasts(contrasts = contrastNames, levels=design)
194
+ limmaRes <- subset_proteins %>% lmFit(design = design)%>% contrasts.fit(contrasts) %>% eBayes()
195
+ coeffs <- coefficients(limmaRes)
196
+
197
+ stats_df <- topTable(limmaRes, number = nrow(subset_proteins))
198
+ stats_df <- merge(stats_df, protein_IDs, by = "row.names")
199
+ write.csv(stats_df, "D:/Data/Data_drive/Data/IS_Protein_data/SSc_immunosupressant_allproteins.csv")
200
+ writeable_SSc_immunosupression <- stats_df %>% filter( P.Value <0.05) %>% filter(logFC >0.585| logFC < -0.585) %>% select(SeqId, TargetFullName,Target,UniProt,EntrezGeneSymbol,logFC,AveExpr,P.Value)
201
+ write.csv(writeable_SSc_immunosupression, "D:/Data/Data_drive/Data/IS_Protein_data/SSc_immunosupressant.csv")
202
+
203
+ stats_df <- stats_df %>%
204
+ arrange(P.Value) %>%
205
+ mutate(EntrezGeneSymbol = as.character(EntrezGeneSymbol),
206
+ label = ifelse(P.Value < 0.05 & EntrezGeneSymbol %in% head(EntrezGeneSymbol, 50), EntrezGeneSymbol, NA))
207
+
208
+ writeable_SSc_immunosupression %>%
209
+ summarise(
210
+ logFC_greater_than_0 = sum(logFC > 0),
211
+ logFC_less_than_0 = sum(logFC < 0))
212
+
213
+ SSc_immunosupression <- EnhancedVolcano(data.frame(stats_df), x = 'logFC', y = 'P.Value',lab = stats_df$label,selectLab = stats_df$label,
214
+ title = 'SSc Immunosupression vs SSc no Immunosupression',
215
+ pCutoff = 0.05,
216
+ FCcutoff = 0.585,
217
+ xlim = c(min(stats_df[['logFC']], na.rm = TRUE), max(stats_df[['logFC']], na.rm = TRUE)),
218
+ ylim = c(0, max(-log10(stats_df[['P.Value']]), na.rm = TRUE)),
219
+ pointSize = 2.0,
220
+ labSize = 4.0,
221
+ labCol = 'grey14',
222
+ colAlpha = 4/5,
223
+ boxedLabels = T,
224
+ legendPosition = 'None',
225
+ legendLabSize = 8,
226
+ legendIconSize = 3.0,
227
+ drawConnectors = T,
228
+ widthConnectors = 0.6,
229
+ colConnectors = 'black',
230
+ max.overlaps = 20,
231
+ maxoverlapsConnectors = Inf)
232
+ SSc_immunosupression
233
+ png(file='D:/Data/Data_drive/Data/IS_Protein_data/Tidied_scripts/plots/SSc_immunosupressant_volcano.png', width = 3000, height = 2000, res = 300)
234
+ SSc_immunosupression
235
+
236
+ ```
237
+
238
+
239
+ ```{r}
240
+ subset_proteins_plot <- proteins_plot %>% dplyr::filter(grepl("SSC", SampleGroup))
241
+
242
+ CFDP1 <- subset_proteins_plot %>%
243
+ subset(SeqId == "24706-73") %>%
244
+ ggplot(aes(Immunosupression_bin, Intensity, label = SampleId))+
245
+ facet_wrap( ~ EntrezGeneSymbol)+
246
+ scale_y_log10()+
247
+ geom_boxplot(fill = mat_colors)+
248
+ theme_bw() +
249
+ theme(legend.position = "top")+
250
+ labs(color = "Sample", x="Immunosupression")
251
+ CFDP1
252
+
253
+ KRT1 <- subset_proteins_plot %>%
254
+ subset(SeqId == "9931-20") %>%
255
+ ggplot(aes(Immunosupression_bin, Intensity, label = SampleId))+
256
+ facet_wrap( ~ EntrezGeneSymbol)+
257
+ scale_y_log10()+
258
+ geom_boxplot(fill = mat_colors)+
259
+ theme_bw() +
260
+ theme(legend.position = "top")+
261
+ labs(color = "Sample", x="Immunosupression")
262
+ KRT1
263
+ ```
264
+
265
+
266
+ ```{r}
267
+ # Required libraries
268
+ library(broom)
269
+ library(dplyr)
270
+
271
+ # Function to calculate R-squared, correlation, and p-value for each gene (SeqId)
272
+ calc_r2_pvalue_correlation <- function(data) {
273
+
274
+ # Initialize an empty list to store results for each gene
275
+ results <- list()
276
+
277
+ # Iterate over each unique gene (SeqId)
278
+ for (gene in unique(data$SeqId)) {
279
+
280
+ # Subset data for the current gene
281
+ gene_data <- data %>% filter(SeqId == gene)
282
+
283
+ # Fit a linear model using Intensity as predictor and Local_skin_score as response
284
+ model <- lm(Local_skin_score ~ Intensity, data = gene_data)
285
+
286
+ # Calculate Pearson correlation coefficient
287
+ correlation <- cor(gene_data$Intensity, gene_data$Local_skin_score, method = "pearson")
288
+
289
+ # Extract R-squared and p-value from the model
290
+ tidy_model <- tidy(model) # For p-value
291
+ glance_model <- glance(model) # For R-squared
292
+
293
+ # Store results in a list
294
+ results[[gene]] <- data.frame(
295
+ SeqId = gene,
296
+ Correlation = correlation, # Pearson correlation coefficient (r)
297
+ R_squared = glance_model$r.squared,
298
+ P_value = tidy_model$p.value[2] # p-value for the Intensity predictor
299
+ )
300
+ }
301
+
302
+ # Combine all results into a single data frame
303
+ results_df <- do.call(rbind, results)
304
+
305
+ return(results_df)
306
+ }
307
+
308
+ # Example usage:
309
+ subset_proteins_plot <- proteins_plot %>% filter(SampleGroup =="SSC")
310
+ results_table <- calc_r2_pvalue_correlation(subset_proteins_plot)
311
+
312
+ # Print or plot the results
313
+
314
+ results_table <- results_table %>% filter(P_value <0.05)
315
+ correlation_dataframe <- results_table %>% left_join(protein_IDs, by = "SeqId") %>% select(Correlation, R_squared, P_value, EntrezGeneSymbol, SeqId)
316
+ ```
317
+
318
+ ```{r}
319
+ positive_correlations <- correlation_dataframe %>% filter(Correlation > 0) %>% arrange(desc(R_squared)) %>% slice(1:10)
320
+ negative_correlations <- correlation_dataframe %>% filter(Correlation < 0) %>% arrange(desc(R_squared)) %>% slice(1:10)
321
+ correlation_table <- full_join(positive_correlations,negative_correlations)
322
+ write.csv(correlation_table, "D:/Data/Data_drive/Data/IS_Protein_data/correlative_proteins_local_skin_score.csv")
323
+ ```
324
+
325
+ ```{r}
326
+ library(ggpubr)
327
+ library(ggpmisc)
328
+ library(cowplot)
329
+
330
+ CHI3L1 <- subset_proteins_plot %>%
331
+ subset(SeqId =="11104-13")%>%
332
+ ggplot(aes(Local_skin_score, Intensity, label = SampleDescription))+
333
+ facet_wrap( ~ EntrezGeneSymbol)+
334
+ geom_point()+
335
+ geom_label(color = "black", show.legend = FALSE) +
336
+ stat_poly_line() +
337
+ stat_poly_eq(use_label(c("R2", "p")), p.digits = 5) +
338
+ theme(legend.position = "none")+
339
+ labs( y = "",x="Local mRSS")
340
+ CHI3L1
341
+ TPSAB1 <- subset_proteins_plot %>%
342
+ subset(SeqId =="9409-11")%>%
343
+ ggplot(aes(Local_skin_score, Intensity, label = SampleDescription))+
344
+ facet_wrap( ~ EntrezGeneSymbol)+
345
+ geom_point()+
346
+ geom_label(color = "black", show.legend = FALSE) +
347
+ stat_poly_line() +
348
+ stat_poly_eq(use_label(c("R2", "p")), p.digits = 5) +
349
+ theme(legend.position = "none")+
350
+ labs( y = "",x="Local mRSS")
351
+ TPSAB1
352
+ plot_grid(CHI3L1,TPSAB1,ncol=2,nrow = 1)
353
+
354
+ ```
355
+
356
+
357
+ ```{r}
358
+ # Required libraries
359
+ library(broom)
360
+ library(dplyr)
361
+
362
+ # Function to calculate R-squared, correlation, and p-value for each gene (SeqId)
363
+ calc_r2_pvalue_correlation <- function(data) {
364
+
365
+ # Initialize an empty list to store results for each gene
366
+ results <- list()
367
+
368
+ # Iterate over each unique gene (SeqId)
369
+ for (gene in unique(data$SeqId)) {
370
+
371
+ # Subset data for the current gene
372
+ gene_data <- data %>% filter(SeqId == gene)
373
+
374
+ # Fit a linear model using Intensity as predictor and Disease_duration as response
375
+ model <- lm(Disease_duration ~ Intensity, data = gene_data)
376
+
377
+ # Calculate Pearson correlation coefficient
378
+ correlation <- cor(gene_data$Intensity, gene_data$Disease_duration, method = "pearson")
379
+
380
+ # Extract R-squared and p-value from the model
381
+ tidy_model <- tidy(model) # For p-value
382
+ glance_model <- glance(model) # For R-squared
383
+
384
+ # Store results in a list
385
+ results[[gene]] <- data.frame(
386
+ SeqId = gene,
387
+ Correlation = correlation, # Pearson correlation coefficient (r)
388
+ R_squared = glance_model$r.squared,
389
+ P_value = tidy_model$p.value[2] # p-value for the Intensity predictor
390
+ )
391
+ }
392
+
393
+ # Combine all results into a single data frame
394
+ results_df <- do.call(rbind, results)
395
+
396
+ return(results_df)
397
+ }
398
+
399
+ # Example usage:
400
+ subset_proteins_plot <- proteins_plot %>% filter(SampleGroup =="SSC")
401
+ results_table <- calc_r2_pvalue_correlation(subset_proteins_plot)
402
+
403
+ # Print or plot the results
404
+
405
+ results_table <- results_table %>% filter(P_value <0.05)
406
+ correlation_dataframe <- results_table %>% left_join(protein_IDs, by = "SeqId") %>% select(Correlation, R_squared, P_value, EntrezGeneSymbol, SeqId)
407
+ ```
408
+
409
+ ```{r}
410
+ positive_correlations <- correlation_dataframe %>% filter(Correlation > 0) %>% arrange(desc(R_squared)) %>% slice(1:10)
411
+ negative_correlations <- correlation_dataframe %>% filter(Correlation < 0) %>% arrange(desc(R_squared)) %>% slice(1:10)
412
+ correlation_table <- full_join(positive_correlations,negative_correlations)
413
+ write.csv(correlation_table, "D:/Data/Data_drive/Data/IS_Protein_data/correlative_proteins_disease_duration.csv")
414
+ ```
415
+
416
+ ```{r}
417
+ GPX1 <- subset_proteins_plot %>%
418
+ subset(SeqId =="15591-28")%>%
419
+ ggplot(aes(Disease_duration, Intensity, label = SampleDescription))+
420
+ facet_wrap( ~ EntrezGeneSymbol)+
421
+ geom_point()+
422
+ geom_label(color = "black", show.legend = FALSE) +
423
+ stat_poly_line() +
424
+ stat_poly_eq(use_label(c("R2", "p")), p.digits = 5) +
425
+ theme(legend.position = "none")+
426
+ labs( y = "",x="Disease Duration (Months)")
427
+ GPX1
428
+
429
+ PPP1R9B <- subset_proteins_plot %>%
430
+ subset(SeqId =="21991-79")%>%
431
+ ggplot(aes(Disease_duration, Intensity, label = SampleDescription))+
432
+ facet_wrap( ~ EntrezGeneSymbol)+
433
+ geom_point()+
434
+ geom_label(color = "black", show.legend = FALSE) +
435
+ stat_poly_line() +
436
+ stat_poly_eq(use_label(c("R2", "p")), p.digits = 5) +
437
+ theme(legend.position = "none")+
438
+ labs( y = "",x="Disease Duration (Months)")
439
+ PPP1R9B
440
+ plot_grid(GPX1,PPP1R9B,ncol=2,nrow = 1)
441
+
442
+ ```
443
+
R markdowns/subset_fibroblast_proteomic_overlay.Rmd ADDED
@@ -0,0 +1,144 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ title: "Fibroblast_Pseudobulk_overlap"
3
+ output: html_document
4
+ date: "2024-09-24"
5
+ ---
6
+
7
+ ```{r setup, include=FALSE}
8
+ library(dplyr)
9
+
10
+ ####first set up done with SSc all
11
+ proteomics_df <- read.csv('D:/Data/Data_drive/Data/IS_Protein_data/SSC_all_Healthy_allproteins.csv', row.names = 'Row.names')
12
+ fibroblast_df <- read.csv('D:/Data/Data_drive/GSE138669_RAW/fibroblasts/DESeq2_fibroblasts.csv')
13
+ colnames(fibroblast_df)[1] <- "EntrezGeneSymbol"
14
+ fibroblast_df <- fibroblast_df %>% filter(baseMean >10)
15
+
16
+ upregulated_fibroblast_df <- fibroblast_df %>% filter(log2FoldChange > 0 & padj <0.05)
17
+ downregulated_fibroblast_df <- fibroblast_df %>% filter(log2FoldChange < 0 & padj <0.05)
18
+ upregulated <- upregulated_fibroblast_df$EntrezGeneSymbol
19
+ downregulated <- downregulated_fibroblast_df$EntrezGeneSymbol
20
+
21
+ upregulated_proteomics <- proteomics_df %>% filter(EntrezGeneSymbol %in% upregulated, P.Value <0.05, logFC >0)
22
+ downregulated_proteomics <- proteomics_df %>% filter(EntrezGeneSymbol %in% downregulated, P.Value <0.05, logFC <0)
23
+ labels <- c(upregulated_proteomics$EntrezGeneSymbol,downregulated_proteomics$EntrezGeneSymbol)
24
+
25
+ ```
26
+
27
+ ```{r}
28
+ library(EnhancedVolcano)
29
+
30
+ proteomics_df <- proteomics_df %>%
31
+ mutate(labels = ifelse(
32
+ P.Value < 0.05 & (logFC > 0.585 | logFC < -0.585) & EntrezGeneSymbol %in% labels,
33
+ EntrezGeneSymbol, NA
34
+ ))
35
+ Fibroblast_overlap_volcano <- EnhancedVolcano(data.frame(proteomics_df), x = 'logFC', y = 'P.Value',lab = proteomics_df$labels,selectLab = labels,
36
+ title = 'SSc all vs healthy proteins',
37
+ subtitle = 'Fibroblast differentially expressed genes labelled',
38
+ pCutoff = 0.05,
39
+ FCcutoff = 0.585,
40
+ xlim = c(min(proteomics_df[['logFC']], na.rm = TRUE), max(proteomics_df[['logFC']], na.rm = TRUE)),
41
+ ylim = c(0, max(-log10(proteomics_df[['P.Value']]), na.rm = TRUE)),
42
+ pointSize = 1.0,
43
+ labSize = 2.0,
44
+ labCol = 'grey14',
45
+ colAlpha = 4/5,
46
+ boxedLabels = T,
47
+ legendPosition = 'None',
48
+ drawConnectors = T,
49
+ widthConnectors = 0.6,
50
+ colConnectors = 'black',
51
+ max.overlaps = 20,
52
+ maxoverlapsConnectors = Inf)
53
+ Fibroblast_overlap_volcano
54
+ ```
55
+
56
+ ```{r setup, include=FALSE}
57
+ ####next use SSc high
58
+ proteomics_df <- read.csv('D:/Data/Data_drive/Data/IS_Protein_data/SSC_high_Healthy_allproteins.csv', row.names = 'Row.names')
59
+ fibroblast_df <- read.csv('D:/Data/Data_drive/GSE138669_RAW/fibroblasts/DESeq2_fibroblasts.csv')
60
+ colnames(fibroblast_df)[1] <- "EntrezGeneSymbol"
61
+ fibroblast_df <- fibroblast_df %>% filter(baseMean >10)
62
+
63
+ upregulated_fibroblast_df <- fibroblast_df %>% filter(log2FoldChange > 0 & padj <0.05)
64
+ downregulated_fibroblast_df <- fibroblast_df %>% filter(log2FoldChange < 0 & padj <0.05)
65
+ upregulated <- upregulated_fibroblast_df$EntrezGeneSymbol
66
+ downregulated <- downregulated_fibroblast_df$EntrezGeneSymbol
67
+
68
+ upregulated_proteomics <- proteomics_df %>% filter(EntrezGeneSymbol %in% upregulated, P.Value <0.05, logFC >0)
69
+ downregulated_proteomics <- proteomics_df %>% filter(EntrezGeneSymbol %in% downregulated, P.Value <0.05, logFC <0)
70
+ labels <- c(upregulated_proteomics$EntrezGeneSymbol,downregulated_proteomics$EntrezGeneSymbol)
71
+
72
+ ```
73
+
74
+ ```{r}
75
+ proteomics_df <- proteomics_df %>%
76
+ mutate(labels = ifelse(
77
+ P.Value < 0.05 & (logFC > 0.585 | logFC < -0.585) & EntrezGeneSymbol %in% labels,
78
+ EntrezGeneSymbol, NA
79
+ ))
80
+ Fibroblast_overlap_volcano <- EnhancedVolcano(data.frame(proteomics_df), x = 'logFC', y = 'P.Value',lab = proteomics_df$labels,selectLab = labels,
81
+ title = 'SSc high vs healthy proteins',
82
+ subtitle = 'Fibroblast differentially expressed genes labelled',
83
+ pCutoff = 0.05,
84
+ FCcutoff = 0.585,
85
+ xlim = c(min(proteomics_df[['logFC']], na.rm = TRUE), max(proteomics_df[['logFC']], na.rm = TRUE)),
86
+ ylim = c(0, max(-log10(proteomics_df[['P.Value']]), na.rm = TRUE)),
87
+ pointSize = 1.0,
88
+ labSize = 2.0,
89
+ labCol = 'grey14',
90
+ colAlpha = 4/5,
91
+ boxedLabels = T,
92
+ legendPosition = 'None',
93
+ drawConnectors = T,
94
+ widthConnectors = 0.6,
95
+ colConnectors = 'black',
96
+ max.overlaps = 20,
97
+ maxoverlapsConnectors = Inf)
98
+ Fibroblast_overlap_volcano
99
+ ```
100
+
101
+ ```{r setup, include=FALSE}
102
+ ####next use SSc high
103
+ proteomics_df <- read.csv('D:/Data/Data_drive/Data/IS_Protein_data/VEDOSS_Healthy_allproteins.csv', row.names = 'Row.names')
104
+ fibroblast_df <- read.csv('D:/Data/Data_drive/GSE138669_RAW/fibroblasts/DESeq2_fibroblasts.csv')
105
+ colnames(fibroblast_df)[1] <- "EntrezGeneSymbol"
106
+ fibroblast_df <- fibroblast_df %>% filter(baseMean >10)
107
+
108
+ upregulated_fibroblast_df <- fibroblast_df %>% filter(log2FoldChange > 0 & padj <0.05)
109
+ downregulated_fibroblast_df <- fibroblast_df %>% filter(log2FoldChange < 0 & padj <0.05)
110
+ upregulated <- upregulated_fibroblast_df$EntrezGeneSymbol
111
+ downregulated <- downregulated_fibroblast_df$EntrezGeneSymbol
112
+
113
+ upregulated_proteomics <- proteomics_df %>% filter(EntrezGeneSymbol %in% upregulated, P.Value <0.05, logFC >0)
114
+ downregulated_proteomics <- proteomics_df %>% filter(EntrezGeneSymbol %in% downregulated, P.Value <0.05, logFC <0)
115
+ labels <- c(upregulated_proteomics$EntrezGeneSymbol,downregulated_proteomics$EntrezGeneSymbol)
116
+
117
+ ```
118
+
119
+ ```{r}
120
+ proteomics_df <- proteomics_df %>%
121
+ mutate(labels = ifelse(
122
+ P.Value < 0.05 & (logFC > 0.585 | logFC < -0.585) & EntrezGeneSymbol %in% labels,
123
+ EntrezGeneSymbol, NA
124
+ ))
125
+ Fibroblast_overlap_volcano <- EnhancedVolcano(data.frame(proteomics_df), x = 'logFC', y = 'P.Value',lab = proteomics_df$labels,selectLab = labels,
126
+ title = 'VEDOSS vs healthy proteins',
127
+ subtitle = 'Fibroblast differentially expressed genes labelled',
128
+ pCutoff = 0.05,
129
+ FCcutoff = 0.585,
130
+ xlim = c(min(proteomics_df[['logFC']], na.rm = TRUE), max(proteomics_df[['logFC']], na.rm = TRUE)),
131
+ ylim = c(0, max(-log10(proteomics_df[['P.Value']]), na.rm = TRUE)),
132
+ pointSize = 1.0,
133
+ labSize = 2.0,
134
+ labCol = 'grey14',
135
+ colAlpha = 4/5,
136
+ boxedLabels = T,
137
+ legendPosition = 'None',
138
+ drawConnectors = T,
139
+ widthConnectors = 0.6,
140
+ colConnectors = 'black',
141
+ max.overlaps = 20,
142
+ maxoverlapsConnectors = Inf)
143
+ Fibroblast_overlap_volcano
144
+ ```
README.md ADDED
@@ -0,0 +1,78 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Monitoring Progression of Scleroderma
2
+
3
+ ---
4
+ ## Project Description
5
+ This is a website for visualising datasets to study protein expression in Scleroderma patients. The website is able to
6
+ generate the following plots:
7
+ - Correlation Plot
8
+ - Boxplot
9
+ - UMAP plot
10
+ - Volcano plot
11
+ - Violin plot
12
+
13
+ ---
14
+ ## Table of Contents
15
+ - [Introduction](#introduction)
16
+ - [Features](#features)
17
+ - [Installation](#installation)
18
+ - [Usage](#usage)
19
+ - [Contributing](#contributing)
20
+ - [License](#license)
21
+ - [Contact/Support](#contact)
22
+
23
+ ---
24
+ ## Introduction
25
+ Scleroderma is an autoimmune disease that can cause thickened areas of skin and connective tissues. To gain a deeper
26
+ understanding of this condition, analysing the expression of different proteins observed in Scleroderma patients is
27
+ highly beneficial.
28
+ This website utilizes a dataset to generate 4 graphs, enabling researchers to analyse results while requiring
29
+ minimal bioinformatics expertise.
30
+
31
+
32
+ ---
33
+ ## Features
34
+ ### Selecting Protein
35
+ Users can search for proteins using multiple naming conventions including:
36
+ - Protein Name
37
+ - Full Protein Name
38
+ - Entrez Gene ID
39
+ - Entrez Gene Symbol
40
+
41
+ Alternatively, users can utilize the volcano plot on the main page to select a protein by hovering over and clicking
42
+ on the plot.
43
+ ### Volcano Plot
44
+
45
+ ### Correlation Plot
46
+
47
+ ### Box Plot
48
+
49
+ ### UMAP Plot
50
+
51
+ ### Violin Plot
52
+
53
+ ---
54
+ ## Installation
55
+ 1. Clone the repository:
56
+ ```bash
57
+ git clone https://github.com/ainiimura21/name1.git
58
+ ```
59
+
60
+ 2. Install dependencies:
61
+ ```bash
62
+ pip install numpy pandas matplotlib seaborn streamlit scanpy
63
+ ```
64
+
65
+ ## Usage
66
+ To run the project, use the following command:
67
+ ```bash
68
+ streamlit run app/main.py
69
+ ```
70
+
71
+ ## Contributing
72
+ 1. Fork the repository.
73
+ 2. Create a new branch: `git checkout -b feature-name`.
74
+ 3. Make changes.
75
+ 4. Push your branch: `git push origin feature-name`.
76
+ 5. Create a pull request.
77
+
78
+
app/Correlation.py ADDED
@@ -0,0 +1,92 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import pandas as pd
2
+ import numpy as np
3
+ import seaborn as sns
4
+ import matplotlib.pyplot as plt
5
+ from matplotlib.ticker import LogLocator, NullFormatter
6
+ from dataloader import load_data, filter_data
7
+
8
+
9
+ def plot_correlation(merged_data: pd.DataFrame, protein_name: str):
10
+ """
11
+ Generate a scatter plot of MRSS vs Intensity with hover-over features.
12
+
13
+ Parameters:
14
+ - merged_data: Preprocessed data for plotting.
15
+ - protein_name: Name of the protein for the plot title.
16
+
17
+ Returns:
18
+ - The Matplotlib figure object containing the plot.
19
+ """
20
+ # Extract relevant columns
21
+ mrss = merged_data["mrss"]
22
+ intensity = merged_data["Intensity"]
23
+ condition = merged_data["condition"]
24
+
25
+ # Ensure all intensities are positive for logarithmic scale
26
+ if (intensity <= 0).any():
27
+ raise ValueError("All intensity values must be positive for a logarithmic scale.")
28
+
29
+ # Define custom colours for conditions
30
+ custom_palette = {
31
+ "Healthy": "green",
32
+ "VEDOSS": "violet",
33
+ "SSC_low": "cyan",
34
+ "SSC_high": "red",
35
+ }
36
+
37
+ # Initialize plot
38
+ plt.figure(figsize=(12, 8))
39
+ ax = plt.gca()
40
+
41
+ # Create scatter plot
42
+ sns.scatterplot(
43
+ x=mrss,
44
+ y=intensity,
45
+ hue=condition,
46
+ s=100,
47
+ palette=custom_palette,
48
+ edgecolor="black",
49
+ ax=ax,
50
+ )
51
+
52
+ # Set the y-axis to logarithmic scale
53
+ ax.set_yscale("log")
54
+
55
+ # Configure adaptive limits for y-axis
56
+ y_min = intensity.min() * 0.8
57
+ y_max = intensity.max() * 1.2
58
+ ax.set_ylim(bottom=y_min, top=y_max)
59
+
60
+ # Configure log ticks and formatter for y-axis
61
+ ax.yaxis.set_major_locator(LogLocator(base=10.0, subs=None, numticks=10))
62
+ ax.yaxis.set_minor_locator(LogLocator(base=10.0, subs=np.arange(2, 10) * 0.1, numticks=10))
63
+ ax.yaxis.set_major_formatter(plt.FuncFormatter(lambda x, _: f"{int(x):g}" if x >= 1 else f"{x:.1g}"))
64
+ ax.yaxis.set_minor_formatter(NullFormatter()) # Hide minor tick labels
65
+
66
+ # Add hover-over annotations
67
+ for i in range(len(merged_data)):
68
+ plt.text(
69
+ mrss.iloc[i],
70
+ intensity.iloc[i],
71
+ condition.iloc[i],
72
+ fontsize=9,
73
+ ha="center",
74
+ va="center",
75
+ color="black",
76
+ bbox=dict(
77
+ boxstyle="round,pad=0.2",
78
+ edgecolor="black",
79
+ facecolor=custom_palette.get(condition.iloc[i], "gray"),
80
+ alpha=0.7,
81
+ ),
82
+ )
83
+
84
+ # Title and labels
85
+ plt.title(f"Correlation Plot for {protein_name}", fontsize=16, fontweight="bold")
86
+ plt.xlabel("MRSS (Linear Scale)", fontsize=14)
87
+ plt.ylabel("Intensity (Logarithmic Scale)", fontsize=14)
88
+ plt.grid(which="both", linestyle="--", linewidth=0.5, alpha=0.7)
89
+ plt.tight_layout()
90
+ plt.show()
91
+
92
+ return plt
app/UMAP.py ADDED
@@ -0,0 +1,34 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import scanpy as sc
2
+ import pandas as pd
3
+ from matplotlib.pyplot import rc_context
4
+ from matplotlib.colors import LinearSegmentedColormap
5
+ from dataloader import load_singlecell_data,getEntrezGeneSymbol
6
+
7
+ from pathlib import Path
8
+
9
+ def umap_plot(input_data_key,input_data_value):
10
+ EntrezGeneSymbol = getEntrezGeneSymbol(input_data_key,input_data_value)
11
+ BASE_PATH = Path(__file__).parent
12
+ single_cell_data_path = str(BASE_PATH.parent / "Core data")
13
+ single_cell_data=load_singlecell_data(single_cell_data_path)
14
+
15
+ color_vars=['leiden',EntrezGeneSymbol]
16
+
17
+ # Define colour map as requested by the client (from grey to blue)
18
+ cmap = LinearSegmentedColormap.from_list("grey_to_blue", ["#d3d3d3", "blue"])
19
+
20
+ with rc_context({"figure.figsize": (6, 6)}):
21
+ sc.pl.umap(single_cell_data, color=color_vars, # plot UMAP
22
+ cmap=cmap,
23
+ # /* Reference 1 - taken from https://scanpy.readthedocs.io/en/stable/tutorials/plotting/core.html */
24
+ legend_loc="on data", # Place labels on the data
25
+ frameon=True,
26
+ legend_fontsize=4.5,
27
+ legend_fontoutline=1,)
28
+ # /* end of reference 1 */
29
+
30
+ return sc.pl
31
+
32
+
33
+ # umap_plot('EntrezGeneSymbol','THBS1') # EXAMPLE OF USAGE WITH GENESYMBOL
34
+ # umap_plot('EntrezGeneID','7057')
app/Violin.py ADDED
@@ -0,0 +1,20 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import scanpy as sc
2
+ from pathlib import Path
3
+ import matplotlib.pyplot as plt
4
+ from matplotlib.pyplot import rc_context
5
+ from dataloader import load_singlecell_data,getEntrezGeneSymbol
6
+
7
+ def violin_plot(input_data_key,input_data_value):
8
+ EntrezGeneSymbol = getEntrezGeneSymbol(input_data_key,input_data_value)
9
+ BASE_PATH = Path(__file__).parent
10
+ single_cell_data_path = str(BASE_PATH.parent / "Core data")
11
+ single_cell_data=load_singlecell_data(single_cell_data_path)
12
+
13
+ with rc_context({"figure.figsize": (5, 10)}):
14
+ sc.pl.violin(single_cell_data, [EntrezGeneSymbol], groupby="leiden",rotation=90)
15
+ # plt.subplots_adjust(top=0.02)
16
+ plt.xticks(fontsize=5)
17
+ plt.show()
18
+ return plt
19
+
20
+ # violin_plot('EntrezGeneSymbol','THBS1') # EXAMPLE OF USAGE WITH GENESYMBOL
app/__init__.py ADDED
File without changes
app/__pycache__/Correlation.cpython-311.pyc ADDED
Binary file (5 kB). View file
 
app/__pycache__/Correlation.cpython-312.pyc ADDED
Binary file (4.59 kB). View file
 
app/__pycache__/boxplot.cpython-312.pyc ADDED
Binary file (2.29 kB). View file
 
app/__pycache__/dataloader.cpython-312.pyc ADDED
Binary file (3.51 kB). View file
 
app/__pycache__/volcano.cpython-312.pyc ADDED
Binary file (2.47 kB). View file
 
app/boxplot.ipynb ADDED
@@ -0,0 +1,1629 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "cells": [
3
+ {
4
+ "cell_type": "code",
5
+ "execution_count": 2,
6
+ "metadata": {},
7
+ "outputs": [],
8
+ "source": [
9
+ "import pandas as pd\n",
10
+ "import numpy as np\n",
11
+ "import seaborn as sns\n",
12
+ "import matplotlib.pyplot as plt"
13
+ ]
14
+ },
15
+ {
16
+ "cell_type": "code",
17
+ "execution_count": 3,
18
+ "metadata": {},
19
+ "outputs": [
20
+ {
21
+ "data": {
22
+ "text/html": [
23
+ "<div>\n",
24
+ "<style scoped>\n",
25
+ " .dataframe tbody tr th:only-of-type {\n",
26
+ " vertical-align: middle;\n",
27
+ " }\n",
28
+ "\n",
29
+ " .dataframe tbody tr th {\n",
30
+ " vertical-align: top;\n",
31
+ " }\n",
32
+ "\n",
33
+ " .dataframe thead th {\n",
34
+ " text-align: right;\n",
35
+ " }\n",
36
+ "</style>\n",
37
+ "<table border=\"1\" class=\"dataframe\">\n",
38
+ " <thead>\n",
39
+ " <tr style=\"text-align: right;\">\n",
40
+ " <th></th>\n",
41
+ " <th>ExtIdentifier</th>\n",
42
+ " <th>SubjectID</th>\n",
43
+ " <th>age</th>\n",
44
+ " <th>gender</th>\n",
45
+ " <th>combined</th>\n",
46
+ " <th>ANA</th>\n",
47
+ " <th>Centromere</th>\n",
48
+ " <th>SCL_70</th>\n",
49
+ " <th>RNA_Polymerase_3</th>\n",
50
+ " <th>Lung_Fibrosis_binary</th>\n",
51
+ " <th>Lung_Fibrosis</th>\n",
52
+ " <th>Total_mRss</th>\n",
53
+ " <th>Immunosupression_bin</th>\n",
54
+ " <th>Immunosupression</th>\n",
55
+ " <th>overall</th>\n",
56
+ " <th>category</th>\n",
57
+ " <th>condition</th>\n",
58
+ " <th>low_ssc</th>\n",
59
+ " <th>Disease_duration</th>\n",
60
+ " <th>Local_skin_score</th>\n",
61
+ " </tr>\n",
62
+ " </thead>\n",
63
+ " <tbody>\n",
64
+ " <tr>\n",
65
+ " <th>0</th>\n",
66
+ " <td>EXID40000009256847</td>\n",
67
+ " <td>COO-363</td>\n",
68
+ " <td>50</td>\n",
69
+ " <td>Female</td>\n",
70
+ " <td>50_F</td>\n",
71
+ " <td>1</td>\n",
72
+ " <td>0</td>\n",
73
+ " <td>1</td>\n",
74
+ " <td>0</td>\n",
75
+ " <td>0</td>\n",
76
+ " <td>No</td>\n",
77
+ " <td>0</td>\n",
78
+ " <td>No</td>\n",
79
+ " <td>0</td>\n",
80
+ " <td>Scleroderma</td>\n",
81
+ " <td>VEDOSS</td>\n",
82
+ " <td>VEDOSS</td>\n",
83
+ " <td>no</td>\n",
84
+ " <td>0</td>\n",
85
+ " <td>0</td>\n",
86
+ " </tr>\n",
87
+ " <tr>\n",
88
+ " <th>1</th>\n",
89
+ " <td>EXID40000009257105</td>\n",
90
+ " <td>PDAR-0335</td>\n",
91
+ " <td>42</td>\n",
92
+ " <td>Female</td>\n",
93
+ " <td>42_F</td>\n",
94
+ " <td>0</td>\n",
95
+ " <td>0</td>\n",
96
+ " <td>0</td>\n",
97
+ " <td>0</td>\n",
98
+ " <td>0</td>\n",
99
+ " <td>No</td>\n",
100
+ " <td>0</td>\n",
101
+ " <td>No</td>\n",
102
+ " <td>0</td>\n",
103
+ " <td>Healthy</td>\n",
104
+ " <td>Healthy</td>\n",
105
+ " <td>Healthy</td>\n",
106
+ " <td>no</td>\n",
107
+ " <td>0</td>\n",
108
+ " <td>0</td>\n",
109
+ " </tr>\n",
110
+ " <tr>\n",
111
+ " <th>2</th>\n",
112
+ " <td>EXID40000009257119</td>\n",
113
+ " <td>COO-005</td>\n",
114
+ " <td>51</td>\n",
115
+ " <td>Male</td>\n",
116
+ " <td>51_M</td>\n",
117
+ " <td>1</td>\n",
118
+ " <td>0</td>\n",
119
+ " <td>0</td>\n",
120
+ " <td>0</td>\n",
121
+ " <td>1</td>\n",
122
+ " <td>Yes</td>\n",
123
+ " <td>2</td>\n",
124
+ " <td>Yes</td>\n",
125
+ " <td>1</td>\n",
126
+ " <td>Scleroderma</td>\n",
127
+ " <td>Scleroderma</td>\n",
128
+ " <td>SSC_low</td>\n",
129
+ " <td>low</td>\n",
130
+ " <td>156</td>\n",
131
+ " <td>0</td>\n",
132
+ " </tr>\n",
133
+ " <tr>\n",
134
+ " <th>3</th>\n",
135
+ " <td>EXID40000009257121</td>\n",
136
+ " <td>COO-429</td>\n",
137
+ " <td>70</td>\n",
138
+ " <td>Female</td>\n",
139
+ " <td>70_F</td>\n",
140
+ " <td>1</td>\n",
141
+ " <td>0</td>\n",
142
+ " <td>0</td>\n",
143
+ " <td>1</td>\n",
144
+ " <td>1</td>\n",
145
+ " <td>Yes</td>\n",
146
+ " <td>33</td>\n",
147
+ " <td>No</td>\n",
148
+ " <td>0</td>\n",
149
+ " <td>Scleroderma</td>\n",
150
+ " <td>Scleroderma</td>\n",
151
+ " <td>SSC_high</td>\n",
152
+ " <td>no</td>\n",
153
+ " <td>0</td>\n",
154
+ " <td>2</td>\n",
155
+ " </tr>\n",
156
+ " <tr>\n",
157
+ " <th>4</th>\n",
158
+ " <td>EXID40000009257122</td>\n",
159
+ " <td>COO-425</td>\n",
160
+ " <td>78</td>\n",
161
+ " <td>Female</td>\n",
162
+ " <td>78_F</td>\n",
163
+ " <td>1</td>\n",
164
+ " <td>0</td>\n",
165
+ " <td>1</td>\n",
166
+ " <td>0</td>\n",
167
+ " <td>1</td>\n",
168
+ " <td>Yes</td>\n",
169
+ " <td>18</td>\n",
170
+ " <td>Yes</td>\n",
171
+ " <td>1</td>\n",
172
+ " <td>Scleroderma</td>\n",
173
+ " <td>Scleroderma</td>\n",
174
+ " <td>SSC_low</td>\n",
175
+ " <td>low</td>\n",
176
+ " <td>60</td>\n",
177
+ " <td>1</td>\n",
178
+ " </tr>\n",
179
+ " </tbody>\n",
180
+ "</table>\n",
181
+ "</div>"
182
+ ],
183
+ "text/plain": [
184
+ " ExtIdentifier SubjectID age gender combined ANA Centromere \\\n",
185
+ "0 EXID40000009256847 COO-363 50 Female 50_F 1 0 \n",
186
+ "1 EXID40000009257105 PDAR-0335 42 Female 42_F 0 0 \n",
187
+ "2 EXID40000009257119 COO-005 51 Male 51_M 1 0 \n",
188
+ "3 EXID40000009257121 COO-429 70 Female 70_F 1 0 \n",
189
+ "4 EXID40000009257122 COO-425 78 Female 78_F 1 0 \n",
190
+ "\n",
191
+ " SCL_70 RNA_Polymerase_3 Lung_Fibrosis_binary Lung_Fibrosis Total_mRss \\\n",
192
+ "0 1 0 0 No 0 \n",
193
+ "1 0 0 0 No 0 \n",
194
+ "2 0 0 1 Yes 2 \n",
195
+ "3 0 1 1 Yes 33 \n",
196
+ "4 1 0 1 Yes 18 \n",
197
+ "\n",
198
+ " Immunosupression_bin Immunosupression overall category condition \\\n",
199
+ "0 No 0 Scleroderma VEDOSS VEDOSS \n",
200
+ "1 No 0 Healthy Healthy Healthy \n",
201
+ "2 Yes 1 Scleroderma Scleroderma SSC_low \n",
202
+ "3 No 0 Scleroderma Scleroderma SSC_high \n",
203
+ "4 Yes 1 Scleroderma Scleroderma SSC_low \n",
204
+ "\n",
205
+ " low_ssc Disease_duration Local_skin_score \n",
206
+ "0 no 0 0 \n",
207
+ "1 no 0 0 \n",
208
+ "2 low 156 0 \n",
209
+ "3 no 0 2 \n",
210
+ "4 low 60 1 "
211
+ ]
212
+ },
213
+ "execution_count": 57,
214
+ "metadata": {},
215
+ "output_type": "execute_result"
216
+ }
217
+ ],
218
+ "source": [
219
+ "METADATA_PATH = \"../Core data/somalogic_metadata.csv\"\n",
220
+ "PROTEINS_PATH = \"../Core data/proteins_plot.csv\"\n",
221
+ "metadata = pd.read_csv(METADATA_PATH)\n",
222
+ "proteins = pd.read_csv(PROTEINS_PATH)\n",
223
+ "valid_columns = {\n",
224
+ " \"TargetFullName\": \"TargetFullName\",\n",
225
+ " \"Target\": \"Target\",\n",
226
+ " \"EntrezGeneID\": \"EntrezGeneID\",\n",
227
+ " \"EntrezGeneSymbol\": \"EntrezGeneSymbol\"\n",
228
+ " }\n",
229
+ "metadata.head()\n"
230
+ ]
231
+ },
232
+ {
233
+ "cell_type": "code",
234
+ "execution_count": 66,
235
+ "metadata": {},
236
+ "outputs": [
237
+ {
238
+ "data": {
239
+ "text/html": [
240
+ "<div>\n",
241
+ "<style scoped>\n",
242
+ " .dataframe tbody tr th:only-of-type {\n",
243
+ " vertical-align: middle;\n",
244
+ " }\n",
245
+ "\n",
246
+ " .dataframe tbody tr th {\n",
247
+ " vertical-align: top;\n",
248
+ " }\n",
249
+ "\n",
250
+ " .dataframe thead th {\n",
251
+ " text-align: right;\n",
252
+ " }\n",
253
+ "</style>\n",
254
+ "<table border=\"1\" class=\"dataframe\">\n",
255
+ " <thead>\n",
256
+ " <tr style=\"text-align: right;\">\n",
257
+ " <th></th>\n",
258
+ " <th>Unnamed: 0</th>\n",
259
+ " <th>SeqId</th>\n",
260
+ " <th>PlateId</th>\n",
261
+ " <th>PlateRunDate</th>\n",
262
+ " <th>ScannerID</th>\n",
263
+ " <th>PlatePosition</th>\n",
264
+ " <th>SlideId</th>\n",
265
+ " <th>Subarray</th>\n",
266
+ " <th>SampleId</th>\n",
267
+ " <th>SampleType</th>\n",
268
+ " <th>...</th>\n",
269
+ " <th>TargetFullName</th>\n",
270
+ " <th>Target</th>\n",
271
+ " <th>UniProt</th>\n",
272
+ " <th>EntrezGeneID</th>\n",
273
+ " <th>EntrezGeneSymbol</th>\n",
274
+ " <th>Organism</th>\n",
275
+ " <th>Units</th>\n",
276
+ " <th>Type</th>\n",
277
+ " <th>Dilution</th>\n",
278
+ " <th>PlateScale_Reference</th>\n",
279
+ " </tr>\n",
280
+ " </thead>\n",
281
+ " <tbody>\n",
282
+ " <tr>\n",
283
+ " <th>0</th>\n",
284
+ " <td>1</td>\n",
285
+ " <td>10000-28</td>\n",
286
+ " <td>PLT24684</td>\n",
287
+ " <td>2023-08-13</td>\n",
288
+ " <td>SG16064525, SG17164580</td>\n",
289
+ " <td>C8</td>\n",
290
+ " <td>258633888845</td>\n",
291
+ " <td>3</td>\n",
292
+ " <td>COO-363</td>\n",
293
+ " <td>Sample</td>\n",
294
+ " <td>...</td>\n",
295
+ " <td>Beta-crystallin B2</td>\n",
296
+ " <td>CRBB2</td>\n",
297
+ " <td>P43320</td>\n",
298
+ " <td>1415</td>\n",
299
+ " <td>CRYBB2</td>\n",
300
+ " <td>Human</td>\n",
301
+ " <td>RFU</td>\n",
302
+ " <td>Protein</td>\n",
303
+ " <td>2.5</td>\n",
304
+ " <td>292.15</td>\n",
305
+ " </tr>\n",
306
+ " <tr>\n",
307
+ " <th>1</th>\n",
308
+ " <td>2</td>\n",
309
+ " <td>10000-28</td>\n",
310
+ " <td>PLT24684</td>\n",
311
+ " <td>2023-08-13</td>\n",
312
+ " <td>SG16064525, SG17164580</td>\n",
313
+ " <td>C9</td>\n",
314
+ " <td>258633888846</td>\n",
315
+ " <td>3</td>\n",
316
+ " <td>PDAR-0335</td>\n",
317
+ " <td>Sample</td>\n",
318
+ " <td>...</td>\n",
319
+ " <td>Beta-crystallin B2</td>\n",
320
+ " <td>CRBB2</td>\n",
321
+ " <td>P43320</td>\n",
322
+ " <td>1415</td>\n",
323
+ " <td>CRYBB2</td>\n",
324
+ " <td>Human</td>\n",
325
+ " <td>RFU</td>\n",
326
+ " <td>Protein</td>\n",
327
+ " <td>2.5</td>\n",
328
+ " <td>292.15</td>\n",
329
+ " </tr>\n",
330
+ " <tr>\n",
331
+ " <th>2</th>\n",
332
+ " <td>3</td>\n",
333
+ " <td>10000-28</td>\n",
334
+ " <td>PLT24684</td>\n",
335
+ " <td>2023-08-13</td>\n",
336
+ " <td>SG16064525, SG17164580</td>\n",
337
+ " <td>E8</td>\n",
338
+ " <td>258633888845</td>\n",
339
+ " <td>5</td>\n",
340
+ " <td>COO-005</td>\n",
341
+ " <td>Sample</td>\n",
342
+ " <td>...</td>\n",
343
+ " <td>Beta-crystallin B2</td>\n",
344
+ " <td>CRBB2</td>\n",
345
+ " <td>P43320</td>\n",
346
+ " <td>1415</td>\n",
347
+ " <td>CRYBB2</td>\n",
348
+ " <td>Human</td>\n",
349
+ " <td>RFU</td>\n",
350
+ " <td>Protein</td>\n",
351
+ " <td>2.5</td>\n",
352
+ " <td>292.15</td>\n",
353
+ " </tr>\n",
354
+ " <tr>\n",
355
+ " <th>3</th>\n",
356
+ " <td>4</td>\n",
357
+ " <td>10000-28</td>\n",
358
+ " <td>PLT24684</td>\n",
359
+ " <td>2023-08-13</td>\n",
360
+ " <td>SG16064525, SG17164580</td>\n",
361
+ " <td>F8</td>\n",
362
+ " <td>258633888845</td>\n",
363
+ " <td>6</td>\n",
364
+ " <td>COO-429</td>\n",
365
+ " <td>Sample</td>\n",
366
+ " <td>...</td>\n",
367
+ " <td>Beta-crystallin B2</td>\n",
368
+ " <td>CRBB2</td>\n",
369
+ " <td>P43320</td>\n",
370
+ " <td>1415</td>\n",
371
+ " <td>CRYBB2</td>\n",
372
+ " <td>Human</td>\n",
373
+ " <td>RFU</td>\n",
374
+ " <td>Protein</td>\n",
375
+ " <td>2.5</td>\n",
376
+ " <td>292.15</td>\n",
377
+ " </tr>\n",
378
+ " <tr>\n",
379
+ " <th>4</th>\n",
380
+ " <td>5</td>\n",
381
+ " <td>10000-28</td>\n",
382
+ " <td>PLT24684</td>\n",
383
+ " <td>2023-08-13</td>\n",
384
+ " <td>SG16064525, SG17164580</td>\n",
385
+ " <td>F7</td>\n",
386
+ " <td>258633888844</td>\n",
387
+ " <td>6</td>\n",
388
+ " <td>COO-425</td>\n",
389
+ " <td>Sample</td>\n",
390
+ " <td>...</td>\n",
391
+ " <td>Beta-crystallin B2</td>\n",
392
+ " <td>CRBB2</td>\n",
393
+ " <td>P43320</td>\n",
394
+ " <td>1415</td>\n",
395
+ " <td>CRYBB2</td>\n",
396
+ " <td>Human</td>\n",
397
+ " <td>RFU</td>\n",
398
+ " <td>Protein</td>\n",
399
+ " <td>2.5</td>\n",
400
+ " <td>292.15</td>\n",
401
+ " </tr>\n",
402
+ " <tr>\n",
403
+ " <th>...</th>\n",
404
+ " <td>...</td>\n",
405
+ " <td>...</td>\n",
406
+ " <td>...</td>\n",
407
+ " <td>...</td>\n",
408
+ " <td>...</td>\n",
409
+ " <td>...</td>\n",
410
+ " <td>...</td>\n",
411
+ " <td>...</td>\n",
412
+ " <td>...</td>\n",
413
+ " <td>...</td>\n",
414
+ " <td>...</td>\n",
415
+ " <td>...</td>\n",
416
+ " <td>...</td>\n",
417
+ " <td>...</td>\n",
418
+ " <td>...</td>\n",
419
+ " <td>...</td>\n",
420
+ " <td>...</td>\n",
421
+ " <td>...</td>\n",
422
+ " <td>...</td>\n",
423
+ " <td>...</td>\n",
424
+ " <td>...</td>\n",
425
+ " </tr>\n",
426
+ " <tr>\n",
427
+ " <th>94752</th>\n",
428
+ " <td>94753</td>\n",
429
+ " <td>9999-1</td>\n",
430
+ " <td>PLT24684</td>\n",
431
+ " <td>2023-08-13</td>\n",
432
+ " <td>SG16064525, SG17164580</td>\n",
433
+ " <td>A9</td>\n",
434
+ " <td>258633888846</td>\n",
435
+ " <td>1</td>\n",
436
+ " <td>COO-428</td>\n",
437
+ " <td>Sample</td>\n",
438
+ " <td>...</td>\n",
439
+ " <td>Interferon regulatory factor 6</td>\n",
440
+ " <td>IRF6</td>\n",
441
+ " <td>O14896</td>\n",
442
+ " <td>3664</td>\n",
443
+ " <td>IRF6</td>\n",
444
+ " <td>Human</td>\n",
445
+ " <td>RFU</td>\n",
446
+ " <td>Protein</td>\n",
447
+ " <td>2.5</td>\n",
448
+ " <td>409.75</td>\n",
449
+ " </tr>\n",
450
+ " <tr>\n",
451
+ " <th>94753</th>\n",
452
+ " <td>94754</td>\n",
453
+ " <td>9999-1</td>\n",
454
+ " <td>PLT24684</td>\n",
455
+ " <td>2023-08-13</td>\n",
456
+ " <td>SG16064525, SG17164580</td>\n",
457
+ " <td>D8</td>\n",
458
+ " <td>258633888845</td>\n",
459
+ " <td>4</td>\n",
460
+ " <td>COO-403</td>\n",
461
+ " <td>Sample</td>\n",
462
+ " <td>...</td>\n",
463
+ " <td>Interferon regulatory factor 6</td>\n",
464
+ " <td>IRF6</td>\n",
465
+ " <td>O14896</td>\n",
466
+ " <td>3664</td>\n",
467
+ " <td>IRF6</td>\n",
468
+ " <td>Human</td>\n",
469
+ " <td>RFU</td>\n",
470
+ " <td>Protein</td>\n",
471
+ " <td>2.5</td>\n",
472
+ " <td>409.75</td>\n",
473
+ " </tr>\n",
474
+ " <tr>\n",
475
+ " <th>94754</th>\n",
476
+ " <td>94755</td>\n",
477
+ " <td>9999-1</td>\n",
478
+ " <td>PLT24684</td>\n",
479
+ " <td>2023-08-13</td>\n",
480
+ " <td>SG16064525, SG17164580</td>\n",
481
+ " <td>D9</td>\n",
482
+ " <td>258633888846</td>\n",
483
+ " <td>4</td>\n",
484
+ " <td>PDAR-0343</td>\n",
485
+ " <td>Sample</td>\n",
486
+ " <td>...</td>\n",
487
+ " <td>Interferon regulatory factor 6</td>\n",
488
+ " <td>IRF6</td>\n",
489
+ " <td>O14896</td>\n",
490
+ " <td>3664</td>\n",
491
+ " <td>IRF6</td>\n",
492
+ " <td>Human</td>\n",
493
+ " <td>RFU</td>\n",
494
+ " <td>Protein</td>\n",
495
+ " <td>2.5</td>\n",
496
+ " <td>409.75</td>\n",
497
+ " </tr>\n",
498
+ " <tr>\n",
499
+ " <th>94755</th>\n",
500
+ " <td>94756</td>\n",
501
+ " <td>9999-1</td>\n",
502
+ " <td>PLT24684</td>\n",
503
+ " <td>2023-08-13</td>\n",
504
+ " <td>SG16064525, SG17164580</td>\n",
505
+ " <td>G9</td>\n",
506
+ " <td>258633888846</td>\n",
507
+ " <td>7</td>\n",
508
+ " <td>COO-180</td>\n",
509
+ " <td>Sample</td>\n",
510
+ " <td>...</td>\n",
511
+ " <td>Interferon regulatory factor 6</td>\n",
512
+ " <td>IRF6</td>\n",
513
+ " <td>O14896</td>\n",
514
+ " <td>3664</td>\n",
515
+ " <td>IRF6</td>\n",
516
+ " <td>Human</td>\n",
517
+ " <td>RFU</td>\n",
518
+ " <td>Protein</td>\n",
519
+ " <td>2.5</td>\n",
520
+ " <td>409.75</td>\n",
521
+ " </tr>\n",
522
+ " <tr>\n",
523
+ " <th>94756</th>\n",
524
+ " <td>94757</td>\n",
525
+ " <td>9999-1</td>\n",
526
+ " <td>PLT24684</td>\n",
527
+ " <td>2023-08-13</td>\n",
528
+ " <td>SG16064525, SG17164580</td>\n",
529
+ " <td>E7</td>\n",
530
+ " <td>258633888844</td>\n",
531
+ " <td>5</td>\n",
532
+ " <td>PDAR-0344</td>\n",
533
+ " <td>Sample</td>\n",
534
+ " <td>...</td>\n",
535
+ " <td>Interferon regulatory factor 6</td>\n",
536
+ " <td>IRF6</td>\n",
537
+ " <td>O14896</td>\n",
538
+ " <td>3664</td>\n",
539
+ " <td>IRF6</td>\n",
540
+ " <td>Human</td>\n",
541
+ " <td>RFU</td>\n",
542
+ " <td>Protein</td>\n",
543
+ " <td>2.5</td>\n",
544
+ " <td>409.75</td>\n",
545
+ " </tr>\n",
546
+ " </tbody>\n",
547
+ "</table>\n",
548
+ "<p>94757 rows × 43 columns</p>\n",
549
+ "</div>"
550
+ ],
551
+ "text/plain": [
552
+ " Unnamed: 0 SeqId PlateId PlateRunDate ScannerID \\\n",
553
+ "0 1 10000-28 PLT24684 2023-08-13 SG16064525, SG17164580 \n",
554
+ "1 2 10000-28 PLT24684 2023-08-13 SG16064525, SG17164580 \n",
555
+ "2 3 10000-28 PLT24684 2023-08-13 SG16064525, SG17164580 \n",
556
+ "3 4 10000-28 PLT24684 2023-08-13 SG16064525, SG17164580 \n",
557
+ "4 5 10000-28 PLT24684 2023-08-13 SG16064525, SG17164580 \n",
558
+ "... ... ... ... ... ... \n",
559
+ "94752 94753 9999-1 PLT24684 2023-08-13 SG16064525, SG17164580 \n",
560
+ "94753 94754 9999-1 PLT24684 2023-08-13 SG16064525, SG17164580 \n",
561
+ "94754 94755 9999-1 PLT24684 2023-08-13 SG16064525, SG17164580 \n",
562
+ "94755 94756 9999-1 PLT24684 2023-08-13 SG16064525, SG17164580 \n",
563
+ "94756 94757 9999-1 PLT24684 2023-08-13 SG16064525, SG17164580 \n",
564
+ "\n",
565
+ " PlatePosition SlideId Subarray SampleId SampleType ... \\\n",
566
+ "0 C8 258633888845 3 COO-363 Sample ... \n",
567
+ "1 C9 258633888846 3 PDAR-0335 Sample ... \n",
568
+ "2 E8 258633888845 5 COO-005 Sample ... \n",
569
+ "3 F8 258633888845 6 COO-429 Sample ... \n",
570
+ "4 F7 258633888844 6 COO-425 Sample ... \n",
571
+ "... ... ... ... ... ... ... \n",
572
+ "94752 A9 258633888846 1 COO-428 Sample ... \n",
573
+ "94753 D8 258633888845 4 COO-403 Sample ... \n",
574
+ "94754 D9 258633888846 4 PDAR-0343 Sample ... \n",
575
+ "94755 G9 258633888846 7 COO-180 Sample ... \n",
576
+ "94756 E7 258633888844 5 PDAR-0344 Sample ... \n",
577
+ "\n",
578
+ " TargetFullName Target UniProt EntrezGeneID \\\n",
579
+ "0 Beta-crystallin B2 CRBB2 P43320 1415 \n",
580
+ "1 Beta-crystallin B2 CRBB2 P43320 1415 \n",
581
+ "2 Beta-crystallin B2 CRBB2 P43320 1415 \n",
582
+ "3 Beta-crystallin B2 CRBB2 P43320 1415 \n",
583
+ "4 Beta-crystallin B2 CRBB2 P43320 1415 \n",
584
+ "... ... ... ... ... \n",
585
+ "94752 Interferon regulatory factor 6 IRF6 O14896 3664 \n",
586
+ "94753 Interferon regulatory factor 6 IRF6 O14896 3664 \n",
587
+ "94754 Interferon regulatory factor 6 IRF6 O14896 3664 \n",
588
+ "94755 Interferon regulatory factor 6 IRF6 O14896 3664 \n",
589
+ "94756 Interferon regulatory factor 6 IRF6 O14896 3664 \n",
590
+ "\n",
591
+ " EntrezGeneSymbol Organism Units Type Dilution \\\n",
592
+ "0 CRYBB2 Human RFU Protein 2.5 \n",
593
+ "1 CRYBB2 Human RFU Protein 2.5 \n",
594
+ "2 CRYBB2 Human RFU Protein 2.5 \n",
595
+ "3 CRYBB2 Human RFU Protein 2.5 \n",
596
+ "4 CRYBB2 Human RFU Protein 2.5 \n",
597
+ "... ... ... ... ... ... \n",
598
+ "94752 IRF6 Human RFU Protein 2.5 \n",
599
+ "94753 IRF6 Human RFU Protein 2.5 \n",
600
+ "94754 IRF6 Human RFU Protein 2.5 \n",
601
+ "94755 IRF6 Human RFU Protein 2.5 \n",
602
+ "94756 IRF6 Human RFU Protein 2.5 \n",
603
+ "\n",
604
+ " PlateScale_Reference \n",
605
+ "0 292.15 \n",
606
+ "1 292.15 \n",
607
+ "2 292.15 \n",
608
+ "3 292.15 \n",
609
+ "4 292.15 \n",
610
+ "... ... \n",
611
+ "94752 409.75 \n",
612
+ "94753 409.75 \n",
613
+ "94754 409.75 \n",
614
+ "94755 409.75 \n",
615
+ "94756 409.75 \n",
616
+ "\n",
617
+ "[94757 rows x 43 columns]"
618
+ ]
619
+ },
620
+ "execution_count": 66,
621
+ "metadata": {},
622
+ "output_type": "execute_result"
623
+ }
624
+ ],
625
+ "source": [
626
+ "proteins"
627
+ ]
628
+ },
629
+ {
630
+ "cell_type": "code",
631
+ "execution_count": 68,
632
+ "metadata": {},
633
+ "outputs": [
634
+ {
635
+ "name": "stdout",
636
+ "output_type": "stream",
637
+ "text": [
638
+ "TargetFullName\n",
639
+ "Filtered Data for Interferon regulatory factor 6:\n"
640
+ ]
641
+ },
642
+ {
643
+ "data": {
644
+ "text/html": [
645
+ "<div>\n",
646
+ "<style scoped>\n",
647
+ " .dataframe tbody tr th:only-of-type {\n",
648
+ " vertical-align: middle;\n",
649
+ " }\n",
650
+ "\n",
651
+ " .dataframe tbody tr th {\n",
652
+ " vertical-align: top;\n",
653
+ " }\n",
654
+ "\n",
655
+ " .dataframe thead th {\n",
656
+ " text-align: right;\n",
657
+ " }\n",
658
+ "</style>\n",
659
+ "<table border=\"1\" class=\"dataframe\">\n",
660
+ " <thead>\n",
661
+ " <tr style=\"text-align: right;\">\n",
662
+ " <th></th>\n",
663
+ " <th>Unnamed: 0</th>\n",
664
+ " <th>SeqId</th>\n",
665
+ " <th>PlateId</th>\n",
666
+ " <th>PlateRunDate</th>\n",
667
+ " <th>ScannerID</th>\n",
668
+ " <th>PlatePosition</th>\n",
669
+ " <th>SlideId</th>\n",
670
+ " <th>Subarray</th>\n",
671
+ " <th>SampleId</th>\n",
672
+ " <th>SampleType</th>\n",
673
+ " <th>...</th>\n",
674
+ " <th>TargetFullName</th>\n",
675
+ " <th>Target</th>\n",
676
+ " <th>UniProt</th>\n",
677
+ " <th>EntrezGeneID</th>\n",
678
+ " <th>EntrezGeneSymbol</th>\n",
679
+ " <th>Organism</th>\n",
680
+ " <th>Units</th>\n",
681
+ " <th>Type</th>\n",
682
+ " <th>Dilution</th>\n",
683
+ " <th>PlateScale_Reference</th>\n",
684
+ " </tr>\n",
685
+ " </thead>\n",
686
+ " <tbody>\n",
687
+ " <tr>\n",
688
+ " <th>94744</th>\n",
689
+ " <td>94745</td>\n",
690
+ " <td>9999-1</td>\n",
691
+ " <td>PLT24684</td>\n",
692
+ " <td>2023-08-13</td>\n",
693
+ " <td>SG16064525, SG17164580</td>\n",
694
+ " <td>C8</td>\n",
695
+ " <td>258633888845</td>\n",
696
+ " <td>3</td>\n",
697
+ " <td>COO-363</td>\n",
698
+ " <td>Sample</td>\n",
699
+ " <td>...</td>\n",
700
+ " <td>Interferon regulatory factor 6</td>\n",
701
+ " <td>IRF6</td>\n",
702
+ " <td>O14896</td>\n",
703
+ " <td>3664</td>\n",
704
+ " <td>IRF6</td>\n",
705
+ " <td>Human</td>\n",
706
+ " <td>RFU</td>\n",
707
+ " <td>Protein</td>\n",
708
+ " <td>2.5</td>\n",
709
+ " <td>409.75</td>\n",
710
+ " </tr>\n",
711
+ " <tr>\n",
712
+ " <th>94745</th>\n",
713
+ " <td>94746</td>\n",
714
+ " <td>9999-1</td>\n",
715
+ " <td>PLT24684</td>\n",
716
+ " <td>2023-08-13</td>\n",
717
+ " <td>SG16064525, SG17164580</td>\n",
718
+ " <td>C9</td>\n",
719
+ " <td>258633888846</td>\n",
720
+ " <td>3</td>\n",
721
+ " <td>PDAR-0335</td>\n",
722
+ " <td>Sample</td>\n",
723
+ " <td>...</td>\n",
724
+ " <td>Interferon regulatory factor 6</td>\n",
725
+ " <td>IRF6</td>\n",
726
+ " <td>O14896</td>\n",
727
+ " <td>3664</td>\n",
728
+ " <td>IRF6</td>\n",
729
+ " <td>Human</td>\n",
730
+ " <td>RFU</td>\n",
731
+ " <td>Protein</td>\n",
732
+ " <td>2.5</td>\n",
733
+ " <td>409.75</td>\n",
734
+ " </tr>\n",
735
+ " <tr>\n",
736
+ " <th>94746</th>\n",
737
+ " <td>94747</td>\n",
738
+ " <td>9999-1</td>\n",
739
+ " <td>PLT24684</td>\n",
740
+ " <td>2023-08-13</td>\n",
741
+ " <td>SG16064525, SG17164580</td>\n",
742
+ " <td>E8</td>\n",
743
+ " <td>258633888845</td>\n",
744
+ " <td>5</td>\n",
745
+ " <td>COO-005</td>\n",
746
+ " <td>Sample</td>\n",
747
+ " <td>...</td>\n",
748
+ " <td>Interferon regulatory factor 6</td>\n",
749
+ " <td>IRF6</td>\n",
750
+ " <td>O14896</td>\n",
751
+ " <td>3664</td>\n",
752
+ " <td>IRF6</td>\n",
753
+ " <td>Human</td>\n",
754
+ " <td>RFU</td>\n",
755
+ " <td>Protein</td>\n",
756
+ " <td>2.5</td>\n",
757
+ " <td>409.75</td>\n",
758
+ " </tr>\n",
759
+ " <tr>\n",
760
+ " <th>94747</th>\n",
761
+ " <td>94748</td>\n",
762
+ " <td>9999-1</td>\n",
763
+ " <td>PLT24684</td>\n",
764
+ " <td>2023-08-13</td>\n",
765
+ " <td>SG16064525, SG17164580</td>\n",
766
+ " <td>F8</td>\n",
767
+ " <td>258633888845</td>\n",
768
+ " <td>6</td>\n",
769
+ " <td>COO-429</td>\n",
770
+ " <td>Sample</td>\n",
771
+ " <td>...</td>\n",
772
+ " <td>Interferon regulatory factor 6</td>\n",
773
+ " <td>IRF6</td>\n",
774
+ " <td>O14896</td>\n",
775
+ " <td>3664</td>\n",
776
+ " <td>IRF6</td>\n",
777
+ " <td>Human</td>\n",
778
+ " <td>RFU</td>\n",
779
+ " <td>Protein</td>\n",
780
+ " <td>2.5</td>\n",
781
+ " <td>409.75</td>\n",
782
+ " </tr>\n",
783
+ " <tr>\n",
784
+ " <th>94748</th>\n",
785
+ " <td>94749</td>\n",
786
+ " <td>9999-1</td>\n",
787
+ " <td>PLT24684</td>\n",
788
+ " <td>2023-08-13</td>\n",
789
+ " <td>SG16064525, SG17164580</td>\n",
790
+ " <td>F7</td>\n",
791
+ " <td>258633888844</td>\n",
792
+ " <td>6</td>\n",
793
+ " <td>COO-425</td>\n",
794
+ " <td>Sample</td>\n",
795
+ " <td>...</td>\n",
796
+ " <td>Interferon regulatory factor 6</td>\n",
797
+ " <td>IRF6</td>\n",
798
+ " <td>O14896</td>\n",
799
+ " <td>3664</td>\n",
800
+ " <td>IRF6</td>\n",
801
+ " <td>Human</td>\n",
802
+ " <td>RFU</td>\n",
803
+ " <td>Protein</td>\n",
804
+ " <td>2.5</td>\n",
805
+ " <td>409.75</td>\n",
806
+ " </tr>\n",
807
+ " </tbody>\n",
808
+ "</table>\n",
809
+ "<p>5 rows × 43 columns</p>\n",
810
+ "</div>"
811
+ ],
812
+ "text/plain": [
813
+ " Unnamed: 0 SeqId PlateId PlateRunDate ScannerID \\\n",
814
+ "94744 94745 9999-1 PLT24684 2023-08-13 SG16064525, SG17164580 \n",
815
+ "94745 94746 9999-1 PLT24684 2023-08-13 SG16064525, SG17164580 \n",
816
+ "94746 94747 9999-1 PLT24684 2023-08-13 SG16064525, SG17164580 \n",
817
+ "94747 94748 9999-1 PLT24684 2023-08-13 SG16064525, SG17164580 \n",
818
+ "94748 94749 9999-1 PLT24684 2023-08-13 SG16064525, SG17164580 \n",
819
+ "\n",
820
+ " PlatePosition SlideId Subarray SampleId SampleType ... \\\n",
821
+ "94744 C8 258633888845 3 COO-363 Sample ... \n",
822
+ "94745 C9 258633888846 3 PDAR-0335 Sample ... \n",
823
+ "94746 E8 258633888845 5 COO-005 Sample ... \n",
824
+ "94747 F8 258633888845 6 COO-429 Sample ... \n",
825
+ "94748 F7 258633888844 6 COO-425 Sample ... \n",
826
+ "\n",
827
+ " TargetFullName Target UniProt EntrezGeneID \\\n",
828
+ "94744 Interferon regulatory factor 6 IRF6 O14896 3664 \n",
829
+ "94745 Interferon regulatory factor 6 IRF6 O14896 3664 \n",
830
+ "94746 Interferon regulatory factor 6 IRF6 O14896 3664 \n",
831
+ "94747 Interferon regulatory factor 6 IRF6 O14896 3664 \n",
832
+ "94748 Interferon regulatory factor 6 IRF6 O14896 3664 \n",
833
+ "\n",
834
+ " EntrezGeneSymbol Organism Units Type Dilution \\\n",
835
+ "94744 IRF6 Human RFU Protein 2.5 \n",
836
+ "94745 IRF6 Human RFU Protein 2.5 \n",
837
+ "94746 IRF6 Human RFU Protein 2.5 \n",
838
+ "94747 IRF6 Human RFU Protein 2.5 \n",
839
+ "94748 IRF6 Human RFU Protein 2.5 \n",
840
+ "\n",
841
+ " PlateScale_Reference \n",
842
+ "94744 409.75 \n",
843
+ "94745 409.75 \n",
844
+ "94746 409.75 \n",
845
+ "94747 409.75 \n",
846
+ "94748 409.75 \n",
847
+ "\n",
848
+ "[5 rows x 43 columns]"
849
+ ]
850
+ },
851
+ "execution_count": 68,
852
+ "metadata": {},
853
+ "output_type": "execute_result"
854
+ }
855
+ ],
856
+ "source": [
857
+ "id_type = \"TargetFullName\"\n",
858
+ "column_name = valid_columns[id_type]\n",
859
+ "print(column_name)\n",
860
+ "protein_id = \"Interferon regulatory factor 6\"\n",
861
+ "filtered_data = proteins[proteins[column_name] == protein_id]\n",
862
+ "print(f\"Filtered Data for {protein_id}:\")\n",
863
+ "filtered_data.head()"
864
+ ]
865
+ },
866
+ {
867
+ "cell_type": "code",
868
+ "execution_count": 69,
869
+ "metadata": {},
870
+ "outputs": [
871
+ {
872
+ "data": {
873
+ "text/html": [
874
+ "<div>\n",
875
+ "<style scoped>\n",
876
+ " .dataframe tbody tr th:only-of-type {\n",
877
+ " vertical-align: middle;\n",
878
+ " }\n",
879
+ "\n",
880
+ " .dataframe tbody tr th {\n",
881
+ " vertical-align: top;\n",
882
+ " }\n",
883
+ "\n",
884
+ " .dataframe thead th {\n",
885
+ " text-align: right;\n",
886
+ " }\n",
887
+ "</style>\n",
888
+ "<table border=\"1\" class=\"dataframe\">\n",
889
+ " <thead>\n",
890
+ " <tr style=\"text-align: right;\">\n",
891
+ " <th></th>\n",
892
+ " <th>ExtIdentifier</th>\n",
893
+ " <th>SubjectID</th>\n",
894
+ " <th>age</th>\n",
895
+ " <th>gender</th>\n",
896
+ " <th>combined</th>\n",
897
+ " <th>ANA</th>\n",
898
+ " <th>Centromere</th>\n",
899
+ " <th>SCL_70</th>\n",
900
+ " <th>RNA_Polymerase_3</th>\n",
901
+ " <th>Lung_Fibrosis_binary</th>\n",
902
+ " <th>Lung_Fibrosis</th>\n",
903
+ " <th>Total_mRss</th>\n",
904
+ " <th>Immunosupression_bin</th>\n",
905
+ " <th>Immunosupression</th>\n",
906
+ " <th>overall</th>\n",
907
+ " <th>category</th>\n",
908
+ " <th>condition</th>\n",
909
+ " <th>low_ssc</th>\n",
910
+ " <th>Disease_duration</th>\n",
911
+ " <th>Local_skin_score</th>\n",
912
+ " </tr>\n",
913
+ " </thead>\n",
914
+ " <tbody>\n",
915
+ " <tr>\n",
916
+ " <th>0</th>\n",
917
+ " <td>EXID40000009256847</td>\n",
918
+ " <td>COO-363</td>\n",
919
+ " <td>50</td>\n",
920
+ " <td>Female</td>\n",
921
+ " <td>50_F</td>\n",
922
+ " <td>1</td>\n",
923
+ " <td>0</td>\n",
924
+ " <td>1</td>\n",
925
+ " <td>0</td>\n",
926
+ " <td>0</td>\n",
927
+ " <td>No</td>\n",
928
+ " <td>0</td>\n",
929
+ " <td>No</td>\n",
930
+ " <td>0</td>\n",
931
+ " <td>Scleroderma</td>\n",
932
+ " <td>VEDOSS</td>\n",
933
+ " <td>VEDOSS</td>\n",
934
+ " <td>no</td>\n",
935
+ " <td>0</td>\n",
936
+ " <td>0</td>\n",
937
+ " </tr>\n",
938
+ " <tr>\n",
939
+ " <th>1</th>\n",
940
+ " <td>EXID40000009257105</td>\n",
941
+ " <td>PDAR-0335</td>\n",
942
+ " <td>42</td>\n",
943
+ " <td>Female</td>\n",
944
+ " <td>42_F</td>\n",
945
+ " <td>0</td>\n",
946
+ " <td>0</td>\n",
947
+ " <td>0</td>\n",
948
+ " <td>0</td>\n",
949
+ " <td>0</td>\n",
950
+ " <td>No</td>\n",
951
+ " <td>0</td>\n",
952
+ " <td>No</td>\n",
953
+ " <td>0</td>\n",
954
+ " <td>Healthy</td>\n",
955
+ " <td>Healthy</td>\n",
956
+ " <td>Healthy</td>\n",
957
+ " <td>no</td>\n",
958
+ " <td>0</td>\n",
959
+ " <td>0</td>\n",
960
+ " </tr>\n",
961
+ " <tr>\n",
962
+ " <th>2</th>\n",
963
+ " <td>EXID40000009257119</td>\n",
964
+ " <td>COO-005</td>\n",
965
+ " <td>51</td>\n",
966
+ " <td>Male</td>\n",
967
+ " <td>51_M</td>\n",
968
+ " <td>1</td>\n",
969
+ " <td>0</td>\n",
970
+ " <td>0</td>\n",
971
+ " <td>0</td>\n",
972
+ " <td>1</td>\n",
973
+ " <td>Yes</td>\n",
974
+ " <td>2</td>\n",
975
+ " <td>Yes</td>\n",
976
+ " <td>1</td>\n",
977
+ " <td>Scleroderma</td>\n",
978
+ " <td>Scleroderma</td>\n",
979
+ " <td>SSC_low</td>\n",
980
+ " <td>low</td>\n",
981
+ " <td>156</td>\n",
982
+ " <td>0</td>\n",
983
+ " </tr>\n",
984
+ " <tr>\n",
985
+ " <th>3</th>\n",
986
+ " <td>EXID40000009257121</td>\n",
987
+ " <td>COO-429</td>\n",
988
+ " <td>70</td>\n",
989
+ " <td>Female</td>\n",
990
+ " <td>70_F</td>\n",
991
+ " <td>1</td>\n",
992
+ " <td>0</td>\n",
993
+ " <td>0</td>\n",
994
+ " <td>1</td>\n",
995
+ " <td>1</td>\n",
996
+ " <td>Yes</td>\n",
997
+ " <td>33</td>\n",
998
+ " <td>No</td>\n",
999
+ " <td>0</td>\n",
1000
+ " <td>Scleroderma</td>\n",
1001
+ " <td>Scleroderma</td>\n",
1002
+ " <td>SSC_high</td>\n",
1003
+ " <td>no</td>\n",
1004
+ " <td>0</td>\n",
1005
+ " <td>2</td>\n",
1006
+ " </tr>\n",
1007
+ " <tr>\n",
1008
+ " <th>4</th>\n",
1009
+ " <td>EXID40000009257122</td>\n",
1010
+ " <td>COO-425</td>\n",
1011
+ " <td>78</td>\n",
1012
+ " <td>Female</td>\n",
1013
+ " <td>78_F</td>\n",
1014
+ " <td>1</td>\n",
1015
+ " <td>0</td>\n",
1016
+ " <td>1</td>\n",
1017
+ " <td>0</td>\n",
1018
+ " <td>1</td>\n",
1019
+ " <td>Yes</td>\n",
1020
+ " <td>18</td>\n",
1021
+ " <td>Yes</td>\n",
1022
+ " <td>1</td>\n",
1023
+ " <td>Scleroderma</td>\n",
1024
+ " <td>Scleroderma</td>\n",
1025
+ " <td>SSC_low</td>\n",
1026
+ " <td>low</td>\n",
1027
+ " <td>60</td>\n",
1028
+ " <td>1</td>\n",
1029
+ " </tr>\n",
1030
+ " </tbody>\n",
1031
+ "</table>\n",
1032
+ "</div>"
1033
+ ],
1034
+ "text/plain": [
1035
+ " ExtIdentifier SubjectID age gender combined ANA Centromere \\\n",
1036
+ "0 EXID40000009256847 COO-363 50 Female 50_F 1 0 \n",
1037
+ "1 EXID40000009257105 PDAR-0335 42 Female 42_F 0 0 \n",
1038
+ "2 EXID40000009257119 COO-005 51 Male 51_M 1 0 \n",
1039
+ "3 EXID40000009257121 COO-429 70 Female 70_F 1 0 \n",
1040
+ "4 EXID40000009257122 COO-425 78 Female 78_F 1 0 \n",
1041
+ "\n",
1042
+ " SCL_70 RNA_Polymerase_3 Lung_Fibrosis_binary Lung_Fibrosis Total_mRss \\\n",
1043
+ "0 1 0 0 No 0 \n",
1044
+ "1 0 0 0 No 0 \n",
1045
+ "2 0 0 1 Yes 2 \n",
1046
+ "3 0 1 1 Yes 33 \n",
1047
+ "4 1 0 1 Yes 18 \n",
1048
+ "\n",
1049
+ " Immunosupression_bin Immunosupression overall category condition \\\n",
1050
+ "0 No 0 Scleroderma VEDOSS VEDOSS \n",
1051
+ "1 No 0 Healthy Healthy Healthy \n",
1052
+ "2 Yes 1 Scleroderma Scleroderma SSC_low \n",
1053
+ "3 No 0 Scleroderma Scleroderma SSC_high \n",
1054
+ "4 Yes 1 Scleroderma Scleroderma SSC_low \n",
1055
+ "\n",
1056
+ " low_ssc Disease_duration Local_skin_score \n",
1057
+ "0 no 0 0 \n",
1058
+ "1 no 0 0 \n",
1059
+ "2 low 156 0 \n",
1060
+ "3 no 0 2 \n",
1061
+ "4 low 60 1 "
1062
+ ]
1063
+ },
1064
+ "execution_count": 69,
1065
+ "metadata": {},
1066
+ "output_type": "execute_result"
1067
+ }
1068
+ ],
1069
+ "source": [
1070
+ "sample_ids = filtered_data[\"SampleId\"].unique()\n",
1071
+ "metadata_info = metadata[metadata[\"SubjectID\"].isin(sample_ids)]\n",
1072
+ "metadata_info.head()"
1073
+ ]
1074
+ },
1075
+ {
1076
+ "cell_type": "code",
1077
+ "execution_count": 70,
1078
+ "metadata": {},
1079
+ "outputs": [
1080
+ {
1081
+ "data": {
1082
+ "text/html": [
1083
+ "<div>\n",
1084
+ "<style scoped>\n",
1085
+ " .dataframe tbody tr th:only-of-type {\n",
1086
+ " vertical-align: middle;\n",
1087
+ " }\n",
1088
+ "\n",
1089
+ " .dataframe tbody tr th {\n",
1090
+ " vertical-align: top;\n",
1091
+ " }\n",
1092
+ "\n",
1093
+ " .dataframe thead th {\n",
1094
+ " text-align: right;\n",
1095
+ " }\n",
1096
+ "</style>\n",
1097
+ "<table border=\"1\" class=\"dataframe\">\n",
1098
+ " <thead>\n",
1099
+ " <tr style=\"text-align: right;\">\n",
1100
+ " <th></th>\n",
1101
+ " <th>Unnamed: 0</th>\n",
1102
+ " <th>SeqId</th>\n",
1103
+ " <th>PlateId</th>\n",
1104
+ " <th>PlateRunDate</th>\n",
1105
+ " <th>ScannerID</th>\n",
1106
+ " <th>PlatePosition</th>\n",
1107
+ " <th>SlideId</th>\n",
1108
+ " <th>Subarray</th>\n",
1109
+ " <th>SampleId</th>\n",
1110
+ " <th>SampleType</th>\n",
1111
+ " <th>...</th>\n",
1112
+ " <th>Lung_Fibrosis_y</th>\n",
1113
+ " <th>Total_mRss</th>\n",
1114
+ " <th>Immunosupression_bin_y</th>\n",
1115
+ " <th>Immunosupression</th>\n",
1116
+ " <th>overall</th>\n",
1117
+ " <th>category</th>\n",
1118
+ " <th>condition</th>\n",
1119
+ " <th>low_ssc</th>\n",
1120
+ " <th>Disease_duration_y</th>\n",
1121
+ " <th>Local_skin_score_y</th>\n",
1122
+ " </tr>\n",
1123
+ " </thead>\n",
1124
+ " <tbody>\n",
1125
+ " <tr>\n",
1126
+ " <th>0</th>\n",
1127
+ " <td>94745</td>\n",
1128
+ " <td>9999-1</td>\n",
1129
+ " <td>PLT24684</td>\n",
1130
+ " <td>2023-08-13</td>\n",
1131
+ " <td>SG16064525, SG17164580</td>\n",
1132
+ " <td>C8</td>\n",
1133
+ " <td>258633888845</td>\n",
1134
+ " <td>3</td>\n",
1135
+ " <td>COO-363</td>\n",
1136
+ " <td>Sample</td>\n",
1137
+ " <td>...</td>\n",
1138
+ " <td>No</td>\n",
1139
+ " <td>0</td>\n",
1140
+ " <td>No</td>\n",
1141
+ " <td>0</td>\n",
1142
+ " <td>Scleroderma</td>\n",
1143
+ " <td>VEDOSS</td>\n",
1144
+ " <td>VEDOSS</td>\n",
1145
+ " <td>no</td>\n",
1146
+ " <td>0</td>\n",
1147
+ " <td>0</td>\n",
1148
+ " </tr>\n",
1149
+ " <tr>\n",
1150
+ " <th>1</th>\n",
1151
+ " <td>94746</td>\n",
1152
+ " <td>9999-1</td>\n",
1153
+ " <td>PLT24684</td>\n",
1154
+ " <td>2023-08-13</td>\n",
1155
+ " <td>SG16064525, SG17164580</td>\n",
1156
+ " <td>C9</td>\n",
1157
+ " <td>258633888846</td>\n",
1158
+ " <td>3</td>\n",
1159
+ " <td>PDAR-0335</td>\n",
1160
+ " <td>Sample</td>\n",
1161
+ " <td>...</td>\n",
1162
+ " <td>No</td>\n",
1163
+ " <td>0</td>\n",
1164
+ " <td>No</td>\n",
1165
+ " <td>0</td>\n",
1166
+ " <td>Healthy</td>\n",
1167
+ " <td>Healthy</td>\n",
1168
+ " <td>Healthy</td>\n",
1169
+ " <td>no</td>\n",
1170
+ " <td>0</td>\n",
1171
+ " <td>0</td>\n",
1172
+ " </tr>\n",
1173
+ " <tr>\n",
1174
+ " <th>2</th>\n",
1175
+ " <td>94747</td>\n",
1176
+ " <td>9999-1</td>\n",
1177
+ " <td>PLT24684</td>\n",
1178
+ " <td>2023-08-13</td>\n",
1179
+ " <td>SG16064525, SG17164580</td>\n",
1180
+ " <td>E8</td>\n",
1181
+ " <td>258633888845</td>\n",
1182
+ " <td>5</td>\n",
1183
+ " <td>COO-005</td>\n",
1184
+ " <td>Sample</td>\n",
1185
+ " <td>...</td>\n",
1186
+ " <td>Yes</td>\n",
1187
+ " <td>2</td>\n",
1188
+ " <td>Yes</td>\n",
1189
+ " <td>1</td>\n",
1190
+ " <td>Scleroderma</td>\n",
1191
+ " <td>Scleroderma</td>\n",
1192
+ " <td>SSC_low</td>\n",
1193
+ " <td>low</td>\n",
1194
+ " <td>156</td>\n",
1195
+ " <td>0</td>\n",
1196
+ " </tr>\n",
1197
+ " <tr>\n",
1198
+ " <th>3</th>\n",
1199
+ " <td>94748</td>\n",
1200
+ " <td>9999-1</td>\n",
1201
+ " <td>PLT24684</td>\n",
1202
+ " <td>2023-08-13</td>\n",
1203
+ " <td>SG16064525, SG17164580</td>\n",
1204
+ " <td>F8</td>\n",
1205
+ " <td>258633888845</td>\n",
1206
+ " <td>6</td>\n",
1207
+ " <td>COO-429</td>\n",
1208
+ " <td>Sample</td>\n",
1209
+ " <td>...</td>\n",
1210
+ " <td>Yes</td>\n",
1211
+ " <td>33</td>\n",
1212
+ " <td>No</td>\n",
1213
+ " <td>0</td>\n",
1214
+ " <td>Scleroderma</td>\n",
1215
+ " <td>Scleroderma</td>\n",
1216
+ " <td>SSC_high</td>\n",
1217
+ " <td>no</td>\n",
1218
+ " <td>0</td>\n",
1219
+ " <td>2</td>\n",
1220
+ " </tr>\n",
1221
+ " <tr>\n",
1222
+ " <th>4</th>\n",
1223
+ " <td>94749</td>\n",
1224
+ " <td>9999-1</td>\n",
1225
+ " <td>PLT24684</td>\n",
1226
+ " <td>2023-08-13</td>\n",
1227
+ " <td>SG16064525, SG17164580</td>\n",
1228
+ " <td>F7</td>\n",
1229
+ " <td>258633888844</td>\n",
1230
+ " <td>6</td>\n",
1231
+ " <td>COO-425</td>\n",
1232
+ " <td>Sample</td>\n",
1233
+ " <td>...</td>\n",
1234
+ " <td>Yes</td>\n",
1235
+ " <td>18</td>\n",
1236
+ " <td>Yes</td>\n",
1237
+ " <td>1</td>\n",
1238
+ " <td>Scleroderma</td>\n",
1239
+ " <td>Scleroderma</td>\n",
1240
+ " <td>SSC_low</td>\n",
1241
+ " <td>low</td>\n",
1242
+ " <td>60</td>\n",
1243
+ " <td>1</td>\n",
1244
+ " </tr>\n",
1245
+ " </tbody>\n",
1246
+ "</table>\n",
1247
+ "<p>5 rows × 63 columns</p>\n",
1248
+ "</div>"
1249
+ ],
1250
+ "text/plain": [
1251
+ " Unnamed: 0 SeqId PlateId PlateRunDate ScannerID \\\n",
1252
+ "0 94745 9999-1 PLT24684 2023-08-13 SG16064525, SG17164580 \n",
1253
+ "1 94746 9999-1 PLT24684 2023-08-13 SG16064525, SG17164580 \n",
1254
+ "2 94747 9999-1 PLT24684 2023-08-13 SG16064525, SG17164580 \n",
1255
+ "3 94748 9999-1 PLT24684 2023-08-13 SG16064525, SG17164580 \n",
1256
+ "4 94749 9999-1 PLT24684 2023-08-13 SG16064525, SG17164580 \n",
1257
+ "\n",
1258
+ " PlatePosition SlideId Subarray SampleId SampleType ... \\\n",
1259
+ "0 C8 258633888845 3 COO-363 Sample ... \n",
1260
+ "1 C9 258633888846 3 PDAR-0335 Sample ... \n",
1261
+ "2 E8 258633888845 5 COO-005 Sample ... \n",
1262
+ "3 F8 258633888845 6 COO-429 Sample ... \n",
1263
+ "4 F7 258633888844 6 COO-425 Sample ... \n",
1264
+ "\n",
1265
+ " Lung_Fibrosis_y Total_mRss Immunosupression_bin_y Immunosupression \\\n",
1266
+ "0 No 0 No 0 \n",
1267
+ "1 No 0 No 0 \n",
1268
+ "2 Yes 2 Yes 1 \n",
1269
+ "3 Yes 33 No 0 \n",
1270
+ "4 Yes 18 Yes 1 \n",
1271
+ "\n",
1272
+ " overall category condition low_ssc Disease_duration_y \\\n",
1273
+ "0 Scleroderma VEDOSS VEDOSS no 0 \n",
1274
+ "1 Healthy Healthy Healthy no 0 \n",
1275
+ "2 Scleroderma Scleroderma SSC_low low 156 \n",
1276
+ "3 Scleroderma Scleroderma SSC_high no 0 \n",
1277
+ "4 Scleroderma Scleroderma SSC_low low 60 \n",
1278
+ "\n",
1279
+ " Local_skin_score_y \n",
1280
+ "0 0 \n",
1281
+ "1 0 \n",
1282
+ "2 0 \n",
1283
+ "3 2 \n",
1284
+ "4 1 \n",
1285
+ "\n",
1286
+ "[5 rows x 63 columns]"
1287
+ ]
1288
+ },
1289
+ "execution_count": 70,
1290
+ "metadata": {},
1291
+ "output_type": "execute_result"
1292
+ }
1293
+ ],
1294
+ "source": [
1295
+ "merged_data = pd.merge(\n",
1296
+ " filtered_data,\n",
1297
+ " metadata_info,\n",
1298
+ " left_on=\"SampleId\",\n",
1299
+ " right_on=\"SubjectID\",\n",
1300
+ " how=\"inner\"\n",
1301
+ " )\n",
1302
+ "merged_data.head()"
1303
+ ]
1304
+ },
1305
+ {
1306
+ "cell_type": "code",
1307
+ "execution_count": 71,
1308
+ "metadata": {},
1309
+ "outputs": [
1310
+ {
1311
+ "data": {
1312
+ "text/plain": [
1313
+ "0 402.5\n",
1314
+ "1 276.0\n",
1315
+ "2 272.3\n",
1316
+ "3 317.7\n",
1317
+ "4 277.5\n",
1318
+ "Name: Intensity, dtype: float64"
1319
+ ]
1320
+ },
1321
+ "execution_count": 71,
1322
+ "metadata": {},
1323
+ "output_type": "execute_result"
1324
+ }
1325
+ ],
1326
+ "source": [
1327
+ "\n",
1328
+ "custom_palette = {\n",
1329
+ " \"Healthy\": \"green\",\n",
1330
+ " \"VEDOSS\": \"violet\",\n",
1331
+ " \"SSC_low\": \"cyan\",\n",
1332
+ " \"SSC_high\": \"red\"\n",
1333
+ " }\n",
1334
+ "intensity.head()"
1335
+ ]
1336
+ },
1337
+ {
1338
+ "cell_type": "code",
1339
+ "execution_count": 72,
1340
+ "metadata": {},
1341
+ "outputs": [
1342
+ {
1343
+ "data": {
1344
+ "text/html": [
1345
+ "<div>\n",
1346
+ "<style scoped>\n",
1347
+ " .dataframe tbody tr th:only-of-type {\n",
1348
+ " vertical-align: middle;\n",
1349
+ " }\n",
1350
+ "\n",
1351
+ " .dataframe tbody tr th {\n",
1352
+ " vertical-align: top;\n",
1353
+ " }\n",
1354
+ "\n",
1355
+ " .dataframe thead th {\n",
1356
+ " text-align: right;\n",
1357
+ " }\n",
1358
+ "</style>\n",
1359
+ "<table border=\"1\" class=\"dataframe\">\n",
1360
+ " <thead>\n",
1361
+ " <tr style=\"text-align: right;\">\n",
1362
+ " <th></th>\n",
1363
+ " <th>Unnamed: 0</th>\n",
1364
+ " <th>SeqId</th>\n",
1365
+ " <th>PlateId</th>\n",
1366
+ " <th>PlateRunDate</th>\n",
1367
+ " <th>ScannerID</th>\n",
1368
+ " <th>PlatePosition</th>\n",
1369
+ " <th>SlideId</th>\n",
1370
+ " <th>Subarray</th>\n",
1371
+ " <th>SampleId</th>\n",
1372
+ " <th>SampleType</th>\n",
1373
+ " <th>...</th>\n",
1374
+ " <th>Lung_Fibrosis_y</th>\n",
1375
+ " <th>Total_mRss</th>\n",
1376
+ " <th>Immunosupression_bin_y</th>\n",
1377
+ " <th>Immunosupression</th>\n",
1378
+ " <th>overall</th>\n",
1379
+ " <th>category</th>\n",
1380
+ " <th>condition</th>\n",
1381
+ " <th>low_ssc</th>\n",
1382
+ " <th>Disease_duration_y</th>\n",
1383
+ " <th>Local_skin_score_y</th>\n",
1384
+ " </tr>\n",
1385
+ " </thead>\n",
1386
+ " <tbody>\n",
1387
+ " <tr>\n",
1388
+ " <th>1</th>\n",
1389
+ " <td>94746</td>\n",
1390
+ " <td>9999-1</td>\n",
1391
+ " <td>PLT24684</td>\n",
1392
+ " <td>2023-08-13</td>\n",
1393
+ " <td>SG16064525, SG17164580</td>\n",
1394
+ " <td>C9</td>\n",
1395
+ " <td>258633888846</td>\n",
1396
+ " <td>3</td>\n",
1397
+ " <td>PDAR-0335</td>\n",
1398
+ " <td>Sample</td>\n",
1399
+ " <td>...</td>\n",
1400
+ " <td>No</td>\n",
1401
+ " <td>0</td>\n",
1402
+ " <td>No</td>\n",
1403
+ " <td>0</td>\n",
1404
+ " <td>Healthy</td>\n",
1405
+ " <td>Healthy</td>\n",
1406
+ " <td>Healthy</td>\n",
1407
+ " <td>no</td>\n",
1408
+ " <td>0</td>\n",
1409
+ " <td>0</td>\n",
1410
+ " </tr>\n",
1411
+ " <tr>\n",
1412
+ " <th>10</th>\n",
1413
+ " <td>94755</td>\n",
1414
+ " <td>9999-1</td>\n",
1415
+ " <td>PLT24684</td>\n",
1416
+ " <td>2023-08-13</td>\n",
1417
+ " <td>SG16064525, SG17164580</td>\n",
1418
+ " <td>D9</td>\n",
1419
+ " <td>258633888846</td>\n",
1420
+ " <td>4</td>\n",
1421
+ " <td>PDAR-0343</td>\n",
1422
+ " <td>Sample</td>\n",
1423
+ " <td>...</td>\n",
1424
+ " <td>No</td>\n",
1425
+ " <td>0</td>\n",
1426
+ " <td>No</td>\n",
1427
+ " <td>0</td>\n",
1428
+ " <td>Healthy</td>\n",
1429
+ " <td>Healthy</td>\n",
1430
+ " <td>Healthy</td>\n",
1431
+ " <td>no</td>\n",
1432
+ " <td>0</td>\n",
1433
+ " <td>0</td>\n",
1434
+ " </tr>\n",
1435
+ " <tr>\n",
1436
+ " <th>12</th>\n",
1437
+ " <td>94757</td>\n",
1438
+ " <td>9999-1</td>\n",
1439
+ " <td>PLT24684</td>\n",
1440
+ " <td>2023-08-13</td>\n",
1441
+ " <td>SG16064525, SG17164580</td>\n",
1442
+ " <td>E7</td>\n",
1443
+ " <td>258633888844</td>\n",
1444
+ " <td>5</td>\n",
1445
+ " <td>PDAR-0344</td>\n",
1446
+ " <td>Sample</td>\n",
1447
+ " <td>...</td>\n",
1448
+ " <td>No</td>\n",
1449
+ " <td>0</td>\n",
1450
+ " <td>No</td>\n",
1451
+ " <td>0</td>\n",
1452
+ " <td>Healthy</td>\n",
1453
+ " <td>Healthy</td>\n",
1454
+ " <td>Healthy</td>\n",
1455
+ " <td>no</td>\n",
1456
+ " <td>0</td>\n",
1457
+ " <td>0</td>\n",
1458
+ " </tr>\n",
1459
+ " </tbody>\n",
1460
+ "</table>\n",
1461
+ "<p>3 rows × 63 columns</p>\n",
1462
+ "</div>"
1463
+ ],
1464
+ "text/plain": [
1465
+ " Unnamed: 0 SeqId PlateId PlateRunDate ScannerID \\\n",
1466
+ "1 94746 9999-1 PLT24684 2023-08-13 SG16064525, SG17164580 \n",
1467
+ "10 94755 9999-1 PLT24684 2023-08-13 SG16064525, SG17164580 \n",
1468
+ "12 94757 9999-1 PLT24684 2023-08-13 SG16064525, SG17164580 \n",
1469
+ "\n",
1470
+ " PlatePosition SlideId Subarray SampleId SampleType ... \\\n",
1471
+ "1 C9 258633888846 3 PDAR-0335 Sample ... \n",
1472
+ "10 D9 258633888846 4 PDAR-0343 Sample ... \n",
1473
+ "12 E7 258633888844 5 PDAR-0344 Sample ... \n",
1474
+ "\n",
1475
+ " Lung_Fibrosis_y Total_mRss Immunosupression_bin_y Immunosupression \\\n",
1476
+ "1 No 0 No 0 \n",
1477
+ "10 No 0 No 0 \n",
1478
+ "12 No 0 No 0 \n",
1479
+ "\n",
1480
+ " overall category condition low_ssc Disease_duration_y \\\n",
1481
+ "1 Healthy Healthy Healthy no 0 \n",
1482
+ "10 Healthy Healthy Healthy no 0 \n",
1483
+ "12 Healthy Healthy Healthy no 0 \n",
1484
+ "\n",
1485
+ " Local_skin_score_y \n",
1486
+ "1 0 \n",
1487
+ "10 0 \n",
1488
+ "12 0 \n",
1489
+ "\n",
1490
+ "[3 rows x 63 columns]"
1491
+ ]
1492
+ },
1493
+ "execution_count": 72,
1494
+ "metadata": {},
1495
+ "output_type": "execute_result"
1496
+ }
1497
+ ],
1498
+ "source": [
1499
+ "data_healthy = merged_data[merged_data['condition']== \"Healthy\"]\n",
1500
+ "data_VEDOSS =merged_data[merged_data['condition']== \"VEDOSS\"]\n",
1501
+ "data_SSClow = merged_data[merged_data['condition']== \"SSC_low\"]\n",
1502
+ "data_SSChigh = merged_data[merged_data['condition']== \"SSC_high\"]\n",
1503
+ "data_healthy.head()"
1504
+ ]
1505
+ },
1506
+ {
1507
+ "cell_type": "code",
1508
+ "execution_count": 73,
1509
+ "metadata": {},
1510
+ "outputs": [
1511
+ {
1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AAKA4AQIAAAAoToAAAAAAihMgAAAAgOIECAAAAKA4AQIAAAAoToAAAAAAihMgAAAAgOLGHCB27NiRCy64IEcffXQaGxvzxje+MQ8//PDI9uHh4Vx66aU58sgj09jYmMWLF2fTpk2j3uPpp5/O8uXL09LSkpkzZ+bss8/Ozp07X/7RAAAAAJPSmAPEOeeckzVr1uTLX/5yHnnkkZx66qlZvHhxfvKTnyRJrr766lx77bW58cYbs379+hx22GE57bTT8uyzz468x/Lly/Poo49mzZo1ueuuu7J27dqcd95543dUAAAAwKTSMDw8PPzr7jw0NJTm5uZ8/etfz5IlS0ae7+zszOmnn57LL788c+fOzV/91V/lQx/6UJJk+/btmTNnTm655ZaceeaZ6e3tzXHHHZeHH344J510UpLk7rvvzlve8pb8+Mc/zty5c//POQYHB9Pa2prt27enpaVlrMfMfmjDhg3p7OxMT09POjo6qh4HAACAjO338zGdAfHCCy9kz549OfTQQ0c939jYmO9+97t5/PHHMzAwkMWLF49sa21tzcKFC7Nu3bokybp16zJz5syR+JAkixcvzrRp07J+/fqXXHf37t0ZHBwc9QAAAAD2H2MKEM3Nzenq6srll1+eLVu2ZM+ePVm9enXWrVuXJ598MgMDA0mSOXPmjHrdnDlzRrYNDAxk9uzZo7ZPnz49s2bNGtnn51111VVpbW0decybN28sYwMAAAAVG/M1IL785S9neHg4v/mbv5kZM2bk2muvzTvf+c5Mm1buhhqrVq3K9u3bRx6bN28uthYAAAAw/sZcDY455pjcf//92blzZzZv3pyHHnoozz//fF796lenra0tSbJ169ZRr9m6devItra2tjz11FOjtr/wwgt5+umnR/b5eTNmzEhLS8uoBwAAALD/2OfTFg477LAceeSR+elPf5p77rknZ5xxRubPn5+2trbcd999I/sNDg5m/fr16erqSpJ0dXVl27Zt6enpGdnn29/+dvbu3ZuFCxe+jEMBAAAAJqvpY33BPffck+Hh4bzmNa/JD3/4w1x00UWp1Wp573vfm4aGhlxwwQW54oorsmDBgsyfPz+XXHJJ5s6dm6VLlyZJ6vV63vzmN+fcc8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AAABQnQAAAAADFCRAAAABAcQIEAAAAUJwAAQAAABQnQAAAAADFCRAAAABAcQIEAAAAUJwAAQAAABQnQAAAAADFCRAAAABAcQIEAAAAUJwAAQAAABQnQAAAAADFTa96AMbPpk2bsmPHjqrHKKK3t3fU16moubk5CxYsqHoMAACAIgSIKWLTpk059thjqx6juO7u7qpHKGrjxo0iBAAAMCUJEFPEi2c+rF69OvV6veJpxt/Q0FD6+/vT3t6exsbGqscZd729venu7p6yZ7AAAAAIEFNMvV5PR0dH1WMUsWjRoqpHAAAAYB+5CCUAAABQ3JgCxJ49e3LJJZdk/vz5aWxszDHHHJPLL788w8PDI/sMDw/n0ksvzZFHHpnGxsYsXrw4mzZtGvU+Tz/9dJYvX56WlpbMnDkzZ599dnbu3Dk+RwQAAABMOmMKEJ/61Kdyww035G//9m/T29ubT33qU7n66qtz3XXXjexz9dVX59prr82NN96Y9evX57DDDstpp52WZ599dmSf5cuX59FHH82aNWty1113Ze3atTnvvPPG76gAAACASWVM14B44IEHcsYZZ2TJkiVJkvb29vz93/99HnrooSQ/O/vhmmuuycUXX5wzzjgjSfKlL30pc+bMyZ133pkzzzwzvb29ufvuu/Pwww/npJNOSpJcd911ectb3pJPf/rTmTt37ngeHwAAADAJjOkMiDe+8Y257777snHjxiTJv//7v+e73/1uTj/99CTJ448/noGBgSxevHjkNa2trVm4cGHWrVuXJFm3bl1mzpw5Eh+SZPHixZk2bVrWr1//kuvu3r07g4ODox4AAADA/mNMZ0B89KMfzeDgYGq1Wg466KDs2bMnV155ZZYvX54kGRgYSJLMmTNn1OvmzJkzsm1gYCCzZ88ePcT06Zk1a9bIPj/vqquuyl//9V+PZVQAAABgEhnTGRBf/epXc9ttt+X222/Phg0bcuutt+bTn/50br311lLzJUlWrVqV7du3jzw2b95cdD0AAABgfI3pDIiLLrooH/3oR3PmmWcmSY4//vj86Ec/ylVXXZWzzjorbW1tSZKtW7fmyCOPHHnd1q1bc+KJJyZJ2tra8tRTT4163xdeeCFPP/30yOt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PvhgkuRb3/pWfvCDH2T16tU58cQTc/rpp+fyyy/P9ddfn+eee67IAQIAAADV2+drQDz33HNZvXp13ve+96WhoSE9PT15/vnns3jx4pF9arVajjrqqKxbty5Jsm7duhx//PGZM2fOyD6nnXZaBgcH8+ijj/7StXbv3p3BwcFRDwAAAGD/sc8B4s4778y2bdvynve8J0kyMDCQQw45JDNnzhy135w5czIwMDCyz/8/Pry4/cVtv8xVV12V1tbWkce8efP2dWwAAACgAtP39YVf/OIXc/rpp2fu3LnjOc9LWrVqVS688MKR7wcHB0UI4IC0adOm7Nixo+oxiujt7R31dSpqbm7OggULqh4DAKAS+xQgfvSjH+Xee+/NP/7jP44819bWlueeey7btm0bdRbE1q1b09bWNrLPQw89NOq9XrxLxov7vJQZM2ZkxowZ+zIqwJSxadOmHHvssVWPUVx3d3fVIxS1ceNGEQIAOCDtU4C4+eabM3v27CxZsmTkuc7Ozhx88MG57777smzZsiTJY489lieeeCJdXV1Jkq6urlx55ZV56qmnMnv27CTJmjVr0tLSkuOOO+7lHgvAlPbimQ+rV69OvV6veJrxNzQ0lP7+/rS3t6exsbHqccZdb29vuru7p+wZLAAA/5cxB4i9e/fm5ptvzllnnZXp0//35a2trTn77LNz4YUXZtasWWlpackHPvCBdHV15Q1veEOS5NRTT81xxx2Xd73rXbn66qszMDCQiy++OCtWrHCGwzhoO7whjds2Jlv2+dIeVKRx28a0Hd5Q9RjsJ+r1ejo6Oqoeo4hFixZVPQIAAIWMOUDce++9eeKJJ/K+973vF7Z97nOfy7Rp07Js2bLs3r07p512Wj7/+c+PbD/ooINy11135f3vf3+6urpy2GGH5ayzzspll1328o6CJMn5nYekvvb8ZG3VkzBW9fzs5wcAADBVjTlAnHrqqRkeHn7JbYceemiuv/76XH/99b/09UcffXS+8Y1vjHVZfg039TyXP730ltRrtapHYYx6+/py02f+LH9U9SAAAACF7PNdMJh8BnYOZ2jmscncE6sehTEaGtibgZ0vHfYAAACmAhcLAAAAAIoTIAAAAIDiBAgAAACgOA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Rj7LX90BAAAABQnQAAAAADFCRAAAABAcQIEAAAAUJwAAQAAABQnQAAAAADFCRAAAABAcQIEAAAAUJwAAQAAABQ3veoBGB+7du1KkmzYsKHiScoYGhpKf39/2tvb09jYWPU44663t7fqEdhPtB3ekMZtG5Mt+vH+pnHbxrQd3lD1GAAAlREgpoi+vr4kybnnnlvxJLwczc3NVY/AJHd+5yGprz0/WVv1JIxVPT/7+QEAHKgEiCli6dKlSZJarZampqZqhymgt7c33d3dWb16der1etXjFNHc3JwFCxZUPQaT3E09z+VPL70l9Vqt6lEYo96+vtz0mT/LH1U9CABARQSIKeIVr3hFzjnnnKrHKK5er6ejo6PqMaAyAzuHMzTz2GTuiVWPwhgNDezNwM7hqscAAKiMPyIGAAAAihMgAAAAgOIECAAAAKA4AQIAAAAoToAAAAAAihMgAAAAgOIECAAAAKA4AQIAAAAoToAAAAAAihMgAAAAgOIECAAAAKA4AQIAAAAobswB4ic/+Um6u7tzxBFHpLGxMccff3y+973vjWwfHh7OpZdemiOPPDKNjY1ZvHhxNm3aNOo9nn766SxfvjwtLS2ZOXNmzj777OzcufPlHw0AAAAwKY0pQPz0pz/NokWLcvDBB+eb3/xmfvCDH+Qzn/lMfuM3fmNkn6uvvjrXXnttbrzxxqxfvz6HHXZYTjvttDz77LMj+yxfvjyPPvpo1qxZk7vuuitr167NeeedN35HBQAAAEwq08ey86c+9anMmzcvN99888hz8+fPH/n38PBwrrnmmlx88cU544wzkiRf+tKXMmfOnNx5550588wz09vbm7vvvjsPP/xwTjrppCTJddddl7e85S359Kc/nblz547HcQEAAACTyJjOgPinf/qnnHTSSXnHO96R2bNn53Wve13+7u/+bmT7448/noGBgSxevHjkudbW1ixcuDDr1q1Lkqxbty4zZ84ciQ9Jsnjx4kybNi3r169/yXV3796dwcHBUQ8AAABg/zGmAPFf//VfueGGG7JgwYLcc889ef/735+/+Iu/yK233pokGRgYSJLMmTNn1OvmzJkzsm1gYCCzZ88etX369OmZNWvWyD4/76qrrkpra+vIY968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IAAAAoLhpVQ8AAAAATH0CBAAAAFCcAAEAAAAUJ0AAAAAAxQkQAAAAQHECBAAAAFCcAAEAAAAUJ0AAAAAAxQkQAAAAQHECBAAAAFCcAAEAAAAU9/8AHMNdWVbYUL8AAAAASUVORK5CYII=",
1514
+ "text/plain": [
1515
+ "<Figure size 1000x700 with 1 Axes>"
1516
+ ]
1517
+ },
1518
+ "metadata": {},
1519
+ "output_type": "display_data"
1520
+ }
1521
+ ],
1522
+ "source": [
1523
+ "data_healthy = data_healthy[\"Intensity\"]\n",
1524
+ "data_VEDOSS =data_VEDOSS[\"Intensity\"]\n",
1525
+ "data_SSClow = data_SSClow[\"Intensity\"]\n",
1526
+ "data_SSChigh = data_SSChigh[\"Intensity\"]\n",
1527
+ "data = [data_healthy, data_VEDOSS, data_SSClow, data_SSChigh]\n",
1528
+ "fig = plt.figure(figsize =(10, 7))\n",
1529
+ "\n",
1530
+ "ax = fig.add_axes([0, 0, 1, 1])\n",
1531
+ "\n",
1532
+ "# Creating plot\n",
1533
+ "bp = ax.boxplot(data)\n",
1534
+ "\n",
1535
+ "# show plot\n",
1536
+ "plt.show()\n"
1537
+ ]
1538
+ },
1539
+ {
1540
+ "cell_type": "code",
1541
+ "execution_count": 75,
1542
+ "metadata": {},
1543
+ "outputs": [],
1544
+ "source": [
1545
+ "# # Create scatter plot\n",
1546
+ "# plt.figure(figsize=(10, 8))\n",
1547
+ "# sns.scatterplot(\n",
1548
+ "# x=mrss, y=intensity_log, hue=condition, s=100, palette=custom_palette, edgecolor=\"black\"\n",
1549
+ "# )\n",
1550
+ "\n",
1551
+ "# # Add color-coded annotations for each point\n",
1552
+ "# for i in range(len(merged_data)):\n",
1553
+ "# plt.text(\n",
1554
+ "# mrss.iloc[i],\n",
1555
+ "# intensity_log.iloc[i],\n",
1556
+ "# condition.iloc[i], # Text is the condition\n",
1557
+ "# fontsize=10,\n",
1558
+ "# ha=\"center\",\n",
1559
+ "# bbox=dict(\n",
1560
+ "# boxstyle=\"round,pad=0.3\",\n",
1561
+ "# edgecolor=\"black\",\n",
1562
+ "# facecolor=custom_palette[condition.iloc[i]], # Custom color for tag\n",
1563
+ "# alpha=0.7\n",
1564
+ "# ),\n",
1565
+ "# )\n",
1566
+ "\n",
1567
+ "# # Set title and labels\n",
1568
+ "# plt.title(f\"Correlation Plot for {protein_name}\", fontsize=16)\n",
1569
+ "# plt.xlabel(\"MRSS (Linear Scale)\", fontsize=12)\n",
1570
+ "# plt.ylabel(\"Intensity (Logarithmic Scale)\", fontsize=12)\n",
1571
+ "# plt.grid(visible=True, linestyle=\"--\", alpha=0.6)\n",
1572
+ "# plt.legend(title=\"Condition\", loc=\"best\")\n",
1573
+ "# plt.tight_layout()\n",
1574
+ "\n",
1575
+ "# return plt\n",
1576
+ "\n",
1577
+ "\n",
1578
+ "\n",
1579
+ "# Creating dataset"
1580
+ ]
1581
+ },
1582
+ {
1583
+ "cell_type": "code",
1584
+ "execution_count": 76,
1585
+ "metadata": {},
1586
+ "outputs": [],
1587
+ "source": [
1588
+ "# # Load necessary libraries\n",
1589
+ "# library(ggplot2)\n",
1590
+ "\n",
1591
+ "# # Define the colors for the boxplot\n",
1592
+ "# mat_colors <- c('turquoise2', 'red')\n",
1593
+ "\n",
1594
+ "# # Filter data for the specific protein of interest\n",
1595
+ "# SCUBE3 <- subset_proteins_plot %>%\n",
1596
+ "# subset(SeqId == \"16773-29\") %>% # Select the specific protein\n",
1597
+ "# ggplot(aes(Lung_Fibrosis, Intensity, label = SampleId)) + # Map variables to axes\n",
1598
+ "# facet_wrap(~ EntrezGeneSymbol) + # Facet by protein name (optional)\n",
1599
+ "# scale_y_log10() + # Apply log10 scale to y-axis\n",
1600
+ "# geom_boxplot(fill = mat_colors) + # Create boxplot with specified colors\n",
1601
+ "# theme_bw() + # Apply a clean theme\n",
1602
+ "# theme(legend.position = \"top\") + # Adjust legend position\n",
1603
+ "# labs(color = \"Sample\", x = \"Lung Fibrosis\") # Add axis labels\n",
1604
+ "# SCUBE3\n"
1605
+ ]
1606
+ }
1607
+ ],
1608
+ "metadata": {
1609
+ "kernelspec": {
1610
+ "display_name": ".venv",
1611
+ "language": "python",
1612
+ "name": "python3"
1613
+ },
1614
+ "language_info": {
1615
+ "codemirror_mode": {
1616
+ "name": "ipython",
1617
+ "version": 3
1618
+ },
1619
+ "file_extension": ".py",
1620
+ "mimetype": "text/x-python",
1621
+ "name": "python",
1622
+ "nbconvert_exporter": "python",
1623
+ "pygments_lexer": "ipython3",
1624
+ "version": "3.11.4"
1625
+ }
1626
+ },
1627
+ "nbformat": 4,
1628
+ "nbformat_minor": 2
1629
+ }
app/boxplot.py ADDED
@@ -0,0 +1,62 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import pandas as pd
2
+ import numpy as np
3
+ import matplotlib.pyplot as plt
4
+ from matplotlib.ticker import LogLocator, NullFormatter
5
+
6
+ def plot_boxplot(merged_data, protein_name):
7
+ """
8
+ Create a boxplot of the intensity of 4 Scleroderma categories with a logarithmic scale.
9
+ """
10
+ # Filter data by conditions
11
+ conditions = ["Healthy", "VEDOSS", "SSC_low", "SSC_high"]
12
+ custom_palette = {
13
+ "Healthy": "green",
14
+ "VEDOSS": "violet",
15
+ "SSC_low": "cyan",
16
+ "SSC_high": "red"
17
+ }
18
+
19
+ # Extract intensity values for each condition
20
+ data = [merged_data[merged_data['condition'] == condition]["Intensity"] for condition in conditions]
21
+
22
+ # Ensure no zeros or negatives for logarithmic scale
23
+ for i, condition_data in enumerate(data):
24
+ if (condition_data <= 0).any():
25
+ raise ValueError(f"Condition '{conditions[i]}' contains zero or negative values, which are invalid for a logarithmic scale.")
26
+
27
+ # Create the boxplot
28
+ fig, ax = plt.subplots(figsize=(12, 8))
29
+ bp = ax.boxplot(data, patch_artist=True)
30
+
31
+ # Set colors for the boxes
32
+ for patch, condition in zip(bp['boxes'], conditions):
33
+ patch.set_facecolor(custom_palette[condition])
34
+
35
+ # Set median line colors
36
+ for median in bp['medians']:
37
+ median.set_color('black')
38
+
39
+ # Set logarithmic y-axis
40
+ ax.set_yscale("log")
41
+ y_min = min([d.min() for d in data]) * 0.8
42
+ y_max = max([d.max() for d in data]) * 1.2
43
+ ax.set_ylim(bottom=y_min, top=y_max)
44
+
45
+ # Configure ticks and formatters
46
+ ax.yaxis.set_major_locator(LogLocator(base=10.0, subs=None, numticks=10))
47
+ ax.yaxis.set_minor_locator(LogLocator(base=10.0, subs=np.arange(2, 10) * 0.1, numticks=10))
48
+ ax.yaxis.set_major_formatter(plt.FuncFormatter(lambda x, _: f"{int(x):g}" if x >= 1 else f"{x:.1g}"))
49
+ ax.yaxis.set_minor_formatter(NullFormatter())
50
+
51
+
52
+ ax.set_title(f"Box Plot for {protein_name}", fontsize=16)
53
+ ax.set_xticks(range(1, 5))
54
+ ax.set_xticklabels(conditions)
55
+ ax.set_ylabel("Intensity (Logarithmic Scale)", fontsize=12)
56
+ ax.grid(visible=True, linestyle="--", alpha=0.6)
57
+ plt.tight_layout()
58
+
59
+ # Plot graph
60
+ plt.show()
61
+
62
+ return plt
app/volcano.py ADDED
@@ -0,0 +1,48 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import seaborn as sns
2
+ import matplotlib.pyplot as plt
3
+ import numpy as np
4
+ import pandas as pd
5
+
6
+ # Updated Volcano Plot Function
7
+ def plot_volcano(data):
8
+ # Ensure required columns exist
9
+ required_columns = ["logFC", "P.Value", "Target"]
10
+ if not all(col in data.columns for col in required_columns):
11
+ raise ValueError(f"Data is missing required columns: {required_columns}")
12
+
13
+ # Calculate -log10(p-value)
14
+ data['-log10_pvalue'] = -np.log10(data['P.Value'])
15
+
16
+ # Define thresholds
17
+ fold_change_threshold = 0.6 # Adjust as needed
18
+ pvalue_threshold = 0.05 # Adjust as needed
19
+ data['Significant'] = (np.abs(data['logFC']) > fold_change_threshold) & (data['P.Value'] < pvalue_threshold)
20
+
21
+ # Create the volcano plot
22
+ plt.figure(figsize=(10, 8))
23
+ sns.scatterplot(
24
+ data=data,
25
+ x='logFC',
26
+ y='-log10_pvalue',
27
+ # hue='Significant',
28
+ palette={True: 'red', False: 'grey'},
29
+ legend=False
30
+ )
31
+
32
+ # Add vertical and horizontal threshold lines
33
+ plt.axvline(x=-fold_change_threshold, linestyle='--', color='blue', linewidth=1)
34
+ plt.axvline(x=fold_change_threshold, linestyle='--', color='blue', linewidth=1)
35
+ plt.axhline(y=-np.log10(pvalue_threshold), linestyle='--', color='green', linewidth=1)
36
+
37
+ # Label the plot
38
+ plt.title("Volcano Plot", fontsize=16)
39
+ plt.xlabel("Log2 Fold Change", fontsize=14)
40
+ plt.ylabel("-Log10 P-value", fontsize=14)
41
+
42
+ # Annotate significant points with protein names
43
+ significant_points = data[data['Significant']]
44
+ for _, row in significant_points.iterrows():
45
+ plt.text(row['logFC'], row['-log10_pvalue'], row['Target'], fontsize=9)
46
+
47
+ plt.tight_layout()
48
+ return plt
requirements.txt ADDED
@@ -0,0 +1,6 @@
 
 
 
 
 
 
 
1
+ streamlit
2
+ pandas
3
+ numpy
4
+ seaborn
5
+ pathlib
6
+ scanpy
runtime.txt ADDED
@@ -0,0 +1 @@
 
 
1
+ python-3.9.21
tests/__init__.py ADDED
File without changes
tests/test_analysis.py ADDED
@@ -0,0 +1,30 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import pandas as pd
2
+ import pytest
3
+ from analysis import compute_correlation, differential_expression
4
+
5
+ def test_compute_correlation():
6
+ """Test correlation computation."""
7
+ data = pd.DataFrame({
8
+ "clinical_score": [1, 2, 3, 4, 5],
9
+ "protein_expression": [2, 4, 6, 8, 10]
10
+ })
11
+ corr = compute_correlation(data, "clinical_score", "protein_expression")
12
+ assert corr > 0.99, "Correlation should be close to 1 for linear data"
13
+
14
+ def test_differential_expression():
15
+ """Test differential expression analysis."""
16
+ group1 = pd.DataFrame({
17
+ "Protein1": [10, 15, 12],
18
+ "Protein2": [5, 7, 6]
19
+ })
20
+ group2 = pd.DataFrame({
21
+ "Protein1": [20, 25, 22],
22
+ "Protein2": [10, 12, 11]
23
+ })
24
+ proteins = pd.concat([group1, group2], axis=1)
25
+ results = differential_expression(group1, group2, proteins)
26
+
27
+ assert isinstance(results, pd.DataFrame), "Results should be a DataFrame"
28
+ assert "logFC" in results.columns, "Results should include logFC column"
29
+ assert "p-value" in results.columns, "Results should include p-value column"
30
+ assert results["logFC"].iloc[0] > 0, "logFC should reflect upregulation"
tests/test_boxplot.py ADDED
@@ -0,0 +1,55 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import pytest
2
+ import pandas as pd
3
+ from unittest.mock import patch, MagicMock
4
+ from app.boxplot import plot_boxplot
5
+
6
+ # Fixture for valid test data
7
+ @pytest.fixture
8
+ def valid_data():
9
+ """Fixture to provide valid intensity values for all conditions."""
10
+ return pd.DataFrame({
11
+ "SampleId": [1, 2, 3, 4],
12
+ "condition": ["Healthy", "VEDOSS", "SSC_low", "SSC_high"],
13
+ "Intensity": [10, 20, 15, 25]
14
+ })
15
+
16
+ # Fixture for invalid test data
17
+ @pytest.fixture
18
+ def invalid_data():
19
+ """Fixture to provide invalid intensity values (zero or negative)."""
20
+ return pd.DataFrame({
21
+ "SampleId": [1, 2, 3, 4],
22
+ "condition": ["Healthy", "VEDOSS", "SSC_low", "SSC_high"],
23
+ "Intensity": [-10, 0, 15, 25]
24
+ })
25
+
26
+ @pytest.fixture
27
+ def protein_name():
28
+ """Fixture for test protein name."""
29
+ return "Test Protein"
30
+
31
+ @patch("matplotlib.pyplot.show")
32
+ @patch("matplotlib.pyplot.subplots")
33
+ def test_plot_boxplot(mock_subplots, mock_show, valid_data, protein_name):
34
+ """Test that the plot_boxplot function initializes the plot and creates a boxplot."""
35
+ # Mock figure and axes
36
+ mock_fig = MagicMock()
37
+ mock_ax = MagicMock()
38
+ mock_subplots.return_value = (mock_fig, mock_ax)
39
+
40
+ # Call the function
41
+ plot_boxplot(valid_data, protein_name)
42
+
43
+ # Verify that plt.subplots is called with correct parameters
44
+ mock_subplots.assert_called_once_with(figsize=(12, 8))
45
+
46
+ # Verify that the boxplot method is called on the axes
47
+ mock_ax.boxplot.assert_called_once()
48
+
49
+ # Verify that plt.show() is called to display the plot
50
+ mock_show.assert_called_once()
51
+
52
+ def test_invalid_data_raises_error(invalid_data, protein_name):
53
+ """Test that plot_boxplot raises a ValueError for zero or negative intensity values."""
54
+ with pytest.raises(ValueError, match="contains zero or negative values"):
55
+ plot_boxplot(invalid_data, protein_name)
tests/test_data_loader.py ADDED
@@ -0,0 +1,72 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import pytest
2
+ import pandas as pd
3
+ from pandas.errors import ParserError
4
+ from unittest.mock import patch, mock_open
5
+ from app.dataloader import load_data
6
+
7
+ # Fixture for valid test data
8
+ @pytest.fixture
9
+ def valid_metadata_file():
10
+ """Fixture to provide valid metadata CSV content."""
11
+ return """SubjectID,OtherInfo
12
+ 1,Info1
13
+ 2,Info2
14
+ 3,Info3
15
+ """
16
+
17
+ @pytest.fixture
18
+ def valid_proteins_file():
19
+ """Fixture to provide valid proteins CSV content."""
20
+ return (
21
+ "SampleId,TargetFullName,Target,EntrezGeneID,EntrezGeneSymbol"
22
+ "1,Protein A,A,101,GA"
23
+ "2,Protein B,B,102,GB"
24
+ "3,Protein C,C,103,GC"
25
+ )
26
+
27
+ @pytest.fixture
28
+ def invalid_file_content():
29
+ """Fixture for invalid file content (non-CSV)."""
30
+ return "Invalid Content"
31
+
32
+ def test_load_data_valid_files(valid_metadata_file, valid_proteins_file):
33
+ """Test that load_data loads valid CSV files correctly."""
34
+ with patch("pandas.read_csv") as mock_read_csv:
35
+ mock_read_csv.side_effect = [
36
+ pd.DataFrame({"SubjectID": [1, 2, 3], "OtherInfo": ["Info1", "Info2", "Info3"]}),
37
+ pd.DataFrame({
38
+ "SampleId": [1, 2, 3],
39
+ "TargetFullName": ["Protein A", "Protein B", "Protein C"],
40
+ "Target": ["A", "B", "C"],
41
+ "EntrezGeneID": [101, 102, 103],
42
+ "EntrezGeneSymbol": ["GA", "GB", "GC"]
43
+ }),
44
+ ]
45
+
46
+ metadata, proteins = load_data("metadata.csv", "proteins.csv")
47
+
48
+ assert not metadata.empty
49
+ assert not proteins.empty
50
+ assert list(metadata.columns) == ["SubjectID", "OtherInfo"]
51
+ assert list(proteins.columns) == ["SampleId", "TargetFullName", "Target", "EntrezGeneID", "EntrezGeneSymbol"]
52
+
53
+ def test_load_data_invalid_file_path():
54
+ """Test that load_data raises ValueError for invalid file paths."""
55
+ with pytest.raises(ValueError, match="Error loading files"):
56
+ load_data("invalid_metadata.csv", "invalid_proteins.csv")
57
+
58
+ def test_load_data_invalid_file_content():
59
+ """Test that load_data raises ValueError for invalid file content."""
60
+ with patch("pandas.read_csv", side_effect=ParserError("Error parsing file")):
61
+ with pytest.raises(ValueError, match="Error loading files"):
62
+ load_data("metadata.csv", "proteins.csv")
63
+
64
+ def test_load_data_empty_files():
65
+ """Test that load_data handles empty files correctly."""
66
+ with patch("pandas.read_csv") as mock_read_csv:
67
+ mock_read_csv.side_effect = [pd.DataFrame(), pd.DataFrame()]
68
+
69
+ metadata, proteins = load_data("metadata.csv", "proteins.csv")
70
+
71
+ assert metadata.empty
72
+ assert proteins.empty
tests/test_visualization.py ADDED
@@ -0,0 +1,14 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import pandas as pd
2
+ from app.visualization import volcano_plot
3
+
4
+ def test_volcano_plot():
5
+ """Test generating a volcano plot."""
6
+ results_df = pd.DataFrame({
7
+ "Protein": ["Protein1", "Protein2"],
8
+ "logFC": [2.5, -1.2],
9
+ "p-value": [0.001, 0.05]
10
+ })
11
+ fig = volcano_plot(results_df)
12
+ assert fig, "Volcano plot should return a Plotly figure object"
13
+ assert "Protein1" in fig.data[0].text, "Hover text should include Protein1"
14
+ assert "Protein2" in fig.data[0].text, "Hover text should include Protein2"