Skip to content

Commit a741028

Browse files
committed
update zstat metric
1 parent 97872be commit a741028

File tree

2 files changed

+201
-29
lines changed

2 files changed

+201
-29
lines changed

src/metrics/ks_statistic_gene_cell/config.vsh.yaml

Lines changed: 155 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ links:
88

99
info:
1010
metrics:
11-
- name: ks_statistic_frac_zero_genes
11+
- name: ks_statistic_frac_zero_genes_zstat
1212
label: Fraction of zeros per gene
1313
summary: KS statistic of the fraction of zeros per gene.
1414
description: |
@@ -18,7 +18,7 @@ info:
1818
maximize: false
1919
references:
2020
doi: 10.1201/9780429485572
21-
- name: ks_statistic_frac_zero_cells
21+
- name: ks_statistic_frac_zero_cells_zstat
2222
label: Fraction of zeros per cell
2323
summary: KS statistic of the fraction of zeros per spot (cell).
2424
description: |
@@ -28,7 +28,7 @@ info:
2828
maximize: false
2929
references:
3030
doi: 10.1201/9780429485572
31-
- name: ks_statistic_lib_size_cells
31+
- name: ks_statistic_lib_size_cells_zstat
3232
label: Library size
3333
summary: KS statistic of the library size.
3434
description: |
@@ -38,7 +38,7 @@ info:
3838
maximize: false
3939
references:
4040
doi: 10.1201/9780429485572
41-
- name: ks_statistic_efflib_size_cells
41+
- name: ks_statistic_efflib_size_cells_zstat
4242
label: Effective library size
4343
summary: KS statistic of the effective library size.
4444
description: |
@@ -48,7 +48,7 @@ info:
4848
maximize: false
4949
references:
5050
doi: 10.1201/9780429485572
51-
- name: ks_statistic_tmm_cells
51+
- name: ks_statistic_tmm_cells_zstat
5252
label: TMM
5353
summary: KS statistic of the weight trimmed mean of M-values normalization factor (TMM).
5454
description: |
@@ -58,7 +58,7 @@ info:
5858
maximize: false
5959
references:
6060
doi: 10.1201/9780429485572
61-
- name: ks_statistic_scaled_var_cells
61+
- name: ks_statistic_scaled_var_cells_zstat
6262
label: Scaled variance cell
6363
summary: KS statistic of the spot- (or cell-) level scaled variance of the expression matrix.
6464
description: |
@@ -68,7 +68,7 @@ info:
6868
maximize: false
6969
references:
7070
doi: 10.1201/9780429485572
71-
- name: ks_statistic_scaled_mean_cells
71+
- name: ks_statistic_scaled_mean_cells_zstat
7272
label: Scaled mean cells
7373
summary: KS statistic of the spot- (or cell-) level scaled mean of the expression matrix.
7474
description: |
@@ -78,7 +78,7 @@ info:
7878
maximize: false
7979
references:
8080
doi: 10.1201/9780429485572
81-
- name: ks_statistic_lib_fraczero_cells
81+
- name: ks_statistic_lib_fraczero_cells_zstat
8282
label: Library size vs fraction zero
8383
summary: KS statistic of the relationship between library size and the proportion of zeros per spot (cell).
8484
description: |
@@ -88,7 +88,7 @@ info:
8888
maximize: false
8989
references:
9090
doi: 10.1201/9780429485572
91-
- name: ks_statistic_pearson_cells
91+
- name: ks_statistic_pearson_cells_zstat
9292
label: Sample Pearson correlation
9393
summary: KS statistic of the sample Pearson correlation.
9494
description: |
@@ -98,7 +98,7 @@ info:
9898
maximize: false
9999
references:
100100
doi: 10.1201/9780429485572
101-
- name: ks_statistic_scaled_var_genes
101+
- name: ks_statistic_scaled_var_genes_zstat
102102
label: Scaled variance genes
103103
summary: KS statistic of the gene-level scaled variance of the expression matrix.
104104
description: |
@@ -108,7 +108,7 @@ info:
108108
maximize: false
109109
references:
110110
doi: 10.1201/9780429485572
111-
- name: ks_statistic_scaled_mean_genes
111+
- name: ks_statistic_scaled_mean_genes_zstat
112112
label: Scaled mean genes
113113
summary: KS statistic of the gene-level scaled mean of the expression matrix.
114114
description: |
@@ -118,7 +118,7 @@ info:
118118
maximize: false
119119
references:
120120
doi: 10.1201/9780429485572
121-
- name: ks_statistic_pearson_genes
121+
- name: ks_statistic_pearson_genes_zstat
122122
label: Gene Pearson correlation
123123
summary: KS statistic of the gene Pearson correlation.
124124
description: |
@@ -128,7 +128,7 @@ info:
128128
maximize: false
129129
references:
130130
doi: 10.1201/9780429485572
131-
- name: ks_statistic_mean_var_genes
131+
- name: ks_statistic_mean_var_genes_zstat
132132
label: Mean vs variance
133133
summary: KS statistic of the relationship between mean expression and variance expression.
134134
description: |
@@ -138,7 +138,7 @@ info:
138138
maximize: false
139139
references:
140140
doi: 10.1201/9780429485572
141-
- name: ks_statistic_mean_fraczero_genes
141+
- name: ks_statistic_mean_fraczero_genes_zstat
142142
label: Mean vs fraction zero
143143
summary: KS statistic of the relationship between mean expression and the proportion of zero per gene.
144144
description: |
@@ -148,6 +148,147 @@ info:
148148
maximize: false
149149
references:
150150
doi: 10.1201/9780429485572
151+
- name: ks_statistic_frac_zero_genes_tstat
152+
label: Fraction of zeros per gene
153+
summary: KS statistic of the fraction of zeros per gene.
154+
description: |
155+
The Kolmogorov-Smirnov statistic comparing the fraction of zeros per gene in the real datasets versus the fraction of zeros per gene in the simulated datasets.
156+
min: -Inf
157+
max: +Inf
158+
maximize: false
159+
references:
160+
doi: 10.1201/9780429485572
161+
- name: ks_statistic_frac_zero_cells_tstat
162+
label: Fraction of zeros per cell
163+
summary: KS statistic of the fraction of zeros per spot (cell).
164+
description: |
165+
The Kolmogorov-Smirnov statistic comparing the fraction of zeros per spot (cell) in the real datasets versus the fraction of zeros per spot (cell) in the simulated datasets.
166+
min: -Inf
167+
max: +Inf
168+
maximize: false
169+
references:
170+
doi: 10.1201/9780429485572
171+
- name: ks_statistic_lib_size_cells_tstat
172+
label: Library size
173+
summary: KS statistic of the library size.
174+
description: |
175+
The Kolmogorov-Smirnov statistic comparing the total sum of UMI counts across all genes in the real datasets versus the total sum of UMI counts across all genes in the simmulated datasets.
176+
min: -Inf
177+
max: +Inf
178+
maximize: false
179+
references:
180+
doi: 10.1201/9780429485572
181+
- name: ks_statistic_efflib_size_cells_tstat
182+
label: Effective library size
183+
summary: KS statistic of the effective library size.
184+
description: |
185+
The Kolmogorov-Smirnov statistic comparing the effective library size of the real datasets versus the effective library size of the simulated datasets.
186+
min: -Inf
187+
max: +Inf
188+
maximize: false
189+
references:
190+
doi: 10.1201/9780429485572
191+
- name: ks_statistic_tmm_cells_tstat
192+
label: TMM
193+
summary: KS statistic of the weight trimmed mean of M-values normalization factor (TMM).
194+
description: |
195+
The Kolmogorov-Smirnov statistic comparing the weight trimmed mean of M-values normalization factor for the real datasets versus the weight trimmed mean of M-values normalization factor for the simulated datasets.
196+
min: -Inf
197+
max: +Inf
198+
maximize: false
199+
references:
200+
doi: 10.1201/9780429485572
201+
- name: ks_statistic_scaled_var_cells_tstat
202+
label: Scaled variance cell
203+
summary: KS statistic of the spot- (or cell-) level scaled variance of the expression matrix.
204+
description: |
205+
The Kolmogorov-Smirnov statistic comparing the spot-level z-score standardization of the variance of expression matrix in terms of log2(CPM) in the real datasets versus the simulated datasets.
206+
min: -Inf
207+
max: +Inf
208+
maximize: false
209+
references:
210+
doi: 10.1201/9780429485572
211+
- name: ks_statistic_scaled_mean_cells_tstat
212+
label: Scaled mean cells
213+
summary: KS statistic of the spot- (or cell-) level scaled mean of the expression matrix.
214+
description: |
215+
The Kolmogorov-Smirnov statistic comparing the z-score standardization of the mean of expression matrix in terms of log2(CPM) in the real datasets versus the simulated datasets.
216+
min: -Inf
217+
max: +Inf
218+
maximize: false
219+
references:
220+
doi: 10.1201/9780429485572
221+
- name: ks_statistic_lib_fraczero_cells_tstat
222+
label: Library size vs fraction zero
223+
summary: KS statistic of the relationship between library size and the proportion of zeros per spot (cell).
224+
description: |
225+
The Kolmogorov-Smirnov statistic comparing the relationship between library size and the proportion of zeros per spot (cell) in the real datasets versus the simulated datasets.
226+
min: -Inf
227+
max: +Inf
228+
maximize: false
229+
references:
230+
doi: 10.1201/9780429485572
231+
- name: ks_statistic_pearson_cells_tstat
232+
label: Sample Pearson correlation
233+
summary: KS statistic of the sample Pearson correlation.
234+
description: |
235+
The Kolmogorov-Smirnov statistic comparing the sample Pearson correlation of the real datasets versus the sample Pearson correlation of the simulated datasets.
236+
min: -Inf
237+
max: +Inf
238+
maximize: false
239+
references:
240+
doi: 10.1201/9780429485572
241+
- name: ks_statistic_scaled_var_genes_tstat
242+
label: Scaled variance genes
243+
summary: KS statistic of the gene-level scaled variance of the expression matrix.
244+
description: |
245+
The Kolmogorov-Smirnov statistic comparing the gene-level z-score standardization of the variance of expression matrix in terms of log2(CPM) in the real datasets versus the simulated datasets.
246+
min: -Inf
247+
max: +Inf
248+
maximize: false
249+
references:
250+
doi: 10.1201/9780429485572
251+
- name: ks_statistic_scaled_mean_genes_tstat
252+
label: Scaled mean genes
253+
summary: KS statistic of the gene-level scaled mean of the expression matrix.
254+
description: |
255+
The Kolmogorov-Smirnov statistic comparing the gene-level z-score standardization of the mean of expression matrix in terms of log2(CPM) in the real datasets versus the simulated datasets.
256+
min: -Inf
257+
max: +Inf
258+
maximize: false
259+
references:
260+
doi: 10.1201/9780429485572
261+
- name: ks_statistic_pearson_genes_tstat
262+
label: Gene Pearson correlation
263+
summary: KS statistic of the gene Pearson correlation.
264+
description: |
265+
The Kolmogorov-Smirnov statistic comparing the gene Pearson correlation of the real datasets versus the gene Pearson correlation of the simulated datasets.
266+
min: -Inf
267+
max: +Inf
268+
maximize: false
269+
references:
270+
doi: 10.1201/9780429485572
271+
- name: ks_statistic_mean_var_genes_tstat
272+
label: Mean vs variance
273+
summary: KS statistic of the relationship between mean expression and variance expression.
274+
description: |
275+
The Kolmogorov-Smirnov statistic comparing the relationship between mean expression and variance expression in the real datasets versus the simulated datasets.
276+
min: -Inf
277+
max: +Inf
278+
maximize: false
279+
references:
280+
doi: 10.1201/9780429485572
281+
- name: ks_statistic_mean_fraczero_genes_tstat
282+
label: Mean vs fraction zero
283+
summary: KS statistic of the relationship between mean expression and the proportion of zero per gene.
284+
description: |
285+
The Kolmogorov-Smirnov statistic comparing the relationship between mean expression and the proportion of zero per gene in the real datasets versus the simulated datasets.
286+
min: -Inf
287+
max: +Inf
288+
maximize: false
289+
references:
290+
doi: 10.1201/9780429485572
291+
151292

