changeset 2:a1439454fe7f draft

"planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/aplcms commit ef35fcaaee8f8ae4aa72f3bc0f47dc20e0e70116"
author recetox
date Mon, 19 Apr 2021 12:27:32 +0000
parents 87f5cf0baf34
children 2877bbac4c82
files aplcms_hybrid.xml aplcms_macros.xml
diffstat 2 files changed, 43 insertions(+), 37 deletions(-) [+]
line wrap: on
line diff
--- a/aplcms_hybrid.xml	Tue Jan 26 17:11:11 2021 +0000
+++ b/aplcms_hybrid.xml	Mon Apr 19 12:27:32 2021 +0000
@@ -1,4 +1,4 @@
-<tool id="aplcms_hybrid" name="apLCMS - Hybrid" version="@TOOL_VERSION@+galaxy2">
+<tool id="aplcms_hybrid" name="apLCMS - Hybrid" version="@TOOL_VERSION@+galaxy3">
     <macros>
         <import>aplcms_macros.xml</import>
     </macros>
@@ -6,42 +6,48 @@
     <expand macro="requirements" />
 
     <command detect_errors="aggressive"><![CDATA[
-        #set file_str = str("', '").join([str($f) for $f in $files])
+        Rscript ${run_script}
+    ]]></command>
+
+    <configfiles>
+        <configfile name="run_script"><![CDATA[
+            #set file_str = str("', '").join([str($f) for $f in $files])
 
-        Rscript
-            -e "x <- apLCMS::hybrid(
-                    files = c('$file_str'),
-                    known_table = apLCMS::load_known_table_from_hdf('$known_table'),
-                    min_exp = $noise_filtering.min_exp,
-                    min_pres = $noise_filtering.min_pres,
-                    min_run = $noise_filtering.min_run,
-                    mz_tol = $noise_filtering.mz_tol,
-                    baseline_correct = $noise_filtering.baseline_correct,
-                    baseline_correct_noise_percentile = $noise_filtering.baseline_correct_noise_percentile,
-                    intensity_weighted = $noise_filtering.intensity_weighted,
-                    shape_model = '$feature_detection.shape_model',
-                    BIC_factor = $feature_detection.BIC_factor,
-                    peak_estim_method = '$feature_detection.peak_estim_method',
-                    min_bandwidth = $feature_detection.min_bandwidth,
-                    max_bandwidth = $feature_detection.max_bandwidth,
-                    sd_cut = c($feature_detection.sd_cut_min, $feature_detection.sd_cut_max),
-                    sigma_ratio_lim = c($feature_detection.sigma_ratio_lim_min, $feature_detection.sigma_ratio_lim_max),
-                    component_eliminate = $feature_detection.component_eliminate,
-                    moment_power = $feature_detection.moment_power,
-                    align_chr_tol = $peak_alignment.align_chr_tol,
-                    align_mz_tol = $peak_alignment.align_mz_tol,
-                    max_align_mz_diff = $peak_alignment.max_align_mz_diff,
-                    match_tol_ppm = $history_db.match_tol_ppm,
-                    new_feature_min_count = $history_db.new_feature_min_count,
-                    recover_mz_range = $weak_signal_recovery.recover_mz_range,
-                    recover_chr_range = $weak_signal_recovery.recover_chr_range,
-                    use_observed_range = $weak_signal_recovery.use_observed_range,
-                    recover_min_count = $weak_signal_recovery.recover_min_count,
-                    cluster = as.integer(\${GALAXY_SLOTS:-1})
-                )"
-            -e "apLCMS::save_peaks_to_hdf('$peaks', x)"
-            -e "apLCMS::save_known_table_to_hdf('$updated_known_table', x\\$updated_known_table)" ## NOTE the double \\ because we want cheetah and bash to ignore the $ character
-    ]]></command>
+            x <- apLCMS::hybrid(
+                files = c('$file_str'),
+                known_table = apLCMS::load_known_table_from_hdf('$known_table'),
+                min_exp = $noise_filtering.min_exp,
+                min_pres = $noise_filtering.min_pres,
+                min_run = $noise_filtering.min_run,
+                mz_tol = $noise_filtering.mz_tol,
+                baseline_correct = $noise_filtering.baseline_correct,
+                baseline_correct_noise_percentile = $noise_filtering.baseline_correct_noise_percentile,
+                intensity_weighted = $noise_filtering.intensity_weighted,
+                shape_model = '$feature_detection.shape_model',
+                BIC_factor = $feature_detection.BIC_factor,
+                peak_estim_method = '$feature_detection.peak_estim_method',
+                min_bandwidth = $feature_detection.min_bandwidth,
+                max_bandwidth = $feature_detection.max_bandwidth,
+                sd_cut = c($feature_detection.sd_cut_min, $feature_detection.sd_cut_max),
+                sigma_ratio_lim = c($feature_detection.sigma_ratio_lim_min, $feature_detection.sigma_ratio_lim_max),
+                component_eliminate = $feature_detection.component_eliminate,
+                moment_power = $feature_detection.moment_power,
+                align_chr_tol = $peak_alignment.align_chr_tol,
+                align_mz_tol = $peak_alignment.align_mz_tol,
+                max_align_mz_diff = $peak_alignment.max_align_mz_diff,
+                match_tol_ppm = $history_db.match_tol_ppm,
+                new_feature_min_count = $history_db.new_feature_min_count,
+                recover_mz_range = $weak_signal_recovery.recover_mz_range,
+                recover_chr_range = $weak_signal_recovery.recover_chr_range,
+                use_observed_range = $weak_signal_recovery.use_observed_range,
+                recover_min_count = $weak_signal_recovery.recover_min_count,
+                cluster = as.integer(Sys.getenv('GALAXY_SLOTS', unset = 1))
+            )
+
+            apLCMS::save_peaks_to_hdf('$peaks', x)
+            apLCMS::save_known_table_to_hdf('$updated_known_table', x\$updated_known_table) ## NOTE the \ because we want cheetah to ignore the $ character
+        ]]></configfile>
+    </configfiles>
 
     <expand macro="inputs">
         <expand macro="history_db" />
--- a/aplcms_macros.xml	Tue Jan 26 17:11:11 2021 +0000
+++ b/aplcms_macros.xml	Mon Apr 19 12:27:32 2021 +0000
@@ -131,7 +131,7 @@
         tolerance levels are estimated from the data. A run-filter is used to detect peaks and remove noise.
         Non-parametric statistical methods are used to find-tune peak selection and grouping. After retention time
         correction, a feature table is generated by aligning peaks across spectra. For further information on apLCMS
-        please refer to http://web1.sph.emory.edu/apLCMS.
+        please refer to https://mypage.cuhk.edu.cn/academics/yutianwei/apLCMS/.
     </token>
 
     <xml name="citations">