changeset 0:fd9e9ac5ecb3 draft

Imported from capsule None
author iuc
date Mon, 25 Aug 2014 17:15:46 -0400
parents
children a580422f6f1d
files data_manager/data_manager_gemini_download.py data_manager/data_manager_gemini_download.xml data_manager_conf.xml tool-data/gemini_databases.loc.sample tool_data_table_conf.xml.sample tool_dependencies.xml
diffstat 6 files changed, 109 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/data_manager/data_manager_gemini_download.py	Mon Aug 25 17:15:46 2014 -0400
@@ -0,0 +1,35 @@
+#!/usr/bin/env python
+
+import sys
+import os
+import json
+import shlex
+import datetime
+import subprocess
+
+def main():
+
+    today = datetime.date.today()
+    gemini_root_dir = os.environ['GEMINI_ROOT_DIR']
+    params = json.loads( open( sys.argv[1] ).read() )
+    target_directory = params[ 'output_data' ][0]['extra_files_path']
+    os.mkdir( target_directory )
+    gemini_exec = os.path.join( gemini_root_dir, 'gemini', 'gemini', 'install-data.py' )
+    cmd = gemini_exec + " %s %s" % (' '.join( [params['param_dict']['gerp_bp'], params['param_dict']['cadd']] ), target_directory)
+    #cmd = gemini_exec + " --help > %s/foo.txt" % target_directory
+    ret = subprocess.check_call( cmd, shell=True )
+    data_manager_dict = { 
+                'data_tables': 
+                    {'gemini_databases': [ 
+                            {'value': today.isoformat(), 'dbkey': 'hg19', 'name': 'GEMINI annotations (%s)' % today.isoformat(), 'path': './%s' % today.isoformat() } 
+                                        ] 
+                    }
+                }
+
+    #save info to json file
+    with open( sys.argv[1], 'wb' ) as out:
+        out.write( json.dumps( data_manager_dict ) )
+
+if __name__ == "__main__":
+    main()
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/data_manager/data_manager_gemini_download.xml	Mon Aug 25 17:15:46 2014 -0400
@@ -0,0 +1,37 @@
+<tool id="data_manager_gemini_download" name="GEMINI Download" version="0.9.1" tool_type="manage_data">
+    <description>Download a new database</description>
+    <requirements>
+        <requirement type="package" version="0.10.0">gemini</requirement>
+    </requirements>
+    <command interpreter="python">
+        data_manager_gemini_download.py "$out_file"
+    </command>
+    <inputs>
+        <param name="cadd" type="boolean" truevalue="--extra cadd_score" falsevalue="" checked="True" 
+            label="Download CADD scores for GEMINI database annotation" help="(--extra cadd_score)"/>
+
+        <param name="gerp_bp" type="boolean" truevalue="--extra gerp_bp" falsevalue="" checked="True" 
+            label="Download GERP for GEMINI database annotation" help="(--extra gerp_bp)"/>
+    </inputs>
+    <outputs>
+           <data name="out_file" format="data_manager_json" label="${tool.name}"/>
+    </outputs>
+    <stdio>
+        <exit_code range=":-1"  level="fatal" description="Error: Cannot open file" />
+        <exit_code range="1:"  level="fatal" description="Error" />
+    </stdio>
+    <tests>
+    </tests>
+    <help>
+
+This tool downloads the GEMINI databases.
+
+For details about this tool, please go to http://http://gemini.readthedocs.org
+
+    </help>
+    <citations>
+        <citation type="doi">10.1371/journal.pcbi.1003153</citation>
+        <yield />
+    </citations>
+</tool>
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/data_manager_conf.xml	Mon Aug 25 17:15:46 2014 -0400
@@ -0,0 +1,21 @@
+<?xml version="1.0"?>
+<data_managers>
+    <data_manager tool_file="data_manager/data_manager_gemini_download.xml" id="data_manager_gemini_download" >
+        <data_table name="gemini_databases">  <!-- Defines a Data Table to be modified. -->
+            <output> <!-- Handle the output of the Data Manager Tool -->
+                <column name="value" /> <!-- columns that are going to be specified by the Data Manager Tool -->
+                <column name="dbkey" /> <!-- columns that are going to be specified by the Data Manager Tool -->
+                <column name="name" />  <!-- columns that are going to be specified by the Data Manager Tool -->
+                <column name="path" output_ref="out_file" >
+                    <move type="directory" relativize_symlinks="True">
+                        <target base="${GALAXY_DATA_MANAGER_DATA_PATH}">gemini/data/${dbkey}/${value}</target>
+                    </move>
+                    <value_translation>${GALAXY_DATA_MANAGER_DATA_PATH}/gemini/data/${dbkey}/${value}/gemini/data/</value_translation>
+                    <value_translation type="function">abspath</value_translation>
+                </column>
+            </output>
+        </data_table>
+    </data_manager>
+</data_managers>
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tool-data/gemini_databases.loc.sample	Mon Aug 25 17:15:46 2014 -0400
@@ -0,0 +1,3 @@
+## GEMINI databases
+#Version	dbkey	Description
+#08_08_2014	hg19	Database (08-08-2014)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tool_data_table_conf.xml.sample	Mon Aug 25 17:15:46 2014 -0400
@@ -0,0 +1,7 @@
+<tables>
+    <table name="gemini_databases" comment_char="#">
+        <columns>value, dbkey, name, path</columns>
+        <file path="tool-data/gemini_databases.loc" />
+    </table>
+</tables>
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tool_dependencies.xml	Mon Aug 25 17:15:46 2014 -0400
@@ -0,0 +1,6 @@
+<?xml version="1.0"?>
+<tool_dependency>
+  <package name="gemini" version="0.10.0">
+      <repository name="package_gemini_0_10_0" owner="iuc" toolshed="https://toolshed.g2.bx.psu.edu" />
+    </package>
+</tool_dependency>