Mercurial > repos > recetox > recetox_aplcms_align_features
comparison recetox_aplcms_align_features.xml @ 2:abe783e0daca draft
planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/recetox_aplcms commit 506df2aef355b3791567283e1a175914f06b405a
author | recetox |
---|---|
date | Mon, 13 Feb 2023 10:26:59 +0000 |
parents | b07fd3d7ffd0 |
children | 1e2a13bcb5a7 |
comparison
equal
deleted
inserted
replaced
1:b07fd3d7ffd0 | 2:abe783e0daca |
---|---|
1 <tool id="recetox_aplcms_align_features" name="RECETOX apLCMS - align features" version="@TOOL_VERSION@+galaxy1"> | 1 <tool id="recetox_aplcms_align_features" name="recetox-aplcms - align features" version="@TOOL_VERSION@+galaxy0"> |
2 <description>align features from LC/MS spectra across samples</description> | 2 <description>align peaks across samples</description> |
3 <macros> | 3 <macros> |
4 <import>macros.xml</import> | 4 <import>macros.xml</import> |
5 <import>macros_split.xml</import> | 5 <import>help.xml</import> |
6 </macros> | 6 </macros> |
7 <expand macro="creator"/> | 7 <expand macro="creator"/> |
8 <expand macro="requirements"/> | |
8 | 9 |
9 <expand macro="requirements"/> | |
10 <command detect_errors="aggressive"><![CDATA[ | 10 <command detect_errors="aggressive"><![CDATA[ |
11 sh ${symlink_inputs} && | |
12 Rscript -e 'source("${__tool_directory__}/utils.R")' -e 'source("${run_script}")' | 11 Rscript -e 'source("${__tool_directory__}/utils.R")' -e 'source("${run_script}")' |
13 ]]></command> | 12 ]]></command> |
14 <configfiles> | 13 <configfiles> |
15 <configfile name="symlink_inputs"> | |
16 #for $infile in $ms_files | |
17 ln -s '${infile}' '${infile.element_identifier}' | |
18 #end for | |
19 #for $infile in $corrected_files | |
20 ln -s '${infile}' '${infile.element_identifier}' | |
21 #end for | |
22 </configfile> | |
23 <configfile name="run_script"><![CDATA[ | 14 <configfile name="run_script"><![CDATA[ |
24 #set filenames_str = str("', '").join([str($f.element_identifier) for $f in $ms_files]) | 15 #set filenames = str("', '").join([str($f) for $f in $files]) |
25 files_list <- sort_samples_by_acquisition_number(c('$filenames_str')) | 16 feature_tables <- load_parquet_collection(c('$filenames')) |
26 sample_names <- get_sample_name(files_list) | 17 sample_names <- unlist(lapply(feature_tables, load_sample_name)) |
27 | 18 |
28 #set corrected_files = str("', '").join([str($f.element_identifier) for $f in $corrected_files]) | 19 validate_sample_names(sample_names) |
29 corrected_features <- load_features(c('$corrected_files')) | |
30 | 20 |
31 aligned <- align_features( | 21 ordering <- order(sample_names) |
32 sample_names = sample_names, | 22 feature_tables <- feature_tables[ordering] |
33 features = corrected_features, | 23 sample_names <- sample_names[ordering] |
34 min.exp = $min_exp, | |
35 mz.tol = $peak_alignment.align_mz_tol, | |
36 chr.tol = $peak_alignment.align_chr_tol, | |
37 find.tol.max.d = 10 * $mz_tol, | |
38 max.align.mz.diff = $peak_alignment.max_align_mz_diff, | |
39 do.plot = FALSE | |
40 ) | |
41 | 24 |
42 save_aligned_features(aligned, "$rt_cross_table", "$int_cross_table", "$tolerances") | 25 tolerances <- load_data_from_parquet_file('$input_tolerances') |
26 | |
27 aligned_features <- create_aligned_feature_table( | |
28 features_table = dplyr::bind_rows(feature_tables), | |
29 min_occurrence = $min_occurrence, | |
30 sample_names = sample_names, | |
31 mz_tol_relative = get_mz_tol(tolerances), | |
32 rt_tol_relative = get_rt_tol(tolerances) | |
33 ) | |
34 | |
35 save_aligned_features(aligned_features, '$metadata_file', '$rt_file', '$intensity_file') | |
43 ]]></configfile> | 36 ]]></configfile> |
44 </configfiles> | 37 </configfiles> |
45 | 38 |
46 <inputs> | 39 <inputs> |
47 <param name="ms_files" type="data_collection" collection_type="list" format="mzdata,mzml,mzxml,netcdf" | 40 <param name="files" type="data_collection" collection_type="list" format="parquet" |
48 label="Input data collection" help="Mass spectrometry file for peak extraction." /> | 41 label="Clustered features" help="List of tables containing clustered features." /> |
49 <param name="corrected_files" type="data_collection" collection_type="list" format="parquet" | 42 <param label="Input tolerances values" name="input_tolerances" type="data" format="parquet" |
50 label="Input corrected feature samples collection" | 43 help="Table containing tolerance values." /> |
51 help="Mass spectrometry files containing corrected feature samples." /> | 44 <param name="min_occurrence" type="integer" min="2" value="2" label="min_occurrence" |
52 <expand macro="mz_tol_macro"/> | 45 help="A feature has to show up in at least this number of profiles to be included in the final result." /> |
53 <param name="min_exp" type="integer" min="1" value="2" label="min_exp" | |
54 help="If a feature is to be included in the final feature table, it must be present in at least this number of spectra." /> | |
55 <expand macro="peak_alignment"/> | |
56 </inputs> | 46 </inputs> |
57 | 47 |
58 <outputs> | 48 <outputs> |
59 <data name="tolerances" format="parquet" label="${tool.name} on ${on_string} (tolerances)" /> | 49 <data name="metadata_file" format="parquet" label="${tool.name} on ${on_string} (metadata table)"/> |
60 <data name="rt_cross_table" format="parquet" label="${tool.name} on ${on_string} (rt cross table)" /> | 50 <data name="rt_file" format="parquet" label="${tool.name} on ${on_string} (rt table)"/> |
61 <data name="int_cross_table" format="parquet" label="${tool.name} on ${on_string} (int cross table)" /> | 51 <data name="intensity_file" format="parquet" label="${tool.name} on ${on_string} (intensity table)"/> |
62 </outputs> | 52 </outputs> |
63 | 53 |
64 <tests> | 54 <tests> |
65 <test> | 55 |
66 <param name="ms_files"> | |
67 <collection type="list"> | |
68 <element name="mbr_test0.mzml" value="mbr_test0.mzml"/> | |
69 <element name="mbr_test1.mzml" value="mbr_test1.mzml"/> | |
70 <element name="mbr_test2.mzml" value="mbr_test2.mzml"/> | |
71 </collection> | |
72 </param> | |
73 <param name="corrected_files"> | |
74 <collection type="list"> | |
75 <element name="corrected_features_0.parquet" value="corrected_expected/corrected_0.parquet"/> | |
76 <element name="corrected_features_1.parquet" value="corrected_expected/corrected_1.parquet"/> | |
77 <element name="corrected_features_2.parquet" value="corrected_expected/corrected_2.parquet"/> | |
78 </collection> | |
79 </param> | |
80 <output name="tolerances" file="tolerances.parquet" ftype="parquet"/> | |
81 <output name="rt_cross_table" file="rt_cross_table.parquet" ftype="parquet"/> | |
82 <output name="int_cross_table" file="int_cross_table.parquet" ftype="parquet"/> | |
83 </test> | |
84 </tests> | 56 </tests> |
85 | 57 |
86 <help> | 58 <help> |
87 <![CDATA[ | 59 <![CDATA[ |
88 This is a tool which runs apLCMS alignment of features. | 60 @ALIGN_FEATURES_HELP@ |
89 | 61 |
90 @GENERAL_HELP@ | 62 @GENERAL_HELP@ |
91 ]]> | 63 ]]> |
92 </help> | 64 </help> |
93 | 65 |