-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
102 additions
and
94 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
#' @title Clean collapse | ||
#' | ||
#' @description This function collapses a grouped dataframe and trims it | ||
#' | ||
#' @param grouped_df Grouped dataframe | ||
#' | ||
#' @return NULL | ||
#' | ||
#' @export | ||
#' | ||
#' @examples NULL | ||
clean_collapse <- function(grouped_df) { | ||
clean_collapse_df <- grouped_df |> | ||
dplyr::summarize(dplyr::across( | ||
dplyr::everything(), | ||
.fns = function(x) { | ||
x <- list(paste(unique(x[!is.na(x)]), collapse = " $ ")) | ||
} | ||
)) |> | ||
dplyr::ungroup() |> | ||
dplyr::mutate(dplyr::across(dplyr::everything(), trimws)) | ||
|
||
return(clean_collapse_df) | ||
} |
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,25 @@ | ||
#' @title Get example sirius | ||
#' | ||
#' @description This function gets example SIRIUS annotations | ||
#' | ||
#' @param url URL where the example is accessible | ||
#' @param export Path where to save the example | ||
#' | ||
#' @return NULL | ||
#' | ||
#' @export | ||
#' | ||
#' @examples NULL | ||
get_example_sirius <- | ||
function(url = paths$urls$examples$sirius, | ||
export = paths$data$interim$annotations$example_sirius) { | ||
get_file( | ||
url = url, | ||
export = export | ||
) | ||
message("Unzipping") | ||
utils::unzip( | ||
zipfile = export, | ||
exdir = dirname(export) | ||
) | ||
} |
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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