Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Suggestion: a new, maybe private, acessor CTSScoordinatesGRL #99

Open
charles-plessy opened this issue Jul 27, 2023 · 1 comment
Open

Comments

@charles-plessy
Copy link
Owner

I am wondering about adding a new accessor that returns a GRangesList of CTSS objects with the score of their sample. In these objects the non-expressed CTSSes are not represented, therefore the data can not be represented as a DataFrame or a SummarizedExperiment since each sample is a vector of a different length.

CTSScoordinatesGRL <- function(object) {
  grl <- lapply(sampleLabels(object), CTSStagCountGR, object = object) |> GRangesList()
  names(grl) <- unname(sampleLabels(object))
  # Also pass the original colData?
  grl@metadata$colData <- colData(object)
  grl
}

This function would be useful when looping over CTSSes. I am not sure if it is worth to make it public or better to keep it private.

A similar function may be useful for consensus clusters.

The tagClustersGR function's name is actually misleading, as it also returns a GRL. But let's not change that.

@charles-plessy
Copy link
Owner Author

charles-plessy commented Jul 28, 2023

However …

consensusClustersGRL <- function(object) {
  grl <- lapply(sampleLabels(object), consensusClustersGR, object = object) |> GRangesList()
  names(grl) <- unname(sampleLabels(object))
  # Also pass the original colData?
  grl@metadata$colData <- colData(object)
  grl
}
clustersGRL <- consensusClustersGRL(ce_SL)

##  Error in validObject(ans) : 
##   invalid class "ConsensusClusters" object: Consensus clusters must not overlap with each ## other.

I think that this is because GRangesList objects may be GRanges behind the scenes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant