Skip to content

Commit

Permalink
doc
Browse files Browse the repository at this point in the history
  • Loading branch information
Adafede committed Aug 13, 2024
1 parent 6698849 commit 11bb718
Show file tree
Hide file tree
Showing 103 changed files with 1,475 additions and 306 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ X-schema.org-keywords: metabolite annotation, chemotaxonomy, scoring
distance, specialized metabolome
Collate:
'round_reals.R'
'log_pipe.R'
'harmonize_adducts.R'
'parse_yaml_params.R'
'parse_cli_params.R'
Expand Down Expand Up @@ -126,7 +127,6 @@ Collate:
'install.R'
'load_yaml_files.R'
'log_debug.R'
'log_pipe.R'
'pre_harmonize_names_sirius.R'
'select_annotations_columns.R'
'prepare_annotations_gnps.R'
Expand Down
47 changes: 0 additions & 47 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -2,57 +2,23 @@

export(annotate_masses)
export(annotate_spectra)
export(benchmark_taxize_spectra)
export(calculate_entropy)
export(calculate_mass_of_m)
export(clean_bio)
export(clean_chemo)
export(clean_collapse)
export(columns_model)
export(complement_metadata_structures)
export(copy_backbone)
export(create_components)
export(create_dir)
export(create_edges)
export(create_edges_spectra)
export(decorate_bio)
export(decorate_chemo)
export(decorate_masses)
export(dist_get)
export(dist_groups)
export(export_output)
export(export_params)
export(export_spectra_rds)
export(extract_spectra)
export(fake_annotations_columns)
export(fake_ecmdb)
export(fake_hmdb)
export(fake_lotus)
export(fake_sop_columns)
export(filter_annotations)
export(filter_high_confidence_only)
export(get_default_paths)
export(get_example_files)
export(get_example_sirius)
export(get_file)
export(get_gnps_tables)
export(get_last_version_from_zenodo)
export(get_massbank_spectra)
export(get_organism_taxonomy_ott)
export(get_params)
export(go_to_cache)
export(harmonize_adducts)
export(harmonize_names_sirius)
export(harmonize_spectra)
export(import_spectra)
export(install)
export(load_yaml_files)
export(log_debug)
export(log_pipe)
export(parse_adduct)
export(parse_cli_params)
export(parse_yaml_params)
export(pre_harmonize_names_sirius)
export(prepare_annotations_gnps)
export(prepare_annotations_sirius)
export(prepare_annotations_spectra)
Expand All @@ -66,24 +32,11 @@ export(prepare_libraries_sop_hmdb)
export(prepare_libraries_sop_lotus)
export(prepare_libraries_sop_merged)
export(prepare_libraries_spectra)
export(prepare_params)
export(prepare_taxa)
export(read_from_sirius_zip)
export(replace_id)
export(round_reals)
export(run_app)
export(sanitize_spectra)
export(select_annotations_columns)
export(select_sirius_columns_canopus)
export(select_sirius_columns_formulas)
export(select_sirius_columns_structures)
export(select_sop_columns)
export(split_tables_sop)
export(tima_full)
export(transform_score_sirius_csi)
export(weight_annotations)
export(weight_bio)
export(weight_chemo)
import(rlang)
importFrom(MetaboCoreUtils,calculateMass)
importFrom(MsBackendMgf,readMgf)
Expand Down
1 change: 1 addition & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