152293
resources:
153294
- type: r_script

src/metrics/ks_statistic_gene_cell/script.R

Lines changed: 46 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -105,20 +105,36 @@ ks_statistic_mean_fraczero_genes <- ks::kde.test(x1 = mean_fraczero_real_genes,
105105

106106
cat("Combining metric values\n")
107107
uns_metric_ids <- c(
108-
"ks_statistic_frac_zero_genes",
109-
"ks_statistic_frac_zero_cells",
110-
"ks_statistic_lib_size_cells",
111-
"ks_statistic_efflib_size_cells",
112-
"ks_statistic_tmm_cells",
113-
"ks_statistic_scaled_var_cells",
114-
"ks_statistic_scaled_mean_cells",
115-
"ks_statistic_lib_fraczero_cells",
116-
"ks_statistic_pearson_cells",
117-
"ks_statistic_scaled_var_genes",
118-
"ks_statistic_scaled_mean_genes",
119-
"ks_statistic_pearson_genes",
120-
"ks_statistic_mean_var_genes",
121-
"ks_statistic_mean_fraczero_genes"
108+
"ks_statistic_frac_zero_genes_zstat",
109+
"ks_statistic_frac_zero_cells_zstat",
110+
"ks_statistic_lib_size_cells_zstat",
111+
"ks_statistic_efflib_size_cells_zstat",
112+
"ks_statistic_tmm_cells_zstat",
113+
"ks_statistic_scaled_var_cells_zstat",
114+
"ks_statistic_scaled_mean_cells_zstat",
115+
"ks_statistic_lib_fraczero_cells_zstat",
116+
"ks_statistic_pearson_cells_zstat",
117+
"ks_statistic_scaled_var_genes_zstat",
118+
"ks_statistic_scaled_mean_genes_zstat",
119+
"ks_statistic_pearson_genes_zstat",
120+
"ks_statistic_mean_var_genes_zstat",
121+
"ks_statistic_mean_fraczero_genes_zstat",
122+
123+
"ks_statistic_frac_zero_genes_tstat",
124+
"ks_statistic_frac_zero_cells_tstat",
125+
"ks_statistic_lib_size_cells_tstat",
126+
"ks_statistic_efflib_size_cells_tstat",
127+
"ks_statistic_tmm_cells_tstat",
128+
"ks_statistic_scaled_var_cells_tstat",
129+
"ks_statistic_scaled_mean_cells_tstat",
130+
"ks_statistic_lib_fraczero_cells_tstat",
131+
"ks_statistic_pearson_cells_tstat",
132+
"ks_statistic_scaled_var_genes_tstat",
133+
"ks_statistic_scaled_mean_genes_tstat",
134+
"ks_statistic_pearson_genes_tstat",
135+
"ks_statistic_mean_var_genes_tstat",
136+
"ks_statistic_mean_fraczero_genes_tstat"
137+
122138
)
123139
uns_metric_values <- c(
124140
ks_statistic_frac_zero_genes$zstat,
@@ -134,7 +150,22 @@ uns_metric_values <- c(
134150
ks_statistic_scaled_mean_genes$zstat,
135151
ks_statistic_pearson_genes$zstat,
136152
ks_statistic_mean_var_genes$zstat,
137-
ks_statistic_mean_fraczero_genes$zstat
153+
ks_statistic_mean_fraczero_genes$zstat,
154+
155+
ks_statistic_frac_zero_genes$tstat,
156+
ks_statistic_frac_zero_cells$tstat,
157+
ks_statistic_lib_size_cells$tstat,
158+
ks_statistic_efflib_size_cells$tstat,
159+
ks_statistic_tmm_cells$tstat,
160+
ks_statistic_scaled_var_cells$tstat,
161+
ks_statistic_scaled_mean_cells$tstat,
162+
ks_statistic_lib_fraczero_cells$tstat,
163+
ks_statistic_pearson_cells$tstat,
164+
ks_statistic_scaled_var_genes$tstat,
165+
ks_statistic_scaled_mean_genes$tstat,
166+
ks_statistic_pearson_genes$tstat,
167+
ks_statistic_mean_var_genes$tstat,
168+
ks_statistic_mean_fraczero_genes$tstat
138169
)
139170

140171
cat("Writing output AnnData to file\n")

0 commit comments

Comments
 (0)