Skip to content
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

Fix bug in wrong run_filter filtering based on min_pres #228

Open
hechth opened this issue Oct 3, 2024 · 0 comments
Open

Fix bug in wrong run_filter filtering based on min_pres #228

hechth opened this issue Oct 3, 2024 · 0 comments
Assignees

Comments

@hechth
Copy link
Member

hechth commented Oct 3, 2024

Currently, the min_pres filtering fails to include the entire RT span but actually makes it based off of the min_run length that is applied as a parameter.

The proper condition should be

n() >= span(rt) * min_pres * scan_rate

# calculates the minimun number of rt points to be considered a peak
scan_rate <- 1.0 / abs(median(diff(times)))
min_count_run <- round(min_pres * min_run * scan_rate)
# computes unique groups
uniq_grp <- compute_uniq_grp(newprof$grps, min_count_run, min_pres)
# ordered by mz and grps data that are inside unigrps
newprof <- dplyr::filter(newprof, grps %in% uniq_grp) |> dplyr::arrange(grps, mz)
results <- dplyr::group_by(newprof, grps) |>
dplyr::filter(n() >= min_count_run && abs(span(rt)) >= min_run) |>
dplyr::ungroup() |>
dplyr::rename(group_number = grps)

@hechth hechth self-assigned this Oct 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant