Skip to content

Commit

Permalink
Merge pull request #59 from RECETOX/hotfix
Browse files Browse the repository at this point in the history
added dplyr import and removed saving files
  • Loading branch information
hechth authored Sep 12, 2024
2 parents e6bd7c9 + 0611c13 commit b5ce0bf
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 3 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Package: MFAssignR
Type: Package
Title: An R Package for Data Preparation and Molecular Formula Assignment
Version: 1.1.0
Version: 1.1.1
Author: Simeon Schum, Lynn Mazzoleni, Laura Brown
Maintainer: Simeon Schum, <skschum@mtu.edu>
Description: This package contains functions that can estimate
Expand Down
1 change: 1 addition & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -50,3 +50,4 @@ export(process_carbon_isotoping)
export(process_sulfur)
export(sulfur_check)
import(ggplot2)
importFrom(dplyr,"%>%")
6 changes: 4 additions & 2 deletions R/FindRecalSeries.R
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
#' @param peak_distance_threshold Float A threshold for the peak distance parameter. The closer this value is to 1, the
#' better.
#' @return DataFrame A filtered dataframe.
#' @importFrom dplyr %>%
#' @export
filter_recal_series <- function(df, abundance_score_threshold, peak_distance_threshold) {
df <- df %>%
Expand Down Expand Up @@ -54,6 +55,7 @@ compute_subsets <- function(df, n) {
#' @param global_max Float A higher bound of the instrument m/z range.
#'
#' @return Coverage (in %) of a particular subset.
#' @importFrom dplyr %>%
#' @export
compute_coverage <- function(subset, global_max, global_min) {
subset <- subset %>%
Expand Down Expand Up @@ -128,6 +130,7 @@ compute_scores <- function(combination) {
#' @param scores_df DataFrame A dataframe of scores.
#'
#' @return DataFrame A sorted dataframe containing the final score.
#' @importFrom dplyr %>%
#' @export
compute_final_score <- function(scores_df) {
final_score <- scores_df %>%
Expand All @@ -148,19 +151,18 @@ compute_final_score <- function(scores_df) {
#' combination will be returned.
#'
#' @return DataFrame A dataframe of best-scoring series.
#' @importFrom dplyr %>%
#' @export
find_final_series <- function(scores_df, number_of_combinations, fill_series) {
final_series <- compute_final_score(scores_df)

if (fill_series == FALSE) {
final_series <- final_series %>%
dplyr::slice_head(n = number_of_combinations)
saveRDS(final_series, "test-data/final_seriesFALSE.rds")
} else {
final_series <- final_series %>%
dplyr::distinct(series, .keep_all = TRUE) %>%
dplyr::slice_head(n = 10)
saveRDS(final_series, "test-data/final_seriesTRUE.rds")
}

return(final_series)
Expand Down
3 changes: 3 additions & 0 deletions changelog.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
Package Updates

09/12/2024 Version 1.1.1
- quick fix of hardcoded paths and imports [#59](https://github.com/RECETOX/MFAssignR/pull/59)

09/11/2024 (Version 1.0.4 + Version 1.1.0)
- fixed bug which caused isofiltr to fail is some subsection of input has no isotope pairs #43
- added functions to automatically find the best set of calibrants [#44](https://github.com/RECETOX/MFAssignR/pull/44)
Expand Down

0 comments on commit b5ce0bf

Please sign in to comment.