Skip to content

Commit

Permalink
sorted files
Browse files Browse the repository at this point in the history
  • Loading branch information
wverastegui committed Oct 27, 2023
1 parent ac70bfd commit cf3ed09
Show file tree
Hide file tree
Showing 15 changed files with 251,070 additions and 216,551 deletions.
39 changes: 15 additions & 24 deletions analysis/R_scripts/match_spectra.R
Original file line number Diff line number Diff line change
Expand Up @@ -33,31 +33,22 @@ match_spectra <- function(reference_file, simulated_file, output_file, ppm = 5)
write.table(matched_spectra_df, file = paste(output_file,"filterNA",sep = '_'), sep = "\t", quote = FALSE, row.names = FALSE)
}

base_path <- 'analysis/data'
# matching for all peaks
reference_file_all_peaks <- file.path('analysis/data/experimental/RECETOX_GC-EI_MS_20201028.msp')
simulated_file_all_peaks <- file.path('analysis/data/filtered/simulated_matchms_filter_1%I_all_peaks.msp')

reference_file <- file.path(base_path, 'experimental/RECETOX_GC-EI_MS_20201028_matchms_filter_top5.msp')
simulated_file <- file.path(base_path, 'filtered/1%/Galaxy29-[matchms_filtering_on_data_27]_1%_tp5.msp')
match_spectra(
reference_file,
simulated_file,
file.path(base_path, 'outputs/matchspectra_R/metaboannotation_top5.tsv')
reference_file_all_peaks,
simulated_file_all_peaks,
file.path('analysis/data/output_matching/metaboannotation/metaboannotation_NA_to_zeros_all_peaks.tsv')
)

# match_spectra(
# file.path(base_path, "experimental/RECETOX_GC-EI_MS_20201028_norm_matchms.msp"),
# file.path(base_path, 'filtered/matchms_filtering_default_filter_1%_all_peaks.msp'),
# file.path(base_path, 'outputs/matchspectra_R/match_1%/metaboannotation_all_peaks_zeros_temp.tsv')
# )

# reference_file <- file.path(base_path, "experimental/problematic_spectra.msp")
# simulated_file <- file.path(base_path, 'filtered/problematic_predicted.msp')
# match_spectra(
# reference_file,
# query_file,
# file.path(base_path, 'outputs/matchspectra_R/problematic_scores.tsv')
# )
# match_spectra(
# file.path(base_path, "experimental/RECETOX_GC-EI_MS_20201028.msp"),
# file.path(base_path, 'filtered/matchms_filtering_default_filter_1%_all_peaks.msp'),
# file.path(base_path, 'outputs/matchspectra_R/match_1%/matchSpectra_results_source_1%_all_peaks.tsv')
# )
# matching for top5 peaks. query and reference were filtered to top5 peaks.
reference_file_top5 <- file.path('analysis/data/experimental/RECETOX_GC-EI_MS_20201028_matchms_filter_top5.msp')
simulated_file_top5 <- file.path('analysis/data/filtered/simulated_matchms_filter_1%I_top5.msp')

match_spectra(
reference_file_top5,
simulated_file_top5,
file.path('analysis/data/output_matching/metaboannotation/metaboannotation_NA_to_zeros_top5.tsv')
)
3,219 changes: 3,219 additions & 0 deletions analysis/data/output_matching/matchms/matchms_tol_0.01_1%I_top5.tsv

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

This file was deleted.

This file was deleted.

124,842 changes: 0 additions & 124,842 deletions analysis/data/outputs/matchspectra_R/match_1%/matchms_top5_comparison_with_zeros.tsv

This file was deleted.

28,133 changes: 0 additions & 28,133 deletions analysis/data/outputs/matchspectra_R/match_1%/metaboannotation_all_peaks_zeros.tsv

This file was deleted.

This file was deleted.

22 changes: 22 additions & 0 deletions codes/ls_lima_formatter.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#!/bin/sh

# Check if the filename argument is provided
if [ -z "$1" ]; then
echo "Usage: $0 <filename>"
exit 1
fi

# Replace multiple spaces with a single space
sed -E "s,[[:space:]]+, ,g" "$1" > "$1.tmp"

# Remove lines containing 'IONMODE' and 'CHARGE'
grep -v 'IONMODE\|CHARGE' "$1.tmp" > "$1.tmp1"

# Replace 'COMPOUND_NAME' with 'NAME'
sed 's/COMPOUND_NAME/NAME/g' "$1.tmp1" > "$1.tmp2"

# Move the final file to the original filename
mv "$1.tmp2" "$1"

# Remove temporary files
rm -f "$1.tmp" "$1.tmp1"

0 comments on commit cf3ed09

Please sign in to comment.