singlepp_loaders
Load pre-processed reference datasets for SingleR
|
Load pre-processed single reference datasets. More...
Classes | |
struct | LoadLabelsOptions |
Options for loading labels. More... | |
struct | LoadMarkersOptions |
Options for loading markers. More... | |
struct | LoadRankingsOptions |
Options for loading rankings. More... | |
Typedefs | |
template<typename Value_ = double, typename Index_ = int, typename Rank_ = int> | |
using | RankMatrix = tatami::DenseMatrix< Value_, Index_, std::vector< Rank_ > > |
Load pre-processed single reference datasets.
using singlepp_loaders::RankMatrix = typedef tatami::DenseMatrix<Value_, Index_, std::vector<Rank_> > |
Matrix of ranks as a dense column-major matrix. Each column corresponds to a sample while each row corresponds to a feature. Each column contains the ranked expression values for all features.
Value_ | Numeric type for data in the matrix interface. |
Index_ | Integer type for indices in the matrix interface. |
Rank_ | Integer type for the ranks being stored. |
std::vector< Label_ > singlepp_loaders::load_labels_from_gzip_file | ( | const char * | path, |
const LoadLabelsOptions & | options | ||
) |
Label_ | Integer type for the label identity. |
path | Path to a Gzip-compressed file containing the labels. |
options | Options for reading the labels. |
See load_labels_from_text_file()
for details about the format.
std::vector< Label_ > singlepp_loaders::load_labels_from_text_file | ( | const char * | path, |
const LoadLabelsOptions & | options | ||
) |
Label_ | Integer type for the label identity. |
path | Path to a text file containing the labels. |
options | Options for reading the labels. |
The file should contain one line per profile, containing an integer label index for that profile. Label indices refer to another array containing the actual names of the labels (see load_label_names_from_text_file()
). The total number of lines should be equal to the number of profiles in the dataset. The file should not contain any header.
std::vector< Label_ > singlepp_loaders::load_labels_from_zlib_buffer | ( | const unsigned char * | buffer, |
size_t | len, | ||
const LoadLabelsOptions & | options | ||
) |
Label_ | Integer type for the label identity. |
[in] | buffer | Pointer to an array containing a Zlib/Gzip-compressed string of labels. |
len | Length of the array for buffer . | |
options | Options for reading the labels. |
See load_labels_from_text_file()
for details about the format.
singlepp::Markers< Index_ > singlepp_loaders::load_markers_from_gzip_file | ( | const char * | path, |
const LoadMarkersOptions & | options | ||
) |
Index_ | Integer type for the marker indices. |
path | Path to a Gzip-compressed file containing the marker lists. |
options | Further options for reading. |
Markers
object containing the markers from each pairwise comparison between labels.See load_markers_from_text_file()
for details about the format.
singlepp::Markers< Index_ > singlepp_loaders::load_markers_from_text_file | ( | const char * | path, |
const LoadMarkersOptions & | options | ||
) |
Index_ | Integer type for the marker indices. |
path | Path to a text file containing the marker lists. |
options | Further options for reading. |
Markers
object containing the markers from each pairwise comparison between labels.The file should contain one line per pairwise comparison between labels. Each line should at least 3 tab-delimited fields - the index of the first label, the index of the second label, and then the indices of the features selected as marker genes for the first label relative to the second. Any (non-zero) number of marker indices may be reported provided they are ordered by marker strength. The total number of lines in this file should be equal to the total number of pairwise comparisons between different labels, including permutations.
singlepp::Markers< Index_ > singlepp_loaders::load_markers_from_zlib_buffer | ( | const unsigned char * | buffer, |
size_t | len, | ||
const LoadMarkersOptions & | options | ||
) |
Index_ | Integer type for the marker indices. |
[in] | buffer | Pointer to an array containing a Zlib/Gzip-compressed string containing the marker lists. |
len | Length of the array for buffer . | |
options | Further options for reading. |
Markers
object containing the markers from each pairwise comparison between labels.See load_markers_from_text_file()
for details about the format.
RankMatrix< Value_, Index_ > singlepp_loaders::load_rankings_from_gzip_file | ( | const char * | path, |
const LoadRankingsOptions & | options | ||
) |
Value_ | Numeric type for data in the matrix interface. |
Index_ | Integer type for indices in the matrix interface. |
path | Path to a Gzip-compressed file containing the ranking matrix. |
options | Options for reading the rankings. |
RankMatrix
containing the feature rankings for each reference profile. Each column corresponds to a reference profile while each row corresponds to a feature.See load_rankings_from_text_file()
for details about the format.
RankMatrix< Value_, Index_ > singlepp_loaders::load_rankings_from_text_file | ( | const char * | path, |
const LoadRankingsOptions & | options | ||
) |
Value_ | Numeric type for data in the matrix interface. |
Index_ | Integer type for indices in the matrix interface. |
path | Path to a text file containing the ranking matrix. |
options | Options for reading the rankings. |
RankMatrix
containing the feature rankings for each reference profile. Each column corresponds to a reference profile while each row corresponds to a feature.The file should contain one line per reference profile, with the total number of lines equal to the number of profiles in the dataset. Each line should contain the rank of each feature's expression within that profile, separated by commas. The number of comma-separated fields on each line should be equal to the number of features. Ranks should be strictly integer - tied ranks should default to the minimum rank among the index set of ties.
RankMatrix< Value_, Index_ > singlepp_loaders::load_rankings_from_zlib_buffer | ( | const unsigned char * | buffer, |
size_t | len, | ||
const LoadRankingsOptions & | options | ||
) |
Value_ | Numeric type for data in the matrix interface. |
Index_ | Integer type for indices in the matrix interface. |
[in] | buffer | Pointer to an array containing a Zlib/Gzip-compressed string containing the ranking matrix. |
len | Length of the array for buffer . | |
options | Options for reading the rankings. |
RankMatrix
containing the feature rankings for each reference profile. Each column corresponds to a reference profile while each row corresponds to a feature.See load_rankings_from_text_file()
for details about the format.
void singlepp_loaders::verify | ( | const RankMatrix< Value_, Index_, Rank_ > & | rankings, |
const std::vector< Label_ > & | labels, | ||
const singlepp::Markers< Index_ > & | markers | ||
) |
This checks the consistency of all components of the reference dataset after they have been loaded:
rankings
should be equal to the length of labels
.labels
plus 1.markers
and the number of inner vectors in each element of markers
should be equal to the number of labels.markers
should be non-negative and less than the number of rows in rankings
.Value_ | Numeric type for data in the matrix interface. |
Index_ | Integer type for indices in the matrix interface. |
Rank_ | Integer type for the ranks being stored. |
Label_ | Integer type for the labels. |
rankings | The matrix produced by load_rankings_from_text_file() or related functions. |
labels | Vector of labels produced by load_labels_from_text_file() or related functions. |
markers | List of markers produced by load_markers_from_text_file() or related functions. |