Skip to content

Commit d451cde

Browse files
committed
add the missing function
1 parent 5da285e commit d451cde

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

R/bambu-extendAnnotations-utilityCombine.R

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,13 @@ updateStartEndReadCount <- function(combinedFeatureTibble){
109109
return(combinedFeatureTibble)
110110
}
111111

112+
#' Function to get median value without interpolation using certain column names
113+
#' @noRd
114+
readCountWeightedMedian <- function(dt, valuevar, timesvar){
115+
sortVector <- rep(na.omit(unlist(dt[,..valuevar])),
116+
times = as.integer(na.omit(unlist(dt[,..timesvar]))))
117+
return(min(sortVector[sortVector>=quantile(sortVector, probs = 0.5)]))
118+
}
112119

113120

114121
#' Function to combine featureTibble and create the NSample variables

0 commit comments

Comments
 (0)