Skip to content

Commit

Permalink
benchmark update
Browse files Browse the repository at this point in the history
  • Loading branch information
Adafede committed Jul 23, 2023
1 parent bbacd8a commit 00ad552
Show file tree
Hide file tree
Showing 3 changed files with 233 additions and 105 deletions.
17 changes: 11 additions & 6 deletions R/sanitize_spectra_benchmark.R
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,6 @@ sanitize_spectra_benchmark <-
meta_neg_path = "data/interim/benchmark/benchmark_meta_neg.tsv") {
sp$precursorMz <- as.numeric(sp$PRECURSOR_MZ)
sp$precursorCharge <- as.integer(sp$CHARGE)
sp$acquisitionNum <- as.integer(sp$SCANS)
sp$scanIndex <- as.integer(sp$SCANS)

sp_clean <- sp |>
Spectra::addProcessing(remove_above_precursor(),
Expand Down Expand Up @@ -114,8 +112,8 @@ sanitize_spectra_benchmark <-
sp_neg <- sp_clean[sp_clean$SPECTRUMID %in% df_clean_neg$ccmslib]
sp_pos$feature_id <- df_clean_pos$feature_id
sp_neg$feature_id <- df_clean_neg$feature_id
sp_pos$SCANS <- df_clean_pos$feature_id
sp_neg$SCANS <- df_clean_neg$feature_id
sp_pos$spectrum_id <- df_clean_pos$feature_id
sp_neg$spectrum_id <- df_clean_neg$feature_id

spectra_harmonized_pos <- sp_pos |>
extract_spectra() |>
Expand All @@ -134,7 +132,7 @@ sanitize_spectra_benchmark <-
col_po = "polarity",
col_sm = "smiles",
col_sn = NA,
col_si = "SPECTRUMID",
col_si = "spectrum_id",
col_sp = NA,
col_sy = NA,
col_xl = NA,
Expand All @@ -158,13 +156,20 @@ sanitize_spectra_benchmark <-
col_po = "polarity",
col_sm = "smiles",
col_sn = NA,
col_si = "SPECTRUMID",
col_si = "spectrum_id",
col_sp = NA,
col_sy = NA,
col_xl = NA,
mode = "neg"
)

spectra_harmonized_pos$acquisitionNum <-
spectra_harmonized_pos$spectrum_id |>
as.integer()
spectra_harmonized_neg$acquisitionNum <-
spectra_harmonized_neg$spectrum_id |>
as.integer()

log_debug("Exporting")
spectra_harmonized_pos |>
Spectra::Spectra() |>
Expand Down
12 changes: 10 additions & 2 deletions R/taxize_spectra_benchmark.R
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,16 @@ taxize_spectra_benchmark <-
)) |>
tidytable::select(
feature_id,
contains("organism_taxonomy_"),
-contains("ott")
sample_organism_01_domain = organism_taxonomy_01domain,
sample_organism_02_kingdom = organism_taxonomy_02kingdom,
sample_organism_03_phylum = organism_taxonomy_03phylum,
sample_organism_04_class = organism_taxonomy_04class,
sample_organism_05_order = organism_taxonomy_05order,
sample_organism_06_family = organism_taxonomy_06family,
sample_organism_07_tribe = organism_taxonomy_07tribe,
sample_organism_08_genus = organism_taxonomy_08genus,
sample_organism_09_species = organism_taxonomy_09species,
sample_organism_10_varietas = organism_taxonomy_10varietas
)

export_output(x = features_taxed, file = output)
Expand Down
Loading

0 comments on commit 00ad552

Please sign in to comment.