forked from tianwei-yu/apLCMS
-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #196 from RECETOX/small_refactorings
Small refactorings on combine.seq.3 and general adaptive.bin
- Loading branch information
Showing
13 changed files
with
138 additions
and
143 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
#' Aggregate the intensities and select median mz for features with identical rt. | ||
#' | ||
#' @description This functions computes median mz and sum of intensities over features with same rt. | ||
#' @param features dataframe of retention time, m/z ratio, signal strength. | ||
#' @return returns a tibble with the following columns | ||
#' \itemize{ | ||
#' \item mz - m/z ratio | ||
#' \item rt - retention time | ||
#' \item intensities - signal strength | ||
#' } | ||
#' @export | ||
aggregate_by_rt <- function(features) { | ||
features |> | ||
dplyr::group_by(rt) |> | ||
dplyr::summarize(mass = median(mz[which.max(intensities)]), area = sum(intensities)) |> | ||
dplyr::rename(mz = mass, intensities = area) | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.