-
Notifications
You must be signed in to change notification settings - Fork 28
fix: adjust NDR threshold behavior. Previously, NDR = 1 would overrid… #559
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -112,7 +112,7 @@ filterTranscriptsByAnnotation <- function(rowDataCombined, annotationGrangesList | |
| } else if(is.null(NDR)) { | ||
| NDR <- 0.5 | ||
| } | ||
| filterSet <- (rowDataCombined$NDR <= NDR | rowDataCombined$readClassType == "equal:compatible") | ||
| filterSet <- ((!is.na(rowDataCombined$NDR) & rowDataCombined$NDR <= NDR) | rowDataCombined$readClassType == "equal:compatible") | ||
| lowConfidenceTranscripts <- combindRowDataWithRanges( | ||
| rowDataCombined[!filterSet,], | ||
| exonRangesCombined[!filterSet]) | ||
|
|
@@ -224,7 +224,7 @@ calculateNDROnTranscripts <- function(combinedTranscripts, useTxScore = FALSE){ | |
| } else { | ||
| combinedTranscripts$NDR <- calculateNDR(combinedTranscripts$maxTxScore, equal) | ||
| } | ||
| combinedTranscripts$NDR[combinedTranscripts$maxTxScore==-1] <- 1 | ||
| combinedTranscripts$NDR[combinedTranscripts$maxTxScore==-1] <- NA | ||
|
||
| return(combinedTranscripts) | ||
| } | ||
|
|
||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This change alters the edge-case semantics for
NDR = 1vsNDR = 0.999by excluding transcripts withNDR = NA(subset / min.sampleNumber-filtered). There isn’t currently a regression test covering this behavior (i.e., thatNDR = 1no longer re-includes subset/low-confidence transcripts, whileNDR = 0.999matches previous results). Consider adding a test that runsisore.extendAnnotations()withNDR = 1and asserts subset/low-confidence transcripts are still excluded (e.g., viametadata(... )$lowConfidenceTranscripts/ counts).