HSC_population_size_estimate {ISAnalytics} | R Documentation |
Hematopoietic stem cells population size estimate with capture-recapture
models.
HSC_population_size_estimate( x, metadata, stable_timepoints = NULL, aggregation_key = c("SubjectID", "CellMarker", "Tissue", "TimePoint"), blood_lineages = blood_lineages_default(), timepoint_column = "TimePoint", seqCount_column = "seqCount_sum", seqCount_threshold = 3, nIS_threshold = 5, cell_type = "MYELOID", tissue_type = "PB" )
x |
An aggregated integration matrix. See details. |
metadata |
An aggregated association file. See details. |
stable_timepoints |
A numeric vector or NULL if there are no stable time points. |
aggregation_key |
A character vector indicating the key used for aggregating x and metadata. Note that x and metadata should always be aggregated with the same key. |
blood_lineages |
A data frame containing information on the blood
lineages. Users can supply their own, provided the columns |
timepoint_column |
What is the name of the time point column to use? Note that this column must be present in the key. |
seqCount_column |
What is the name of the column in x holding the values of sequence count quantification? |
seqCount_threshold |
A single numeric value. After re-aggregating |
nIS_threshold |
A single numeric value. If a group (row) in the metadata data frame has a count of distinct integration sites strictly greater than this number it will be kept, otherwise discarded. |
cell_type |
The cell types to include in the models. Note that the matching is case-insensitive. |
tissue_type |
The tissue types to include in the models. Note that the matching is case-insensitive. |
A data frame with the results of the estimates
Both x
and metadata
should be supplied to the function in aggregated
format (ideally through the use of aggregate_metadata
and aggregate_values_by_key
).
Note that the aggregation_key
, aka the vector of column names used for
aggregation, must contain at least the columns SubjectID, CellMarker,
Tissue and a time point column (the user can specify the name of the
column in the argument timepoint_column
).
If stable_timepoints
is a vector with length > 1, the function will look
for the first available stable time point and slice the data from that
time point onward. If NULL is supplied instead, it means there are no
stable time points available. Note that 0 time points are ALWAYS discarded.
Also, to be included in the analysis, a group must have at least 2
distinct non-zero time points.
op <- options("ISAnalytics.widgets" = FALSE, "ISAnalytics.verbose" = FALSE) path_AF <- system.file("extdata", "ex_association_file.tsv", package = "ISAnalytics" ) root_correct <- system.file("extdata", "fs.zip", package = "ISAnalytics") root_correct <- unzip_file_system(root_correct, "fs") association_file <- import_association_file(path_AF, root_correct, dates_format = "dmy" ) aggregated_meta <- aggregate_metadata(association_file) matrices <- import_parallel_Vispa2Matrices_auto( association_file = association_file, root = NULL, quantification_type = c("fragmentEstimate", "seqCount"), matrix_type = "annotated", workers = 2, matching_opt = "ANY" ) agg <- aggregate_values_by_key( x = matrices, association_file = association_file, value_cols = "seqCount" ) estimate <- HSC_population_size_estimate(x = agg, metadata = aggregated_meta, stable_timepoints = NULL) options(op)