diff --git a/tools/recetox_aplcms/parse_parameters.sh b/tools/recetox_aplcms/parse_parameters.sh new file mode 100644 index 00000000..e1cd4534 --- /dev/null +++ b/tools/recetox_aplcms/parse_parameters.sh @@ -0,0 +1,23 @@ +#!/bin/bash +# Check if the correct number of arguments is provided +if [ "$#" -ne 1 ]; then + echo "Usage: $0 input.csv" + exit 1 +fi + +input_file="$1" +header=$(head -n 1 "$input_file") +num_columns=$(echo "$header" | awk -F, '{print NF}') + +# Create a directory to store the output files +output_dir="split_columns" +mkdir -p "$output_dir" + +# Split the CSV file into one file per column +for ((i=1; i<= num_columns; i++)); do + column_name=$(echo "$header" | cut -d, -f$i) + output_file="$output_dir/${column_name}.txt" + tail -n +2 "$input_file" | cut -d, -f$i > "$output_file" +done + +echo "Columns have been split into separate files in the '$output_dir' directory." \ No newline at end of file diff --git a/tools/recetox_aplcms/recetox_aplcms_parse_parameters.xml b/tools/recetox_aplcms/recetox_aplcms_parse_parameters.xml new file mode 100644 index 00000000..67afc17d --- /dev/null +++ b/tools/recetox_aplcms/recetox_aplcms_parse_parameters.xml @@ -0,0 +1,185 @@ + + tool to parse parameters from a csv row for parameter searches, to be used in workflows only. + + + 0.1.0 + 0 + + + + operation_1812 + + + + topic_3316 + topic_3071 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/tools/recetox_aplcms/test-data/parse_parameters/test.csv b/tools/recetox_aplcms/test-data/parse_parameters/test.csv new file mode 100644 index 00000000..3536c620 --- /dev/null +++ b/tools/recetox_aplcms/test-data/parse_parameters/test.csv @@ -0,0 +1,2 @@ +min_run,sigma_lower,sigma_higher,min_sd,max_sd,mz_tol,weighting,min_pres,group_threshold +3.1,0.5,1.5,0.1,0.9,0.01,true,0.8,0.7