comparison main_macros.xml @ 6:499f547826fc draft

planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit 5d71c93a3dd804b1469852240a86021ab9130364
author bgruening
date Mon, 09 Jul 2018 14:28:55 -0400
parents 3ce5d492b568
children b4f17fa65989
comparison
equal deleted inserted replaced
5:3ce5d492b568 6:499f547826fc
62 new_selector = selector(score_func, **options) 62 new_selector = selector(score_func, **options)
63 63
64 return new_selector 64 return new_selector
65 </token> 65 </token>
66 66
67 <token name="@GET_X_y_FUNCTION@">
68 def get_X_y(params, file1, file2):
69 input_type = params["selected_tasks"]["selected_algorithms"]["input_options"]["selected_input"]
70 if input_type=="tabular":
71 header = 'infer' if params["selected_tasks"]["selected_algorithms"]["input_options"]["header1"] else None
72 column_option = params["selected_tasks"]["selected_algorithms"]["input_options"]["column_selector_options_1"]["selected_column_selector_option"]
73 if column_option in ["by_index_number", "all_but_by_index_number", "by_header_name", "all_but_by_header_name"]:
74 c = params["selected_tasks"]["selected_algorithms"]["input_options"]["column_selector_options_1"]["col1"]
75 else:
76 c = None
77 X = read_columns(
78 file1,
79 c = c,
80 c_option = column_option,
81 sep='\t',
82 header=header,
83 parse_dates=True
84 )
85 else:
86 X = mmread(open(file1, 'r'))
87
88 header = 'infer' if params["selected_tasks"]["selected_algorithms"]["input_options"]["header2"] else None
89 column_option = params["selected_tasks"]["selected_algorithms"]["input_options"]["column_selector_options_2"]["selected_column_selector_option2"]
90 if column_option in ["by_index_number", "all_but_by_index_number", "by_header_name", "all_but_by_header_name"]:
91 c = params["selected_tasks"]["selected_algorithms"]["input_options"]["column_selector_options_2"]["col2"]
92 else:
93 c = None
94 y = read_columns(
95 file2,
96 c = c,
97 c_option = column_option,
98 sep='\t',
99 header=header,
100 parse_dates=True
101 )
102 y=y.ravel()
103 return X, y
104 </token>
105
67 <xml name="python_requirements"> 106 <xml name="python_requirements">
68 <requirements> 107 <requirements>
69 <requirement type="package" version="2.7">python</requirement> 108 <requirement type="package" version="2.7">python</requirement>
70 <requirement type="package" version="0.19.1">scikit-learn</requirement> 109 <requirement type="package" version="0.19.1">scikit-learn</requirement>
71 <requirement type="package" version="0.22.0">pandas</requirement> 110 <requirement type="package" version="0.22.0">pandas</requirement>
79 </stdio> 118 </stdio>
80 </xml> 119 </xml>
81 120
82 121
83 <!--Generic interface--> 122 <!--Generic interface-->
84 <xml name="train_loadConditional" token_train="tabular" token_data="tabular" token_model="txt">
85 <conditional name="selected_tasks">
86 <param name="selected_task" type="select" label="Select a Classification Task">
87 <option value="train" selected="true">Train a model</option>
88 <option value="load">Load a model and predict</option>
89 </param>
90 <when value="load">
91 <param name="infile_model" type="data" format="@MODEL@" label="Models" help="Select a model file."/>
92 <param name="infile_data" type="data" format="@DATA@" label="Data (tabular)" help="Select the dataset you want to classify."/>
93 <conditional name="prediction_options">
94 <param name="prediction_option" type="select" label="Select the type of prediction">
95 <option value="predict">Predict class labels</option>
96 <option value="advanced">Include advanced options</option>
97 </param>
98 <when value="predict">
99 </when>
100 <when value="advanced">
101 </when>
102 </conditional>
103 </when>
104 <when value="train">
105 <param name="infile_train" type="data" format="@TRAIN@" label="Training samples (tabular)"/>
106 <conditional name="selected_algorithms">
107 <yield />
108 </conditional>
109 </when>
110 </conditional>
111 </xml>
112 123
113 <xml name="sl_Conditional" token_train="tabular" token_data="tabular" token_model="txt"> 124 <xml name="sl_Conditional" token_train="tabular" token_data="tabular" token_model="txt">
114 <conditional name="selected_tasks"> 125 <conditional name="selected_tasks">
115 <param name="selected_task" type="select" label="Select a Classification Task"> 126 <param name="selected_task" type="select" label="Select a Classification Task">
116 <option value="train" selected="true">Train a model</option> 127 <option value="train" selected="true">Train a model</option>