Skip to content

Commit 4be0d1e

Browse files
author
Chen Ying
committed
fix bug for single exon count when constructing single exon read class
1 parent 171110c commit 4be0d1e

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

R/bambu-processReads_utilityConstructReadClasses.R

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -246,11 +246,12 @@ constructUnsplicedReadClasses <- function(reads.singleExon, annotations,
246246
counts = as.data.frame(reads.singleExon) %>%
247247
mutate(id = mcols(reads.singleExon)$id) %>%
248248
group_by(seqnames,start,end,strand) %>%
249-
summarise(n=n(), id = list(id)) %>%
249+
mutate(n=n(), id = list(id)) %>% # change summarise to mutate as summarise will reorder the table
250+
ungroup() %>%
250251
as.data.frame()
251-
reads.singleExon = unique(reads.singleExon)
252252
mcols(reads.singleExon)$counts <- counts$n
253253
mcols(reads.singleExon)$id <- counts$id
254+
reads.singleExon = unique(reads.singleExon)
254255

255256
rcUnsplicedAnnotation <- getUnsplicedReadClassByReference(
256257
granges = reads.singleExon, grangesReference = referenceExons,

0 commit comments

Comments
 (0)