diff --git a/docs/clean__factor_8hpp_source.html b/docs/clean__factor_8hpp_source.html
index 815bf1d..4e14df6 100644
--- a/docs/clean__factor_8hpp_source.html
+++ b/docs/clean__factor_8hpp_source.html
@@ -102,39 +102,44 @@
33std::vector<Factor_>
clean_factor(
size_t n,
const Factor_* factor, Output_* cleaned) {
-
34 std::unordered_map<Factor_, Output_> mapping;
-
35 for (
size_t i = 0; i < n; ++i) {
-
36 auto current = factor[i];
-
-
-
-
-
41 std::vector<Factor_> output;
-
42 size_t nuniq = mapping.size();
-
43 output.reserve(nuniq);
-
44 for (
const auto& mp : mapping) {
-
45 output.push_back(mp.first);
-
-
47 std::sort(output.begin(), output.end());
-
-
-
50 for (
auto key : output) {
-
51 mapping[key] = counter;
-
-
-
-
-
56 for (
size_t i = 0; i < n; ++i) {
-
57 cleaned[i] = mapping[factor[i]];
+
+
35 std::unordered_map<Factor_, Output_> mapping;
+
36 for (
size_t i = 0; i < n; ++i) {
+
37 auto current = factor[i];
+
38 auto mIt = mapping.find(current);
+
39 if (mIt != mapping.end()) {
+
40 cleaned[i] = mIt->second;
+
+
42 Output_ alt = mapping.size();
+
43 mapping[current] = alt;
+
+
+
+
47 return std::vector<std::pair<Factor_, Output_> >(mapping.begin(), mapping.end());
+
+
+
+
51 std::sort(unique.begin(), unique.end());
+
52 size_t nuniq = unique.size();
+
53 std::vector<Output_> remapping(nuniq);
+
54 std::vector<Factor_> output(nuniq);
+
55 for (
size_t u = 0; u < nuniq; ++u) {
+
56 remapping[unique[u].second] = u;
+
57 output[u] = unique[u].first;
-
-
-
-We can also use the aggregate_across_genes()
function to sum expression values across gene sets, e.g., to compute the activity of a gene signature. This can be done with any number of gene sets, possibly with a different weight for each gene in each set.
std::vector<std::tuple<size_t, const int*, const double*> > gene_sets;
diff --git a/docs/scran__aggregate_8hpp.html b/docs/scran__aggregate_8hpp.html
index e8bdf67..eddf2ac 100644
--- a/docs/scran__aggregate_8hpp.html
+++ b/docs/scran__aggregate_8hpp.html
@@ -99,36 +99,38 @@
diff --git a/docs/scran__aggregate_8hpp__incl.map b/docs/scran__aggregate_8hpp__incl.map
index b41278b..ed43d69 100644
--- a/docs/scran__aggregate_8hpp__incl.map
+++ b/docs/scran__aggregate_8hpp__incl.map
@@ -1,32 +1,34 @@
diff --git a/docs/scran__aggregate_8hpp__incl.md5 b/docs/scran__aggregate_8hpp__incl.md5
index 8e5a06b..81a9c85 100644
--- a/docs/scran__aggregate_8hpp__incl.md5
+++ b/docs/scran__aggregate_8hpp__incl.md5
@@ -1 +1 @@
-7fc99d3670d91741d594f4a512d36139
\ No newline at end of file
+2e4460a77fac0d8dce85f6300215acae
\ No newline at end of file
diff --git a/docs/scran__aggregate_8hpp__incl.png b/docs/scran__aggregate_8hpp__incl.png
index 62b4cad..a55e844 100644
Binary files a/docs/scran__aggregate_8hpp__incl.png and b/docs/scran__aggregate_8hpp__incl.png differ