Skip to contents

Using ConDecon's predicted cell probability distributions, transfer a numeric feature from the single-cell data to the bulk data

Usage

TransferFeatures(
  ConDecon_obj,
  feature,
  feature_name = deparse(substitute(feature)),
  probs = 0.75
)

Arguments

ConDecon_obj

ConDecon object (output from RunConDecon)

feature

Numeric vector with support on the single-cell latent space (eg pseudotime, gene expression, etc)

feature_name

String indicating the name where the transferred feature will be stored within the ConDecon object (default = the object name input into feature)

probs

Numeric value indicating the bottom quartile of the distribution that should be removed for the purpose of smoothing long tails of the predicted cell probability distribuiton (default = 0.75)

Value

ConDecon object with a matrix called 'TransferFeatures' containing the transferred feature (rows) for each bulk sample (column)

Examples

data(counts_gps)
data(latent_gps)
data(bulk_gps)
data(variable_genes_gps)

# For this example, we will reduce the training size to max.iter = 50 to reduce run time
ConDecon_obj = RunConDecon(counts = counts_gps, latent = latent_gps, bulk = bulk_gps,
variable.features = variable_genes_gps, max.iter = 50)
#> Warning: Y is the same as X, did you mean to use dist instead?

# Transfer feature to ConDecon object: ConDecon_obj$TransferFeatures[feature_name,]
# For this example, randomly selected gene from the count matrix to transfer
random_gene = counts_gps[sample(x = 1:nrow(counts_gps), size = 1),]
ConDecon_obj = TransferFeatures(ConDecon_obj = ConDecon_obj, feature = random_gene)
#> Transferring random_gene...