Skip to content

Commit

Permalink
fix issue 12
Browse files Browse the repository at this point in the history
  • Loading branch information
pablovgd committed Oct 1, 2024
1 parent 3728dd4 commit 650afbc
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 8 deletions.
1 change: 1 addition & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ importFrom(Spectra,filterDataOrigin)
importFrom(Spectra,filterEmptySpectra)
importFrom(Spectra,filterMzRange)
importFrom(Spectra,filterRt)
importFrom(Spectra,isEmpty)
importFrom(dplyr,first)
importFrom(dplyr,group_by)
importFrom(dplyr,select)
Expand Down
5 changes: 3 additions & 2 deletions R/checkScans.R
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
#' Check if any samples are missing spectra
#'
#' @param spectra `Spectra` object
#' @param spectra `Spectra` object
#'
#' @importFrom ProtGenerics dataOrigin
#' @importFrom Spectra isEmpty
#' @return
#' @export
#'
Expand All @@ -16,4 +17,4 @@ checkScans <- function(spectra){
stop(paste("File",names,"contains less than 50% of the mean of scans
in the samples."))
}
}
}
12 changes: 6 additions & 6 deletions R/peaks_with_tardis.R
Original file line number Diff line number Diff line change
Expand Up @@ -892,42 +892,42 @@ tardis_peaks <-

results <- results_samples

if(is.null(max_int_filter) == FALSE ){
if(is.null(max_int_filter) == FALSE && max_int_filter != 0){
results <- results[which(results$MaxInt >= max_int_filter),]
}

#AUC, int, SNR & peakcor tables for each component peak in every sample

auc_table <- results %>%
select(Component, Sample, AUC) %>%
spread(Sample, AUC)
spread(Sample, AUC, fill = NA, drop = FALSE)

write.csv(auc_table, file = paste0(output_directory, "auc_table.csv"))


pop_table <- results %>%
select(Component, Sample, pop) %>%
spread(Sample, pop)
spread(Sample, pop, fill = NA, drop = FALSE)

write.csv(pop_table, file = paste0(output_directory, "pop_table.csv"))


SNR_table <- results %>%
select(Component, Sample, SNR) %>%
spread(Sample, SNR)
spread(Sample, SNR, fill = NA, drop = FALSE)

write.csv(SNR_table, file = paste0(output_directory, "snr_table.csv"))

int_table <- results %>%
select(Component, Sample, MaxInt) %>%
spread(Sample, MaxInt)
spread(Sample, MaxInt, fill = NA, drop = FALSE)

write.csv(int_table, file = paste0(output_directory, "int_table.csv"))


peakcor_table <- results %>%
select(Component, Sample, peak_cor) %>%
spread(Sample, peak_cor)
spread(Sample, peak_cor, fill = NA, drop = FALSE)

write.csv(peakcor_table, file = paste0(output_directory, "peakcor_table.csv"))

Expand Down

0 comments on commit 650afbc

Please sign in to comment.