Skip to content

Commit

Permalink
Ensure getPeaks() returns sample index
Browse files Browse the repository at this point in the history
  • Loading branch information
jasenfinch committed Aug 11, 2023
1 parent ed00ed9 commit eb8fdf0
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions R/get.R
Original file line number Diff line number Diff line change
Expand Up @@ -59,11 +59,19 @@ getFile <- function(file,scans){

getPeaks <- function(files,scans){

idx <- tibble(
fileName = files
) %>%
rowid_to_column(var = 'idx')

dp <- binnerDP()

pks <- future_map(files,getFile,scans = scans) %>%
set_names(files) %>%
bind_rows(.id = 'fileName') %>%
set_names(idx$idx) %>%
bind_rows(.id = 'idx') %>%
mutate(idx = as.numeric(idx)) %>%
left_join(idx,
by = 'idx') %>%
mutate(fileName = basename(fileName),
mz = round(mz,5),bin = round(mz,dp))
return(pks)
Expand All @@ -79,7 +87,7 @@ getHeaders <- function(files){
future_map(readRDS)

file_headers <- file_headers %>%
set_names(files) %>%
set_names(files) %>%
bind_rows(.id = 'FileName') %>%
select(FileName,acquisitionNum,totIonCurrent,polarity,filterString)

Expand Down

0 comments on commit eb8fdf0

Please sign in to comment.