Skip to content

Commit fd2fbfb

Browse files
author
Charles Plessy
committed
Ensure robustness against different structures encoding the dominant CTSS.
See #70
1 parent e58a6dc commit fd2fbfb

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

R/ExportMethods.R

+6-1
Original file line numberDiff line numberDiff line change
@@ -526,7 +526,12 @@ function( object, what, qLow, qUp, colorByExpressionProfile, oneTrack) {
526526

527527

528528
.exportToTrack_clusters <- function( object, what, qLow, qUp, colorByExpressionProfile, oneTrack) {
529-
object$thick <- ranges(object$dominant_ctss)
529+
# Simplify this after the format of dominant_ctss is standardised in all cluster objects.
530+
ranges_ <- function(x) {
531+
if (inherits(x, "GRanges")) return(IRanges(ranges(x)))
532+
IRanges(x)
533+
}
534+
object$thick <- ranges_(object$dominant_ctss)
530535
object$dominant_ctss <- NULL
531536
names(object) <- NULL
532537
object$name <- NA

0 commit comments

Comments
 (0)