Skip to content

Commit 7590a72

Browse files
committed
updated quality control
1 parent 2888d66 commit 7590a72

File tree

10 files changed

+38
-47
lines changed

10 files changed

+38
-47
lines changed

NEWS.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
# visualizationQualityControl 0.4.10
2+
3+
* Updated the quality_control vignette to use ICIKendallTau instead of other correlation measures.
4+
15
# visualizationQualityControl 0.4.9
26

37
* Windows and Mac binaries are now available via r-universe, and installation instructions are updated to reflect that.

docs/articles/quality_control.html

Lines changed: 22 additions & 27 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
-2.35 KB
Loading
-2.09 KB
Loading
-2.16 KB
Loading
-1.75 KB
Loading

docs/news/index.html

Lines changed: 4 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/pkgdown.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,5 @@ pkgdown_sha: ~
44
articles:
55
pca_testing: pca_testing.html
66
quality_control: quality_control.html
7-
last_built: 2021-12-29T14:50Z
7+
last_built: 2021-12-29T15:35Z
88

docs/search.json

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

vignettes/quality_control.Rmd

Lines changed: 6 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ vignette: >
77
%\VignetteIndexEntry{Quality Control Example}
88
%\VignetteEncoding{UTF-8}
99
%\VignetteDepends{visualizationQualityControl, ggplot2, ComplexHeatmap,
10-
viridis, ICIKendallTau}
10+
viridis, circlize, ICIKendallTau}
1111
%\VignetteEngine{knitr::rmarkdown}
1212
editor_options:
1313
chunk_output_type: console
@@ -166,28 +166,16 @@ the samples very well. The PCA plots rarely look this good in practice!
166166
## Correlation Heatmap
167167

168168
Correlation heatmaps show much of the same information as the PCA plots, but in
169-
a different way. Note that what we are calculating are **all pairwise sample-sample**
170-
correlations. In each sample-sample correlation, we calculate the correlation
171-
using the non-zero feature values.
172-
173-
```{r sample1_sample2_cor, fig.width = 5, fig.height=5}
174-
s1_s2_cor <- cor(log_data[,1], log_data[,2])
175-
s1_s2_val <- sprintf("%.4f", s1_s2_cor)
176-
ggplot(log_df, aes(x = s1, y = s2)) + geom_point() + labs(title = paste0("R = ", s1_s2_val))
177-
```
169+
a different way.
178170

179171
### Calculate Correlations
180172

181-
All pairwise correlations should be calculated using either the `globally_it_weighted_pairwise_correlation` or `locally_it_weighted_pairwise_correlation` functions.
182-
These functions calculate a correlation where we remove missing or zero values in either sample, and in addition, weights the correlations by the information shared between the samples, as well as their consistency, that is how many shared present and missing values there are between them.
173+
We recommend to use our information-content-informed Kendall-tau {ICIKendallTau::ici_kendalltau} correlation, that is scale invariant, and includes some effects of missing values.
183174
Note that we take the transpose of the data, because this function assumes
184175
that data are organized with *features* as *columns* and *samples* as *rows*.
185-
Also, because we used `log1p` to transform the data, we make sure to remove the
186-
zeros, corresponding to missing data. A `log` transform would make them `-Inf`
187-
or `NaN`, and they should be removed automatically.
188176

189177
```{r calc_correlations}
190-
data_cor <- globally_it_weighted_pairwise_correlation(t(log_data), exclude_0 = TRUE)
178+
data_cor <- ICIKendallTau::ici_kendalltau(t(exp_data))
191179
```
192180

193181
This returns a list with some useful information, the actual correlations in `cor`,
@@ -206,7 +194,7 @@ dim(data_cor)
206194
We also do the same for our **mixed-up** data.
207195

208196
```{r mix_cor}
209-
mix_cor <- globally_it_weighted_pairwise_correlation(t(log_mix))$cor
197+
mix_cor <- ICIKendallTau::ici_kendalltau(t(mix_data))$cor
210198
```
211199

212200
### Reorder Correlations
@@ -246,7 +234,7 @@ information about `viridis` is available [here](http://bids.github.io/colormap/)
246234
```{r correlation_to_color}
247235
library(viridis)
248236
library(circlize)
249-
colormap <- colorRamp2(seq(0.2, 1, length.out = 20), viridis::viridis(20))
237+
colormap <- colorRamp2(seq(0.5, 1, length.out = 20), viridis::viridis(20))
250238
```
251239

252240

0 commit comments

Comments
 (0)