diff main.R @ 2:10093dea9b3f draft default tip

planemo upload for repository https://github.com/RECETOX/galaxytools/tree/master/tools/recetox_aplcms commit 19de0924a65bc65cbbf7c1fc17e9b5348305f95c
author recetox
date Fri, 10 Jun 2022 10:14:43 +0000
parents 4e6281945270
children
line wrap: on
line diff
--- a/main.R	Thu May 26 16:46:13 2022 +0000
+++ b/main.R	Fri Jun 10 10:14:43 2022 +0000
@@ -79,11 +79,8 @@
 
   res <- unsupervised(filenames = sample_files, ...)
 
-  save_all_extracted_features(res$extracted_features, sample_files)
-  save_all_corrected_features(res$corrected_features, sample_files)
-
-  save_aligned_feature_table(res$aligned_feature_sample_table, aligned_file)
-  save_recovered_feature_table(res$recovered_feature_sample_table, recovered_file, out_format)
+  save_all_features(res, sample_files)
+  save_all_feature_tables(res$aligned_feature_sample_table, res$recovered_feature_sample_table, aligned_file, recovered_file, out_format)
 }
 
 hybrid_main <- function(sample_files, known_table_file, updated_known_table_file, pairing_file, aligned_file, recovered_file, out_format, ...) {
@@ -95,11 +92,22 @@
   save_known_table(res$updated_known_table, updated_known_table_file)
   save_pairing(res$features_known_table_pairing, pairing_file)
 
-  save_all_extracted_features(res$extracted_features, sample_files)
-  save_all_corrected_features(res$corrected_features, sample_files)
+  save_all_features(res, sample_files)
+  save_all_feature_tables(res$aligned_feature_sample_table, res$recovered_feature_sample_table, aligned_file, recovered_file, out_format)
+}
 
-  save_aligned_feature_table(res$aligned_feature_sample_table, aligned_file)
-  save_recovered_feature_table(res$recovered_feature_sample_table, recovered_file, out_format)
+save_all_features <- function(result, sample_files) {
+  save_all_extracted_features(result$extracted_features, sample_files)
+  save_all_corrected_features(result$corrected_features, sample_files)
+}
+
+save_all_feature_tables <- function(aligned_feature_sample_table,
+                                    recovered_feature_sample_table,
+                                    aligned_file,
+                                    recovered_file,
+                                    out_format) {
+  save_aligned_feature_table(aligned_feature_sample_table, aligned_file)
+  save_recovered_feature_table(recovered_feature_sample_table, recovered_file, out_format)
 }
 
 two_step_hybrid_main <- function(sample_files, known_table_file, updated_known_table_file, recovered_file, aligned_file, out_format, metadata, ...) {