Skip to content

Commit 25aa679

Browse files
author
SuiYue-2308
committed
fix: adjust NDR threshold behavior. Previously, NDR = 1 would override remove.subset and min.sampleNumber. Now, NDR = 0.999 and NDR = 1 produce identical results except for the NDR threshold itself.
1 parent fdf8db5 commit 25aa679

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

R/bambu-extendAnnotations-utilityExtend.R

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ filterTranscriptsByAnnotation <- function(rowDataCombined, annotationGrangesList
112112
} else if(is.null(NDR)) {
113113
NDR <- 0.5
114114
}
115-
filterSet <- (rowDataCombined$NDR <= NDR | rowDataCombined$readClassType == "equal:compatible")
115+
filterSet <- ((!is.na(rowDataCombined$NDR) & rowDataCombined$NDR <= NDR) | rowDataCombined$readClassType == "equal:compatible")
116116
lowConfidenceTranscripts <- combindRowDataWithRanges(
117117
rowDataCombined[!filterSet,],
118118
exonRangesCombined[!filterSet])
@@ -224,7 +224,7 @@ calculateNDROnTranscripts <- function(combinedTranscripts, useTxScore = FALSE){
224224
} else {
225225
combinedTranscripts$NDR <- calculateNDR(combinedTranscripts$maxTxScore, equal)
226226
}
227-
combinedTranscripts$NDR[combinedTranscripts$maxTxScore==-1] <- 1
227+
combinedTranscripts$NDR[combinedTranscripts$maxTxScore==-1] <- NA
228228
return(combinedTranscripts)
229229
}
230230

0 commit comments

Comments
 (0)