From 5c14a6c44ea0cd018f06aeaeb4820a575af6e400 Mon Sep 17 00:00:00 2001 From: LTLA Date: Thu, 10 Oct 2024 10:56:27 -0700 Subject: [PATCH] Fleshed out documentation for the intersection argument. --- include/singlepp/Intersection.hpp | 8 ++++++-- include/singlepp/train_integrated.hpp | 4 +++- include/singlepp/train_single.hpp | 4 +++- 3 files changed, 12 insertions(+), 4 deletions(-) diff --git a/include/singlepp/Intersection.hpp b/include/singlepp/Intersection.hpp index c6e9a31..42dc74a 100644 --- a/include/singlepp/Intersection.hpp +++ b/include/singlepp/Intersection.hpp @@ -18,13 +18,17 @@ namespace singlepp { /** * Intersection of genes between two datasets. - * Each element is a pair of matching genes and contains the row indices of those genes in each dataset. - * A row index for either matrix should occur no more than once in this object. + * Each pair represents a gene that is present in both datasets. + * The two elements of the pair represent the row indices of that gene in the respective matrices. * * Typically, the first element of the pair contains the row index of a gene in the test dataset, * while the second element of the pair contains the row index of the same gene in the reference dataset. * This convention is used by `intersect_genes()`, `train_single_intersect()` and `prepare_integrated_input_intersect()`. * + * A row index for a matrix should occur no more than once in the `Intersection` object. + * That is, all the first elements should be unique and all of the second elements should be unique. + * Pairs may be arbitrarily ordered within the object. + * * @tparam Index_ Integer type for the gene (row) indices. */ template diff --git a/include/singlepp/train_integrated.hpp b/include/singlepp/train_integrated.hpp index ddc12e5..f827be8 100644 --- a/include/singlepp/train_integrated.hpp +++ b/include/singlepp/train_integrated.hpp @@ -115,7 +115,9 @@ TrainIntegratedInput prepare_integrated_input( * @tparam Label_ Integer type for the reference labels. * @tparam Float_ Floating-point type for the correlations and scores. * - * @param intersection Vector defining the intersection of genes between the test and reference datasets, see `intersect_genes()` for details. + * @param intersection Vector defining the intersection of genes between the test and reference datasets. + * Each pair corresponds to a gene where the first and second elements represent the row indices of that gene in the test and reference matrices, respectively. + * See `intersect_genes()` for more details. * @param ref Matrix containing the reference expression values, where rows are genes and columns are reference profiles. * The number and identity of genes should be consistent with `intersection`. * @param[in] labels An array of length equal to the number of columns of `ref`, containing the label for each sample. diff --git a/include/singlepp/train_single.hpp b/include/singlepp/train_single.hpp index 058dfdb..3030007 100644 --- a/include/singlepp/train_single.hpp +++ b/include/singlepp/train_single.hpp @@ -295,7 +295,9 @@ class TrainedSingleIntersect { * @tparam Label_ Integer type for the reference labels. * @tparam Float_ Floating-point type for the correlations and scores. * - * @param intersection Vector defining the intersection of genes between the test and reference datasets, see `intersect_genes()` for more details. + * @param intersection Vector defining the intersection of genes between the test and reference datasets. + * Each pair corresponds to a gene where the first and second elements represent the row indices of that gene in the test and reference matrices, respectively. + * See `intersect_genes()` for more details. * @param ref An expression matrix for the reference expression profiles, where rows are genes and columns are cells. * This should have non-zero columns. * @param[in] labels An array of length equal to the number of columns of `ref`, containing the label for each reference profile.