Skip to content

Refit workflow with KRAS example #43

@khsjh

Description

@khsjh

Hello, I have some question about KRAS data processing.

  1. Why reweight and reassign parameters are set to FALSE in generating slingshot object and slingshot_conditions?
    In other dataset examples, they were processed with default parameter TRUE but only KRAS example was processed with FALSE.
    Below examples are code for generating slingshot object by each dataset.

KRAS

kras <- slingshot(kras, reducedDim = "TSNE", clusterLabels = kras$Cluster,
                 start.clus = 7, extend = "n", reweight = FALSE, reassign = FALSE)
sdss <- slingshot_conditions(kras, kras$Batch, approx_points = FALSE,
                             extend = "n", reweight = FALSE, reassign = FALSE)
sdss$condition_id <- names(sdss)
sdss$mapping <- matrix(rep(1:3, each = 3), nrow = 3, ncol = 3, byrow = TRUE)
sds <- do.call(merge_sds, sdss)

Fibrosis

fibrosis <- slingshot(fibrosis, reducedDim = 'UMAP',
                 clusterLabels = colData(fibrosis)$celltype,
                 start.clus = 'AT1', approx_points = 100)

TCDD

tcdd <- slingshot(tcdd, reducedDim = "UMAP", clusterLabels = tcdd$celltype,
                  start.clus = "Central", end.clus  = "Portal")

TGFB

tgfb <- slingshot(tgfb, reducedDim = 'UMAP',
                  clusterLabels = colData(tgfb)$pheno$spatial_id,
                  start.clus = 'inner', approx_points = 100)
  1. In KRAS workflow, new weights was calculated by condiments:::.sling_reassign function and it was used in evaluateK function.
    But this weights was not used in fitGAM function and just use prior slingshot object.
weights <- condiments:::.sling_reassign(sds)
icMat <- evaluateK(counts = as.matrix(assays(kras)$counts),
                   pseudotime = slingPseudotime(sds, na = FALSE),
                   cellWeights = weights,
                   conditions = factor(colData(kras)$Batch),
                   nGenes = 300,
                   k = 3:7,
                   parallel = TRUE,
                   BPPARAM = BPPARAM)

Also, below command may be not function because slingshot object was already located in SCE column and SCE recognized in column meta data at first rather than int_metadata slot.
kras@int_metadata$slingshot <- sds

kras@int_metadata$slingshot <- sds
kras <- fitGAM(counts = kras,
               conditions = factor(colData(kras)$Batch),
               parallel = TRUE,
               BPPARAM = BPPARAM,
               nknots = 6)

Slingshot::SlingshotDataSet code

#' @rdname SlingshotDataSet
#' @export
setMethod(
    f = "SlingshotDataSet",
    signature = "SingleCellExperiment",
    definition = function(data){
        if("slingshot" %in% names(colData(data))){
            return(as.SlingshotDataSet(colData(data)$slingshot))
        }
        if("slingshot" %in% names(data@int_metadata)){
            return(data@int_metadata$slingshot)            
        }
        stop('No slingshot results found.')
    }
)

Than, I can predict that command line, kras@int_metadata$slingshot <- sds was just for saving and new calculated weights was used for only evaluateK and fitGAM didn't require these weight value.
Or there are some changed logic in slingshot so that the int_metadata slot can't be used in recent version script with condiments.

I want to run my dataset by KRAS workflow but it is ambiguous to me

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions