Skip to content

Commit c517ef9

Browse files
committed
Reworded the docstrings with more information.
1 parent baf5751 commit c517ef9

6 files changed

Lines changed: 133 additions & 97 deletions

File tree

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,4 +139,4 @@ See the tags in [`extern/CMakeLists.txt`](extern/CMakeLists.txt) to find compati
139139
### Manual
140140

141141
If you're not using CMake, the simple approach is to just copy the files in `include/` - either directly or with Git submodules - and include their path during compilation with, e.g., GCC's `-I`.
142-
This requires the external dependencies listed in [`extern/CMakeLists.txt`](extern/CMakeLists.txt), which also need to be made available during compilation.
142+
This also requires the external dependencies listed in [`extern/CMakeLists.txt`](extern/CMakeLists.txt).

include/scran_markers/cohens_d.hpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,11 @@ Stat_ cohen_denominator(const Stat_ left_var, const Stat_ right_var) {
4545
} else if (std::isnan(right_var)) {
4646
return std::sqrt(left_var);
4747
} else {
48+
// Technically, we should use the pooled variance, but this introduces some unintuitive asymmetry in the behavior of the groups.
49+
// You wouldn't get the same (expected) Cohen's d when you change the sizes of the groups with different variances.
50+
// For example, if the larger group has low variance (e.g., because it's all zero), the variance of the smaller group is effectively ignored,
51+
// unfairly favoring genes with highly variable expression in the smaller group.
52+
// So we take a simple average instead.
4853
return std::sqrt(left_var + (right_var - left_var)/2); // reduce risk of overflow.
4954
}
5055
}

0 commit comments

Comments
 (0)