changeset 6:e813f9537cb2 draft

Uploaded
author greg
date Thu, 30 Aug 2018 09:43:24 -0400
parents fd170580a6c9
children 241760d3c944
files gene_family_classifier.xml get_clustering_methods.py macros.xml
diffstat 3 files changed, 22 insertions(+), 13 deletions(-) [+]
line wrap: on
line diff
--- a/gene_family_classifier.xml	Tue Aug 21 11:24:26 2018 -0400
+++ b/gene_family_classifier.xml	Thu Aug 30 09:43:24 2018 -0400
@@ -6,6 +6,7 @@
     <requirements>
         <requirement type="package" version="1.0.3">plant_tribes_gene_family_classifier</requirement>
     </requirements>
+    <code file="get_clustering_methods.py"/>
     <command detect_errors="exit_code"><![CDATA[
 #if str($options_type.options_type_selector) == 'advanced':
     #set specify_super_orthogroups_cond = $options_type.specify_super_orthogroups_cond
@@ -91,11 +92,7 @@
     <inputs>
         <param name="input" format="fasta" type="data" label="Proteins fasta file"/>
         <expand macro="param_scaffold" />
-        <param name="method" type="select" label="Protein clustering method">
-            <option value="gfam" selected="true">GFam</option>
-            <option value="orthofinder">OrthoFinder</option>
-            <option value="orthomcl">OrthoMCL</option>
-        </param>
+        <expand macro="param_method" />
         <conditional name="save_hmmscan_log_cond">
             <param name="classifier" type="select" label="Protein classifier">
                 <option value="blastp" selected="true">blastp</option>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/get_clustering_methods.py	Thu Aug 30 09:43:24 2018 -0400
@@ -0,0 +1,12 @@
+import os
+
+
+def get_clustering_method_options(file_path):
+    options = []
+    if not os.path.isdir(file_path):
+        return options
+    methods_dir = os.path.join(file_path, "alns")
+    for i, file_name in enumerate(os.listdir(methods_dir)):
+        full_path = os.path.join(file_path, file_name)
+        options.append((file_name, full_path, i == 0))
+    return options
--- a/macros.xml	Tue Aug 21 11:24:26 2018 -0400
+++ b/macros.xml	Thu Aug 30 09:43:24 2018 -0400
@@ -2,16 +2,16 @@
 <macros>
     <token name="@WRAPPER_VERSION@">1.0</token>
     <xml name="param_method">
-        <param name="method" type="select" label="Protein clustering method">
-            <option value="gfam" selected="true">GFam</option>
-            <option value="orthofinder">OrthoFinder</option>
-            <option value="orthomcl">OrthoMCL</option>
-        </param>
+        <param name="method" type="select" label="Protein clustering method" dynamic_options="get_clustering_method_options(scaffold)"/>
     </xml>
     <xml name="param_scaffold">
-        <param name="scaffold" type="select" label="Gene family scaffold">
-            <options from_data_table="plant_tribes_scaffolds" />
-            <validator type="no_options" message="No PlantTribes scaffolds are available.  Use the PlantTribes Scaffolds Download Data Manager tool in Galaxy to install and populate the PlantTribes scaffolds data table." />
+        <param name="scaffold" type="select" label="Gene family scaffold" refresh_on_change="True">
+            <options from_data_table="plant_tribes_scaffolds">
+                <column name="name" index="1"/>
+                <column name="value" index="2"/>
+                <filter type="sort_by" column="1"/>
+                <validator type="no_options" message="No PlantTribes scaffolds are available.  Use the PlantTribes Scaffolds Download Data Manager tool in Galaxy to install and populate the PlantTribes scaffolds data table."/>
+            </options>
         </param>
     </xml>
     <xml name="citation1">