Skip to content

Commit

Permalink
Fleshed out documentation for the intersection argument.
Browse files Browse the repository at this point in the history
  • Loading branch information
LTLA committed Oct 10, 2024
1 parent 0897a05 commit 5c14a6c
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 4 deletions.
8 changes: 6 additions & 2 deletions include/singlepp/Intersection.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<typename Index_ = DefaultIndex>
Expand Down
4 changes: 3 additions & 1 deletion include/singlepp/train_integrated.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,9 @@ TrainIntegratedInput<Value_, Index_, Label_> 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.
Expand Down
4 changes: 3 additions & 1 deletion include/singlepp/train_single.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit 5c14a6c

Please sign in to comment.