Skip to content

Commit

Permalink
Fix function for one-sample cases.
Browse files Browse the repository at this point in the history
  • Loading branch information
charles-plessy committed Jun 28, 2023
1 parent 8b70db0 commit a019141
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions R/ImportMethods.R
Original file line number Diff line number Diff line change
Expand Up @@ -796,10 +796,14 @@ setGeneric("importPublicData",
df$strand,
seqinfo = seqinfo(getRefGenome(genome.name)),
bsgenomeName = genome.name)
ctssDF <- lapply(df[ , sample], Rle) |> DataFrame()
ctssDF <- lapply(df[ , sample, drop = FALSE], Rle) |> DataFrame()
colnames(ctssDF) <- make.names(colnames(ctssDF))
ctssSE <- SummarizedExperiment(c(counts = ctssDF), ctssRanges)
ctssSE <- ctssSE[rowSums(df[ , sample]) > 0,]
if (ncol(ctssDF) == 1) {
ctssSE <- ctssSE[ df[ , sample] > 0,]
} else {
ctssSE <- ctssSE[rowSums(df[ , sample]) > 0,]
}
sort(ctssSE)
}

Expand Down

0 comments on commit a019141

Please sign in to comment.