# HG changeset patch
# User bgruening
# Date 1531161232 14400
# Node ID 8518fdc23c7e13dcf3c5eff2fb6c790ea1a33a2f
# Parent 510aa2ce035e7ea50389009a202ff21e5b2d0607
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit 5d71c93a3dd804b1469852240a86021ab9130364
diff -r 510aa2ce035e -r 8518fdc23c7e main_macros.xml
--- a/main_macros.xml Sun Jul 01 03:21:23 2018 -0400
+++ b/main_macros.xml Mon Jul 09 14:33:52 2018 -0400
@@ -64,6 +64,45 @@
return new_selector
+
+def get_X_y(params, file1, file2):
+ input_type = params["selected_tasks"]["selected_algorithms"]["input_options"]["selected_input"]
+ if input_type=="tabular":
+ header = 'infer' if params["selected_tasks"]["selected_algorithms"]["input_options"]["header1"] else None
+ column_option = params["selected_tasks"]["selected_algorithms"]["input_options"]["column_selector_options_1"]["selected_column_selector_option"]
+ if column_option in ["by_index_number", "all_but_by_index_number", "by_header_name", "all_but_by_header_name"]:
+ c = params["selected_tasks"]["selected_algorithms"]["input_options"]["column_selector_options_1"]["col1"]
+ else:
+ c = None
+ X = read_columns(
+ file1,
+ c = c,
+ c_option = column_option,
+ sep='\t',
+ header=header,
+ parse_dates=True
+ )
+ else:
+ X = mmread(open(file1, 'r'))
+
+ header = 'infer' if params["selected_tasks"]["selected_algorithms"]["input_options"]["header2"] else None
+ column_option = params["selected_tasks"]["selected_algorithms"]["input_options"]["column_selector_options_2"]["selected_column_selector_option2"]
+ if column_option in ["by_index_number", "all_but_by_index_number", "by_header_name", "all_but_by_header_name"]:
+ c = params["selected_tasks"]["selected_algorithms"]["input_options"]["column_selector_options_2"]["col2"]
+ else:
+ c = None
+ y = read_columns(
+ file2,
+ c = c,
+ c_option = column_option,
+ sep='\t',
+ header=header,
+ parse_dates=True
+ )
+ y=y.ravel()
+ return X, y
+
+
python
@@ -81,34 +120,6 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-