diff rest_tool.xml @ 6:9ee84d9fd3a7 draft

Uploaded
author bernhardlutz
date Thu, 03 Apr 2014 06:50:57 -0400
parents
children 3c1e862e8cd6
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/rest_tool.xml	Thu Apr 03 06:50:57 2014 -0400
@@ -0,0 +1,256 @@
+<tool id="rest_tool" name="Fetch Data from pubchem" version="0.1.0">
+    <description>Fetch pubchem data</description>
+    <version_command>echo "0.1.0"</version_command>
+    <requirements>
+        <requirement type="set_environment">REST_TOOL_SCRIPT_PATH</requirement>
+    </requirements>
+    <macros>
+        <import>rest_tool_macros.xml</import>
+    </macros>
+    <command interpreter="python">
+        #if $choose_action.action == 'search':
+        rest_tool_search.py --type $choose_action.input_type_search --name $choose_action.search_name --outfile $output
+        
+        #elif $choose_action.action == 'specific_data':
+        rest_tool.py
+            #if $choose_action.field_or_file1.field_or_file1 == 'field':
+            --id $choose_action.field_or_file1.id1 
+            #else:
+            --id-file $choose_action.field_or_file1.file_ids_1
+            #end if
+            --type $choose_action.choose_acs.input_type
+            
+            #if $choose_action.choose_acs.input_type == 'assay':
+            --operation $choose_action.choose_acs.operation_assay.operation_assay
+                #if $choose_action.choose_acs.operation_assay.operation_assay == 'property':
+                    --property-value $choose_action.choose_acs.operation_assay.property_assay
+                #elif $choose_action.choose_acs.operation_assay.operation_assay == 'aids':
+                    --id-type $choose_action.choose_acs.operation_assay.aids_type_assay
+                #elif $choose_action.choose_acs.operation_assay.operation_assay == 'cids':
+                    --id-type $choose_action.choose_acs.operation_assay.cids_type_assay
+                #elif $choose_action.choose_acs.operation_assay.operation_assay == 'sids':
+                    --id-type $choose_action.choose_acs.operation_assay.sids_type_assay
+                #end if
+            #elif $choose_action.choose_acs.input_type == 'compound':
+            --operation $choose_action.choose_acs.operation_compound.operation_compound
+                #if $choose_action.choose_acs.operation_compound.operation_compound == 'property':
+                    --property-value $choose_action.choose_acs.operation_compound.property_compound
+                #elif $choose_action.choose_acs.operation_compound.operation_compound == 'aids':
+                    --id-type $choose_action.choose_acs.operation_compound.aids_type_compound
+                #elif $choose_action.choose_acs.operation_compound.operation_compound == 'cids':
+                    --id-type $choose_action.choose_acs.operation_compound.cids_type_compound
+                #elif $choose_action.choose_acs.operation_compound.operation_compound == 'sids':
+                    --id-type $choose_action.choose_acs.operation_compound.sids_type_compound
+                #end if
+            #else:
+            --operation $choose_action.choose_acs.operation_substance.operation_substance
+                #if $choose_action.choose_acs.operation_substance.operation_substance == 'property':
+                    --property-value $choose_action.choose_acs.operation_substance.property_substance
+                #elif $choose_action.choose_acs.operation_substance.operation_substance == 'aids':
+                    --id-type $choose_action.choose_acs.operation_substance.aids_type_substance
+                #elif $choose_action.choose_acs.operation_substance.operation_substance == 'cids':
+                    --id-type $choose_action.choose_acs.operation_substance.cids_type_substance
+                #elif $choose_action.choose_acs.operation_substance.operation_substance == 'sids':
+                    --id-type $choose_action.choose_acs.operation_substance.sids_type_substance
+                #end if
+            #end if
+            --outfile $output
+        #elif $choose_action.action == 'compounds_for_assay':
+            rest_tool_comp_for_assay.py
+            #if $choose_action.field_or_file2.field_or_file2 == 'field':
+            --aid $choose_action.field_or_file2.id2 
+            #else:
+            --aid-file $choose_action.field_or_file2.file_ids_2
+            #end if
+            --outfile $output
+        #elif $choose_action.action == 'assays_by_activity_or_target':
+            rest_tool_assay_by_activity_or_target.py
+            #if $choose_action.activity_or_target.activity_or_target == 'activity':
+                --activity $choose_action.activity_or_target.activity
+            #else:
+                --target $choose_action.activity_or_target.target_id
+                --target-type $choose_action.activity_or_target.target_identifier_type
+            #end if
+            --outfile $output
+
+        #end if
+    </command>
+
+    <inputs>
+        <conditional name="choose_action">
+            <param name="action" multiple="false" type="select" label="Choose action">
+                <option value="search">Search for Assay/Compound/Substance</option>
+                <option value="specific_data">Get Data for specific Assay/Compound/Substance</option>
+                <option value="compounds_for_assay">Get all compound IDs given BioAssay IDs</option>
+                <option value="assays_by_activity_or_target">Get BioAssay IDs given activity/target</option>
+            </param>
+            <when value="search">
+                    <param name="input_type_search" multiple="false" type="select" label="Search for">
+                        <option value="assay">BioAssay</option>
+                        <option value="compound">Compound</option>
+                        <option value="substance">Substance</option>
+                    </param>
+                    <param name="input_type" multiple="false" type="select" label="Search By">
+                        <option value="name">Name</option>
+                    </param>
+                    <param format="txt" name="search_name" type="text" label="Enter the Name" />
+            </when>
+            <when value="specific_data">
+                <conditional name="field_or_file1">
+                        <param name="field_or_file1" multiple="false" type="select" label="Specify the ID by">
+                            <option value="field" selected="True">Textfield</option>
+                            <option value="file">File</option>
+                        </param>
+                        <when value="field">
+                            <param format="txt" name="id1" type="text" label="Enter the ID(s)" />
+                        </when>
+                        <when value="file">
+                            <param format="txt,csv" name="file_ids_1" type="data" label="Give the file" />
+                        </when>
+                </conditional>
+                <conditional name="choose_acs">
+                    <param name="input_type" multiple="false" type="select" label="Input Type">
+                        <option value="assay">BioAssay</option>
+                        <option value="compound">Compound</option>
+                        <option value="substance">Substance</option>
+                    </param>
+        
+                    <when value="assay">
+                        <conditional name="operation_assay">
+                            <param name="operation_assay" type="select" multiple="false" label="Operation">
+                                <expand macro="aid_cid_sid" />
+                                <option value="record">Record</option>
+                                <option value="classification">Classification</option>
+                                <option value="property">Property</option>
+                                <option value="description">Discription</option>
+                                <option value="summary">Summary</option>
+                            </param>
+                            <when value="property">
+                                <param name="property_assay" label="Specify Property" type="text" />
+                            </when>
+                            <when value="aids">
+                                <param name="aids_type_assay" multiple="false" type="select" label="AID Type">
+                                    <expand macro="aids_when_options" />
+                                </param>
+                            </when>
+                            <when value="cids">
+                                <param name="cids_type_assay" multiple="false" type="select" label="CID Type">
+                                    <expand macro="aids_when_options" />
+                                    
+                                </param>
+                            </when>
+                            <when value="sids">
+                                <param name="sids_type_assay" multiple="false" type="select" label="SID Type">
+                                    <expand macro="aids_when_options" />
+                                    <option value="doseresponse">doseresponse</option>
+                                </param>
+                            </when>
+                        </conditional>
+                    </when>
+                    <when value="compound">
+                        <conditional name="operation_compound">
+                            <param name="operation_compound" type="select" multiple="false" label="Operation">
+                                <expand macro="aid_cid_sid" />
+                                <expand macro="option_compound_substance" />
+                                <option value="property">Property</option>
+                            </param>
+                            <when value="property">
+                                <param name="property_compound" label="Specify Property" type="text" />
+                            </when>
+                            <when value="aids">
+                                <param name="aids_type_compound" multiple="false" type="select" label="AID Type">
+                                    <expand macro="aids_when_options" />
+                                </param>
+                            </when>
+                            <when value="sids">
+                                <param name="sids_type_compound" multiple="false" type="select" label="SID Type">
+
+                                    <expand macro="cid_sid_type_options" />
+                                </param>
+                            </when>
+                            <when value="cids">
+                                <param name="cids_type_compound" multiple="false" type="select" label="CID Type">
+                                    <expand macro="cid_cid_type_options" />
+                                </param>
+                            </when>
+                        </conditional>
+                    </when>
+                    <when value="substance">
+                        <conditional name="operation_substance">
+                            <param name="operation_substance" type="select" multiple="false" label="Operation">
+                                <expand macro="aid_cid_sid" />
+                                <expand macro="option_compound_substance" />
+                            </param>
+                            <when value="property">
+                                <param name="property_substance" label="Specify Property" type="text" />
+                            </when>
+                            <when value="aids">
+                                <param name="aids_type_substance" multiple="false" type="select" label="AID Type">
+                                    <expand macro="aids_when_options" />
+                                </param>
+                            </when>
+                            <when value="cids">
+                                <param name="cids_type_substance" multiple="false" type="select" label="CID Type">
+                                    <expand macro="sid_cid_type_options" />
+                                </param>
+                            </when>
+                            <when value="sids">
+                                <param name="sids_type_substance" multiple="false" type="select" label="SID Type">
+                                    <expand macro="sid_sid_type_options" />
+                                </param>
+                            </when>
+                            
+                        </conditional>
+                    </when>
+                </conditional>
+            </when>
+            <!-- second option -->
+            <when value="compounds_for_assay">
+                <conditional name="field_or_file2">
+                    <param name="field_or_file2" multiple="false" type="select" label="Specify the ID by">
+                        <option value="field">Textfield</option>
+                        <option value="file">File</option>
+                    </param>
+                    <when value="field">
+                        <param format="txt" name="id2" type="text" label="Enter the ID(s)" />
+                    </when>
+                    <when value="file">
+                        <param format="txt,csv" name="file_ids_2" type="data" label="Give the file" />
+                    </when>
+                </conditional>
+            </when>
+            <!-- third option -->
+            <when value="assays_by_activity_or_target">
+                <conditional name="activity_or_target">
+                    <param name="activity_or_target" multiple="false" type="select" label="Look for">
+                        <option value="target">Target</option>
+                        <option value="activity">Activity</option>
+                    </param>
+                    <when value="activity">
+                        <param format="txt" name="activity" type="text" label="Enter the activity" />
+                    </when>
+            
+                    <when value="target">
+                        <param name="target_identifier_type" multiple="false" type="select" label="Choose target identifier">
+                            <option value="gi">GI</option>
+                            <option value="geneid">Gene ID</option>
+                            <option value="genesymbol">Gene Symbol</option>
+                        </param>
+                        <param format="txt" name="target_id" type="text" label="Enter the target" />
+                    </when>
+                </conditional>
+            </when>
+            
+        </conditional>
+    </inputs>
+    <outputs>
+        <data format="csv" name="output" />
+    </outputs>
+    <tests>
+    </tests>
+    <help>
+**What it does**
+
+This tool fetches data from pubchem
+    </help>
+</tool>