Skip to content

Commit

Permalink
fixed performance loss during bin metric calculation caused by binnin…
Browse files Browse the repository at this point in the history
…g dp retrieval
  • Loading branch information
jasenfinch committed Nov 4, 2021
1 parent 94ea8bf commit d5daf6d
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions R/calc.R
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,19 @@ calcBinList <- function(pks){

calcBinMeasures <- function(pks,cls){

dp <- binnerDP()

binMeasures <- pks %>%
group_by_at(vars(all_of(c('fileName',
cls,
'polarity',
'bin')))) %>%
summarise(purity = binPurity(mz,
intensity,
dp = binnerDP()),
dp = dp),
centrality = binCentrality(mz,
intensity,
dp = binnerDP()),
dp = dp),
.groups = 'drop')

return(binMeasures)
Expand Down

0 comments on commit d5daf6d

Please sign in to comment.