Skip to content

Commit cdf0aae

Browse files
authored
Merge pull request #401 from GoekeLab/bugFixIncompatibleCounts
fix overcounting issue for incompatible counts
2 parents 42dbb39 + 4be0d1e commit cdf0aae

12 files changed

+8
-7
lines changed

.github/workflows/check-bioc.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,9 +54,9 @@ jobs:
5454
fail-fast: false
5555
matrix:
5656
config:
57-
- { os: ubuntu-latest, r: '4.2', bioc: '3.16', cont: "bioconductor/bioconductor_docker:RELEASE_3_16", rspm: "https://packagemanager.rstudio.com/cran/__linux__/focal/latest" }
58-
- { os: macOS-latest, r: '4.2', bioc: '3.16'}
59-
- { os: windows-latest, r: '4.2', bioc: '3.16'}
57+
- { os: ubuntu-latest, r: '4.3', bioc: '3.18', cont: "bioconductor/bioconductor_docker:RELEASE_3_18", rspm: "https://packagemanager.rstudio.com/cran/__linux__/focal/latest" }
58+
- { os: macOS-latest, r: '4.3', bioc: '3.18'}
59+
##- { os: windows-latest, r: '4.3', bioc: '3.18'}
6060
## Check https://github.com/r-lib/actions/tree/master/examples
6161
## for examples using the http-user-agent
6262
env:

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,

R/bambu-quantify_utilityFunctions.R

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@ modifyIncompatibleAssignment <- function(distTable){
2020
#' Process incompatible counts
2121
#' @noRd
2222
processIncompatibleCounts <- function(readClassDist){
23-
distTable <- data.table(as.data.frame(metadata(readClassDist)$distTable))[,
24-
.(readClassId, annotationTxId, readCount, GENEID, dist,equal)]
23+
distTable <- unique(data.table(as.data.frame(metadata(readClassDist)$distTable))[,
24+
.(readClassId, annotationTxId, readCount, GENEID, equal)], by = NULL)
2525
distTableIncompatible <- distTable[grep("unidentified", annotationTxId)]
2626
# filter out multiple geneIDs mapped to the same readClass using rowData(se)
2727
geneRCMap <- as.data.table(as.data.frame(rowData(readClassDist)),

R/sysdata.rda

-7 Bytes
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.

0 commit comments

Comments
 (0)