comparison main_macros.xml @ 8:85d31935d4a2 draft

planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/sklearn commit 79fe42239dcf077b13f85cbcd6c6e30d7e1e4832
author bgruening
date Tue, 22 May 2018 19:31:34 -0400
parents 09cd12b741fb
children 5a9fcfd4151f
comparison
equal deleted inserted replaced
7:09cd12b741fb 8:85d31935d4a2
1 <macros> 1 <macros>
2 <token name="@VERSION@">0.9</token> 2 <token name="@VERSION@">0.9</token>
3 3
4 <token name="@COLUMNS_FUNCTION@"> 4 <token name="@COLUMNS_FUNCTION@">
5 def read_columns(f, c, **args): 5 def read_columns(f, c, return_df=False, **args):
6 data = pandas.read_csv(f, **args) 6 data = pandas.read_csv(f, **args)
7 cols = c.split (',') 7 cols = c.split (',')
8 cols = map(int, cols) 8 cols = map(int, cols)
9 cols = list(map(lambda x: x - 1, cols)) 9 cols = list(map(lambda x: x - 1, cols))
10 y = data.iloc[:,cols].values 10 data = data.iloc[:,cols]
11 y = data.values
12 if return_df:
13 return y, data
14 else:
15 return y
11 return y 16 return y
12 </token> 17 </token>
13 18
14 <xml name="python_requirements"> 19 <xml name="python_requirements">
15 <requirements> 20 <requirements>
787 label="Use a copy of data for precomputing row normalization" help=" "/> 792 label="Use a copy of data for precomputing row normalization" help=" "/>
788 </section> 793 </section>
789 </when> 794 </when>
790 <yield/> 795 <yield/>
791 </xml> 796 </xml>
797 <xml name="feature_selection_all">
798 <conditional name="feature_selection_algorithms">
799 <param name="selected_algorithm" type="select" label="Select a feature selection algorithm">
800 <option value="SelectFromModel" selected="true">SelectFromModel - Meta-transformer for selecting features based on importance weights</option>
801 <option value="GenericUnivariateSelect" selected="true">GenericUnivariateSelect - Univariate feature selector with configurable strategy</option>
802 <option value="SelectPercentile">SelectPercentile - Select features according to a percentile of the highest scores</option>
803 <option value="SelectKBest">SelectKBest - Select features according to the k highest scores</option>
804 <option value="SelectFpr">SelectFpr - Filter: Select the p-values below alpha based on a FPR test</option>
805 <option value="SelectFdr">SelectFdr - Filter: Select the p-values for an estimated false discovery rate</option>
806 <option value="SelectFwe">SelectFwe - Filter: Select the p-values corresponding to Family-wise error rate</option>
807 <option value="RFE">RFE - Feature ranking with recursive feature elimination</option>
808 <option value="RFECV">RFECV - Feature ranking with recursive feature elimination and cross-validated selection of the best number of features</option>
809 <option value="VarianceThreshold">VarianceThreshold - Feature selector that removes all low-variance features</option>
810 <!--option value="chi2">Compute chi-squared stats between each non-negative feature and class</option-->
811 <!--option value="f_classif">Compute the ANOVA F-value for the provided sample</option-->
812 <!--option value="f_regression">Univariate linear regression tests</option-->
813 <!--option value="mutual_info_classif">Estimate mutual information for a discrete target variable</option-->
814 <!--option value="mutual_info_regression">Estimate mutual information for a continuous target variable</option-->
815 </param>
816 <when value="SelectFromModel">
817 <expand macro="feature_selection_estimator" />
818 <conditional name="extra_estimator">
819 <expand macro="feature_selection_extra_estimator" >
820 <option value="no_load">No, I will load a prefitted estimator</option>
821 </expand>
822 <expand macro="feature_selection_estimator_choices" >
823 <when value="no_load">
824 <param name="fitted_estimator" type="data" format='zip' label="Load a prefitted estimator" />
825 </when>
826 </expand>
827 </conditional>
828 <section name="options" title="Other Options" expanded="True">
829 <param argument="threshold" type="text" value="" optional="true" label="threshold" help="The threshold value to use for feature selection. e.g. 'mean', 'median', '1.25*mean'." />
830 <param argument="norm_order" type="integer" value="1" label="norm_order" help="Order of the norm used to filter the vectors of coefficients below threshold in the case where the coef_ attribute of the estimator is of dimension 2. " />
831 </section>
832 </when>
833 <when value="GenericUnivariateSelect">
834 <expand macro="feature_selection_score_function" />
835 <section name="options" title="Other Options" expanded="True">
836 <param argument="mode" type="select" label="Feature selection mode">
837 <option value="percentile">percentile</option>
838 <option value="k_best">k_best</option>
839 <option value="fpr">fpr</option>
840 <option value="fdr">fdr</option>
841 <option value="fwe">fwe</option>
842 </param>
843 <param argument="param" type="float" value="" optional="true" label="Parameter of the corresponding mode" help="float or int depending on the feature selection mode" />
844 </section>
845 </when>
846 <when value="SelectPercentile">
847 <expand macro="feature_selection_score_function" />
848 <section name="options" title="Other Options" expanded="True">
849 <param argument="percentile" type="integer" value="10" optional="True" label="Percent of features to keep" />
850 </section>
851 </when>
852 <when value="SelectKBest">
853 <expand macro="feature_selection_score_function" />
854 <section name="options" title="Other Options" expanded="True">
855 <param argument="k" type="integer" value="10" optional="True" label="Number of top features to select" help="No 'all' option is supported." />
856 </section>
857 </when>
858 <when value="SelectFpr">
859 <expand macro="feature_selection_score_function" />
860 <section name="options" title="Other Options" expanded="True">
861 <param argument="alpha" type="float" value="" optional="True" label="Alpha" help="The highest p-value for features to be kept."/>
862 </section>
863 </when>
864 <when value="SelectFdr">
865 <expand macro="feature_selection_score_function" />
866 <section name="options" title="Other Options" expanded="True">
867 <param argument="alpha" type="float" value="" optional="True" label="Alpha" help="The highest uncorrected p-value for features to keep."/>
868 </section>
869 </when>
870 <when value="SelectFwe">
871 <expand macro="feature_selection_score_function" />
872 <section name="options" title="Other Options" expanded="True">
873 <param argument="alpha" type="float" value="" optional="True" label="Alpha" help="The highest uncorrected p-value for features to keep."/>
874 </section>
875 </when>
876 <when value="RFE">
877 <expand macro="feature_selection_estimator" />
878 <conditional name="extra_estimator">
879 <expand macro="feature_selection_extra_estimator" />
880 <expand macro="feature_selection_estimator_choices" />
881 </conditional>
882 <section name="options" title="Other Options" expanded="True">
883 <param argument="n_features_to_select" type="integer" value="" optional="true" label="n_features_to_select" help="The number of features to select. If None, half of the features are selected." />
884 <param argument="step" type="float" value="1" label="step" optional="true" help="Default = 1. " />
885 <param argument="verbose" type="integer" value="0" label="verbose" help="Controls verbosity of output." />
886 </section>
887 </when>
888 <when value="RFECV">
889 <expand macro="feature_selection_estimator" />
890 <conditional name="extra_estimator">
891 <expand macro="feature_selection_extra_estimator" />
892 <expand macro="feature_selection_estimator_choices" />
893 </conditional>
894 <section name="options" title="Other Options" expanded="True">
895 <param argument="step" type="float" value="1" label="step" optional="true" help="Default = 1. " />
896 <param argument="cv" type="integer" value="" optional="true" label="cv" help="Determines the cross-validation splitting strategy" />
897 <param argument="scoring" type="text" value="" optional="true" label="scoring" help="A string (see model evaluation documentation) or a scorer callable object / function with signature scorer(estimator, X, y)."/>
898 <param argument="verbose" type="integer" value="0" label="verbose" help="Controls verbosity of output." />
899 <param argument="n_jobs" type="integer" value="1" label="n_jobs" help="Number of cores to run in parallel while fitting across folds. Defaults to 1 core."/>
900 </section>
901 </when>
902 <when value="VarianceThreshold">
903 <section name="options" title="Options" expanded="True">
904 <param argument="threshold" type="float" value="" optional="True" label="Threshold" help="Features with a training-set variance lower than this threshold will be removed."/>
905 </section>
906 </when>
907 <!--when value="chi2">
908 </when>
909 <when value="f_classif">
910 </when>
911 <when value="f_regression">
912 </when>
913 <when value="mutual_info_classif">
914 </when>
915 <when value="mutual_info_regression">
916 </when-->
917 </conditional>
918 </xml>
792 <xml name="feature_selection_score_function"> 919 <xml name="feature_selection_score_function">
793 <param argument="score_func" type="select" label="Select a score function"> 920 <param argument="score_func" type="select" label="Select a score function">
794 <option value="chi2">chi2 - Compute chi-squared stats between each non-negative feature and class</option> 921 <option value="chi2">chi2 - Compute chi-squared stats between each non-negative feature and class</option>
795 <option value="f_classif">f_classif - Compute the ANOVA F-value for the provided sample</option> 922 <option value="f_classif">f_classif - Compute the ANOVA F-value for the provided sample</option>
796 <option value="f_regression">f_regression - Univariate linear regression tests</option> 923 <option value="f_regression">f_regression - Univariate linear regression tests</option>