R/assign_bulk_states.R
assign_bulk_states.Rd
Samples are assigned to a particular state if the fraction of cells in that state is significantly high. Separately, samples are also assigned to states according to state fractions that are particularly low. Significance is measured against the average state fractions of the population, and this in turn is computed by bootstrapping (from cells across all samples) with <n_iter> repeats.
assign_bulk_states(
scores,
groups,
n.iter = 1000L,
sample.size = 200,
p = 0.001,
min = NULL,
diff = NULL,
return.cells = FALSE,
bootstraps = NULL
)
a dataframe of cell signature scores. Cells are rows and signatures are columns.
list of samples (i.e. rowname subsets in scores) to assign to states.
number of iterations. Default: 1000
the sample size used in each iteration Default: 200
p-value Default: 0.001
minimum value required for a row to be assigned to a column. Default: NULL
minimum difference in value to the 'next-best' row that is required for a row to be assigned to a column. Default: NULL
logical value; return cell ids instead of sample ids? Default: FALSE
if provided, will be used instead of computing bootstrapped repeats. Should be a dataframe with the same rownames as colnames in <scores> and with as many columns as there are bootstrap repeats. Default: NULL
a list of sample assignments to states. The list is organised by state, and nested for state-high and state-low samples.