Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion DIMS/CollectFilled.R
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ for (scanmode in scanmodes) {
repl_pattern <- get(load(pattern_file))
# calculate Z-scores
if (z_score == 1) {
outlist_stats <- calculate_zscores(outlist_total, adducts = FALSE)
outlist_stats <- calculate_zscores(outlist_total)
nr_removed_samples <- length(which(repl_pattern[] == "character(0)"))
order_index_int <- order(colnames(outlist_stats)[8:(length(repl_pattern) - nr_removed_samples + 7)])
outlist_stats_more <- cbind(
Expand Down
30 changes: 6 additions & 24 deletions DIMS/EvaluateTics.R
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@ highest_mz_file <- cmd_args[5]
highest_mz <- get(load(highest_mz_file))
trim_params_filepath <- cmd_args[6]
thresh2remove <- 1000000000
preprocessing_scripts_dir <- cmd_args[7]

# load functions
source(paste0(preprocessing_scripts_dir, "evaluate_tics_functions.R"))

# load init_file: contains repl_pattern
load(init_file)
Expand Down Expand Up @@ -41,35 +45,11 @@ remove_neg <- remove_tech_reps$neg
repl_pattern_filtered <- remove_from_repl_pattern(remove_neg, repl_pattern, nr_replicates)
save(repl_pattern_filtered, file = "negative_repl_pattern.RData")

# write output for QC info on missed infusions
if (is.null(remove_neg)) {
remove_neg <- "none"
}
write.table(
remove_neg,
file = "miss_infusions_negative.txt",
row.names = FALSE,
col.names = FALSE,
sep = "\t"
)

# positive scan mode
remove_pos <- remove_tech_reps$pos
repl_pattern_filtered <- remove_from_repl_pattern(remove_pos, repl_pattern, nr_replicates)
save(repl_pattern_filtered, file = "positive_repl_pattern.RData")

# write output for QC info on missed infusions
if (is.null(remove_pos)) {
remove_pos <- "none"
}
write.table(
remove_pos,
file = "miss_infusions_positive.txt",
row.names = FALSE,
col.names = FALSE,
sep = "\t"
)

# get an overview of suitable technical replicates for both scan modes
allsamples_techreps_neg <- get_overview_tech_reps(repl_pattern_filtered, "negative")
allsamples_techreps_pos <- get_overview_tech_reps(repl_pattern_filtered, "positive")
Expand All @@ -81,6 +61,7 @@ write.table(allsamples_techreps_both_scanmodes,
sep = ","
)


## generate TIC plots
# get all txt files
tic_files <- list.files("./", full.names = TRUE, pattern = "*TIC.txt")
Expand Down Expand Up @@ -158,3 +139,4 @@ tic_plot_pdf <- marrangeGrob(
ggsave(filename = paste0(run_name, "_TICplots.pdf"),
tic_plot_pdf, width = 21, height = 29.7, units = "cm")


3 changes: 2 additions & 1 deletion DIMS/EvaluateTics.nf
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@ process EvaluateTics {
$analysis_id \
$params.matrix \
$highest_mz_file \
$trim_params_file
$trim_params_file \
$params.preprocessing_scripts_dir
"""
}

Expand Down
61 changes: 0 additions & 61 deletions DIMS/SpectrumPeakFinding.R

This file was deleted.

18 changes: 0 additions & 18 deletions DIMS/SpectrumPeakFinding.nf

This file was deleted.

2 changes: 1 addition & 1 deletion DIMS/preprocessing/peak_finding_functions.R
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ search_regions_of_interest <- function(ints_fullrange) {

# sort on first index
if (nrow(regions_of_interest_final) > 1){
regions_of_interest_sorted <- regions_of_interest_final %>% dplyr::arrange(from)
regions_of_interest_sorted <- regions_of_interest_final %>% as.data.frame %>% dplyr::arrange(from)
} else {
regions_of_interest_sorted <- regions_of_interest_final
}
Expand Down
Loading