Mercurial > repos > bgruening > sklearn_generalized_linear
diff generalized_linear.xml @ 13:af9385cae623 draft
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit 5d71c93a3dd804b1469852240a86021ab9130364
author | bgruening |
---|---|
date | Mon, 09 Jul 2018 14:29:40 -0400 |
parents | 19c4cc592673 |
children | 623c0ecb7102 |
line wrap: on
line diff
--- a/generalized_linear.xml Sun Jul 01 03:17:30 2018 -0400 +++ b/generalized_linear.xml Mon Jul 09 14:29:40 2018 -0400 @@ -23,49 +23,18 @@ from scipy.io import mmread @COLUMNS_FUNCTION@ +@GET_X_y_FUNCTION@ input_json_path = sys.argv[1] params = json.load(open(input_json_path, "r")) #if $selected_tasks.selected_task == "train": +X, y = get_X_y(params, "$selected_tasks.selected_algorithms.input_options.infile1" ,"$selected_tasks.selected_algorithms.input_options.infile2") + algorithm = params["selected_tasks"]["selected_algorithms"]["selected_algorithm"] options = params["selected_tasks"]["selected_algorithms"]["options"] -#if $selected_tasks.selected_algorithms.input_options.selected_input=="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( - "$selected_tasks.selected_algorithms.input_options.infile1", - c = c, - c_option = column_option, - sep='\t', - header=header, - parse_dates=True -) -#else: -X = mmread(open("$selected_tasks.selected_algorithms.input_options.infile1", 'r')) -#end if - -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( - "$selected_tasks.selected_algorithms.input_options.infile2", - c = c, - c_option = column_option, - sep='\t', - header=header, - parse_dates=True -) - my_class = getattr(sklearn.linear_model, algorithm) estimator = my_class(**options) estimator.fit(X,y)