* Improved documentation
* Reduced dependencies
* Reduced exports
* Removed `CompoundDb` dependency as it was causing too many issues
* Removed `pak` install and switched to `r-universe`
* Replaced internal functions by `Spectra` equivalents (#166)
Expand Down
1 change: 1 addition & 0 deletions R/annotate_masses.R
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ import::from(tidytable, where, .into = environment())
#' @include dist_groups.R
#' @include get_params.R
#' @include harmonize_adducts.R
#' @include log_pipe.R
#' @include round_reals.R
#'
#' @param features Table containing your previous annotation to complement
Expand Down
4 changes: 0 additions & 4 deletions R/benchmark_taxize_spectra.R
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@ import::from(tidytable, slice_sample, .into = environment())
#'
#' @details Because they are still quite dirty
#'
#' @export
#'
#' @importFrom stringi stri_sub
#' @importFrom tidytable bind_rows
#' @importFrom tidytable distinct
Expand All @@ -26,8 +24,6 @@ import::from(tidytable, slice_sample, .into = environment())
#' @importFrom tidytable select
#' @importFrom tidytable slice_sample
#'
#' @noRd
#'
#' @param input Initial features
#' @param keys SOP keys
#' @param org_tax_ott Taxonomy
Expand Down
4 changes: 0 additions & 4 deletions R/calculate_entropy.R
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,9 @@ import::from(tidytable, tidytable, .into = environment())
#'
#' @description This function calculates entropy similarity between two spectra
#'
#' @export
#'
#' @importFrom msentropy calculate_entropy_similarity
#' @importFrom tidytable tidytable
#'
#' @noRd
#'
#' @param index Index of the first spectrum
#' @param target Index of the second spectrum
#' @param frags List of fragments
Expand Down
4 changes: 1 addition & 3 deletions R/clean_bio.R
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,6 @@ import::from(tidytable, where, .into = environment())
#' @description This function cleans the results
#' obtained after biological weighting
#'
#' @export
#'
#' @importFrom stats setNames
#' @importFrom tidytable across
#' @importFrom tidytable add_count
Expand All @@ -45,7 +43,7 @@ import::from(tidytable, where, .into = environment())
#' @importFrom tidytable ungroup
#' @importFrom tidytable where
#'
#' @noRd
#' @include log_pipe.R
#'
#' @param annot_table_wei_bio Table containing your
#' biologically weighted annotation
Expand Down
5 changes: 1 addition & 4 deletions R/clean_chemo.R
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,6 @@ import::from(tidytable, where, .into = environment())
#' @description This function cleans the results
#' obtained after chemical weighting
#'
#' @export
#'
#' @importFrom tidytable across
#' @importFrom tidytable any_of
#' @importFrom tidytable arrange
Expand All @@ -48,8 +46,7 @@ import::from(tidytable, where, .into = environment())
#' @include clean_collapse.R
#' @include columns_model.R
#' @include filter_high_confidence_only.R
#'
#' @noRd
#' @include log_pipe.R
#'
#' @param annot_table_wei_chemo Table containing your
#' chemically weighted annotation
Expand Down
4 changes: 0 additions & 4 deletions R/clean_collapse.R
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@ import::from(tidytable, where, .into = environment())
#'
#' @description This function collapses a grouped dataframe and trims it
#'
#' @export
#'
#' @importFrom tidytable across
#' @importFrom tidytable everything
#' @importFrom tidytable mutate
Expand All @@ -20,8 +18,6 @@ import::from(tidytable, where, .into = environment())
#' @importFrom tidytable ungroup
#' @importFrom tidytable where
#'
#' @noRd
#'
#' @param grouped_df Grouped dataframe
#' @param cols Column(s) to apply collapse to
#'
Expand Down
4 changes: 0 additions & 4 deletions R/columns_model.R
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,6 @@
#'
#' @description This function models columns
#'
#' @export
#'
#' @noRd
#'
#' @return The columns model
#'
#' @examples NULL
Expand Down
4 changes: 0 additions & 4 deletions R/complement_metadata_structures.R
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,6 @@ import::from(tidytable, where, .into = environment())
#'
#' @include clean_collapse.R
#'
#' @noRd
#'
#' @param df Data frame with structural metadata to be complemented
#' @param str_stereo File containing structures stereo
#' @param str_met File containing structures metadata
Expand All @@ -37,8 +35,6 @@ import::from(tidytable, where, .into = environment())
#'
#' @return Data frame with complemented structural metadata
#'
#' @export
#'
#' @examples NULL
complement_metadata_structures <- function(df,
str_stereo = get("str_stereo", envir = parent.frame()),
Expand Down
4 changes: 0 additions & 4 deletions R/copy_backbone.R
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,10 @@ import::from(fs, path_home, .into = environment())
#'
#' @description This function copies backbone
#'
#' @export
#'
#' @importFrom fs dir_copy
#' @importFrom fs dir_create
#' @importFrom fs path_home
#'
#' @noRd
#'
#' @param cache_dir Cache directory
#' @param package Package
#' @param copy_dir Copy directory
Expand Down
4 changes: 0 additions & 4 deletions R/create_edges.R
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,10 @@ import::from(tidytable, bind_rows, .into = environment())
#' @description This function applies similarity calculation to a list of
#' spectra to create edges
#'
#' @export
#'
#' @importFrom tidytable bind_rows
#'
#' @include calculate_entropy.R
#'
#' @noRd
#'
#' @param index Indices
#' @param frags Fragments
#' @param precs Precursors
Expand Down
7 changes: 6 additions & 1 deletion R/create_edges_spectra.R
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,12 @@ import::from(tidytable, tidytable, .into = environment())
#'
#' @export
#'
#' @examples NULL
#' @examples
#' get_file(
#' url = get_default_paths()$urls$examples$spectra_mini,
#' export = get_params(step = "create_edges_spectra")$files$spectral$raw
#' )
#' create_edges_spectra()
create_edges_spectra <- function(input = get_params(step = "create_edges_spectra")$files$spectral$raw,
output = get_params(step = "create_edges_spectra")$files$networks$spectral$edges$raw,
name_source = get_params(step = "create_edges_spectra")$names$source,
Expand Down
4 changes: 0 additions & 4 deletions R/decorate_bio.R
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@ import::from(tidytable, filter, .into = environment())
#'
#' @description This function outputs information about biological weighting
#'
#' @export
#'
#' @importFrom crayon blue
#' @importFrom crayon cyan
#' @importFrom crayon green
Expand All @@ -26,8 +24,6 @@ import::from(tidytable, filter, .into = environment())
#' @importFrom tidytable distinct
#' @importFrom tidytable filter
#'
#' @noRd
#'
#' @param annot_table_wei_bio Table to decorate
#' @param score_biological_kingdom Kingdom score
#' @param score_biological_phylum Phylum score
Expand Down
4 changes: 0 additions & 4 deletions R/decorate_chemo.R
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@ import::from(tidytable, filter, .into = environment())
#'
#' @description This function outputs information about chemical weighting
#'
#' @export
#'
#' @importFrom crayon blue
#' @importFrom crayon cyan
#' @importFrom crayon green
Expand All @@ -24,8 +22,6 @@ import::from(tidytable, filter, .into = environment())
#' @importFrom tidytable distinct
#' @importFrom tidytable filter
#'
#' @noRd
#'
#' @param annot_table_wei_chemo Table to decorate
#' @param score_chemical_cla_kingdom Classyfire kingdom score
#' @param score_chemical_cla_superclass Classyfire superclass score
Expand Down
4 changes: 0 additions & 4 deletions R/decorate_masses.R
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,11 @@ import::from(tidytable, filter, .into = environment())
#'
#' @description This function outputs information about MS1 annotation
#'
#' @export
#'
#' @importFrom crayon blue
#' @importFrom crayon green
#' @importFrom tidytable distinct
#' @importFrom tidytable filter
#'
#' @noRd
#'
#' @param annotation_table_ms1 Table to decorate
#'
#' @return Message indicating the number of annotations obtained by MS1
Expand Down
8 changes: 0 additions & 8 deletions R/dist_groups.R
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,8 @@ import::from(stats, as.dist, .into = environment())
#'
#' @details Credit goes to usedist package
#'
#' @export
#'
#' @importFrom stats as.dist
#'
#' @noRd
#'
#' @param d Distance matrix
#' @param idx1 Index of the first element
#' @param idx2 Index of the second element
Expand Down Expand Up @@ -43,13 +39,9 @@ import::from(utils, combn, .into = environment())
#'
#' @description This function gets distances per group
#'
#' @export
#'
#' @importFrom stats as.dist
#' @importFrom utils combn
#'
#' @noRd
#'
#' @param d A distance object
#' @param g A grouping vector for the distance object
#'
Expand Down
4 changes: 0 additions & 4 deletions R/export_params.R
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,11 @@ import::from(yaml, write_yaml, .into = environment())
#' @description This function writes the parameters
#' to a YAML file in the specified directory.
#'
#' @export
#'
#' @importFrom crayon green
#' @importFrom yaml write_yaml
#'
#' @include get_default_paths.R
#'
#' @noRd
#'
#' @param parameters list of parameters to be exported
#' @param directory directory where the YAML file will be saved
#' @param step step identifier to be included in the YAML file name
Expand Down
2 changes: 0 additions & 2 deletions R/export_spectra_rds.R
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@ import::from(tidytable, filter, .into = environment())
#'
#' @return NULL
#'
#' @export
#'
#' @examples NULL
export_spectra_rds <- function(file, spectra) {
if (nrow(spectra |>
Expand Down
2 changes: 0 additions & 2 deletions R/extract_spectra.R
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,6 @@ import::from(tidytable, select, .into = environment())
#'
#' @return Data frame containing spectra data
#'
#' @export
#'
#' @examples NULL
extract_spectra <- function(object) {
## issues
Expand Down
4 changes: 0 additions & 4 deletions R/fake_annotations_columns.R
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,6 @@
#'
#' @description This function fakes annotations columns
#'
#' @export
#'
#' @noRd
#'
#' @return NULL
#'
#' @examples NULL
Expand Down
Loading

0 comments on commit 11bb718

Please sign in to comment.