-
Notifications
You must be signed in to change notification settings - Fork 28
Implement opt.rcAssignment #568
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 all commits
dac871e
315e764
7ef1e7b
5add785
a2036a6
a42299a
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 | ||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -34,11 +34,8 @@ | |||||||||||||||||||||||||||||||||
| #' annotation to be assigned to the same gene id, defaults to 10bp} | ||||||||||||||||||||||||||||||||||
| #' \item{min.primarySecondaryDist}{specifying the minimum number of distance | ||||||||||||||||||||||||||||||||||
| #' threshold, defaults to 5bp} | ||||||||||||||||||||||||||||||||||
| #' \item{min.primarySecondaryDistStartEnd1}{specifying the minimum number | ||||||||||||||||||||||||||||||||||
| #' \item{min.primarySecondaryDistStartEnd1}{specifying the minimum number | ||||||||||||||||||||||||||||||||||
| #' of distance threshold, used for extending annotation, defaults to 5bp} | ||||||||||||||||||||||||||||||||||
| #' \item{min.primarySecondaryDistStartEnd2}{specifying the minimum number | ||||||||||||||||||||||||||||||||||
| #' of distance threshold, used for estimating distance to annotation, | ||||||||||||||||||||||||||||||||||
| #' defaults to 5bp} | ||||||||||||||||||||||||||||||||||
| #' \item{min.txScore.multiExon}{specifying the minimum transcript level | ||||||||||||||||||||||||||||||||||
| #' threshold for multi-exon transcripts during sample combining, | ||||||||||||||||||||||||||||||||||
| #' defaults to 0} | ||||||||||||||||||||||||||||||||||
|
|
@@ -62,6 +59,17 @@ | |||||||||||||||||||||||||||||||||
| #' \item{prefix}{specifying prefix for new gene Ids (genePrefix.number), | ||||||||||||||||||||||||||||||||||
| #' defaults to "Bambu"} | ||||||||||||||||||||||||||||||||||
| #' } | ||||||||||||||||||||||||||||||||||
| #' @param opt.rcAssignment A list of controlling parameters for the read class | ||||||||||||||||||||||||||||||||||
| #' to transcript assignment process: | ||||||||||||||||||||||||||||||||||
| #' \describe{ | ||||||||||||||||||||||||||||||||||
| #' \item{min.exonDistance}{specifying minimum distance to known transcript | ||||||||||||||||||||||||||||||||||
| #' to be considered a valid match, defaults to 35bp} | ||||||||||||||||||||||||||||||||||
| #' \item{min.primarySecondaryDist}{specifying the minimum distance | ||||||||||||||||||||||||||||||||||
| #' threshold between primary and secondary assignments, defaults to 5bp} | ||||||||||||||||||||||||||||||||||
| #' \item{min.primarySecondaryDistStartEnd2}{specifying the minimum | ||||||||||||||||||||||||||||||||||
| #' distance threshold for start/end positions used for read assignment, | ||||||||||||||||||||||||||||||||||
| #' defaults to 5bp} | ||||||||||||||||||||||||||||||||||
| #' } | ||||||||||||||||||||||||||||||||||
|
SuiYue-2308 marked this conversation as resolved.
|
||||||||||||||||||||||||||||||||||
| #' @param opt.em A list of controlling parameters for quantification | ||||||||||||||||||||||||||||||||||
| #' algorithm estimation process: | ||||||||||||||||||||||||||||||||||
| #' \describe{ | ||||||||||||||||||||||||||||||||||
|
|
@@ -141,8 +149,8 @@ | |||||||||||||||||||||||||||||||||
| #' genome = fa.file, discovery = TRUE, quant = TRUE) | ||||||||||||||||||||||||||||||||||
| #' @export | ||||||||||||||||||||||||||||||||||
| bambu <- function(reads, annotations = NULL, genome = NULL, NDR = NULL, | ||||||||||||||||||||||||||||||||||
|
SuiYue-2308 marked this conversation as resolved.
|
||||||||||||||||||||||||||||||||||
| mode = NULL, opt.discovery = NULL, opt.em = NULL, rcOutDir = NULL, discovery = TRUE, | ||||||||||||||||||||||||||||||||||
| assignDist = TRUE, quant = TRUE, stranded = FALSE, ncore = 1, yieldSize = NULL, | ||||||||||||||||||||||||||||||||||
| mode = NULL, opt.discovery = NULL, opt.rcAssignment = NULL, opt.em = NULL, rcOutDir = NULL, discovery = TRUE, | ||||||||||||||||||||||||||||||||||
| assignDist = TRUE, quant = TRUE, stranded = FALSE, ncore = 1, yieldSize = NULL, | ||||||||||||||||||||||||||||||||||
| trackReads = FALSE, returnDistTable = FALSE, lowMemory = FALSE, sampleData = NULL, | ||||||||||||||||||||||||||||||||||
| fusionMode = FALSE, verbose = FALSE, demultiplexed = FALSE, quantData = NULL, | ||||||||||||||||||||||||||||||||||
| sampleNames = NULL, cleanReads = FALSE, dedupUMI = FALSE, barcodesToFilter = NULL, clusters = NULL, | ||||||||||||||||||||||||||||||||||
|
|
@@ -176,6 +184,8 @@ bambu <- function(reads, annotations = NULL, genome = NULL, NDR = NULL, | |||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||
| if(lowMemory) | ||||||||||||||||||||||||||||||||||
| message("lowMemory has been deprecated and split into processByChromosome and processByBam. Please see Documentation") | ||||||||||||||||||||||||||||||||||
| if("min.primarySecondaryDistStartEnd2" %in% names(opt.discovery)) | ||||||||||||||||||||||||||||||||||
| message("min.primarySecondaryDistStartEnd2 has been moved to opt.rcAssignment. Please pass this parameter via opt.rcAssignment instead.") | ||||||||||||||||||||||||||||||||||
| if(is.null(annotations)){ | ||||||||||||||||||||||||||||||||||
| annotations <- GRangesList() | ||||||||||||||||||||||||||||||||||
| } else { | ||||||||||||||||||||||||||||||||||
|
|
@@ -184,11 +194,11 @@ bambu <- function(reads, annotations = NULL, genome = NULL, NDR = NULL, | |||||||||||||||||||||||||||||||||
| genomeSequence = genome, discovery = discovery, | ||||||||||||||||||||||||||||||||||
| sampleNames = sampleNames, sampleData = sampleData, quantData = quantData) | ||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||
| isoreParameters <- setIsoreParameters(isoreParameters = opt.discovery) | ||||||||||||||||||||||||||||||||||
| opt.discovery <- setDiscoveryParameters(discoveryParameters = opt.discovery) | ||||||||||||||||||||||||||||||||||
| #below line is to be compatible with earlier version of running bambu | ||||||||||||||||||||||||||||||||||
| if(!is.null(isoreParameters$max.txNDR)) NDR = isoreParameters$max.txNDR | ||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
| emParameters <- setEmParameters(emParameters = opt.em) | ||||||||||||||||||||||||||||||||||
| if(!is.null(opt.discovery$max.txNDR)) NDR = opt.discovery$max.txNDR | ||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||
| if(!is.null(opt.discovery$max.txNDR)) NDR = opt.discovery$max.txNDR | |
| if(!is.null(opt.discovery$max.txNDR)) NDR = opt.discovery$max.txNDR | |
| default.rcAssignment <- setRcAssignmentParameters(rcAssignmentParameters = NULL) | |
| if(is.null(opt.rcAssignment)) opt.rcAssignment <- list() | |
| if(!is.null(opt.discovery)){ | |
| legacy.rcAssignment.names <- intersect(names(opt.discovery), | |
| names(default.rcAssignment)) | |
| if(length(legacy.rcAssignment.names) > 0){ | |
| rcAssignment.names.to.fill <- legacy.rcAssignment.names[ | |
| !(legacy.rcAssignment.names %in% names(opt.rcAssignment))] | |
| if(length(rcAssignment.names.to.fill) > 0){ | |
| opt.rcAssignment[rcAssignment.names.to.fill] <- | |
| opt.discovery[rcAssignment.names.to.fill] | |
| } | |
| } | |
| } |
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.
No testing cover the new introduced parameter, will fix later
Copilot
AI
Apr 17, 2026
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 introduces opt.rcAssignment but opt.rcAssignment is always defaulted independently of opt.discovery. Previously, opt.discovery values (e.g., min.exonDistance, min.primarySecondaryDist, min.primarySecondaryDistStartEnd2) controlled both transcript discovery and read-class assignment; now user-supplied values in opt.discovery will no longer affect assignment unless duplicated in opt.rcAssignment (behavior/API change). To keep backward compatibility, consider seeding opt.rcAssignment from overlapping keys in opt.discovery when opt.rcAssignment is NULL (or when specific keys are missing), and optionally warn/deprecate the old pathway.
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.
defaultModelsis referenced when callinggetTranscriptScore(...)but is not defined in this function scope after renamingisoreParameterstodiscoveryParameters. This will error at runtime. UsediscoveryParameters$defaultModels(or assign a localdefaultModels <- discoveryParameters[["defaultModels"]]) before callinggetTranscriptScore.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 is with the isore.extendAnnotations.clusters, will fix it later