changeset 1:cb4f92e6fd4e draft

planemo upload for repository https://github.com/bxlab/galaxy_tools/suites/suite_hifive commit ded5555ebf85f4807cbe4f1bf1945a757bdc724d
author sauria
date Wed, 26 Aug 2015 16:53:42 -0400
parents 0a9c76d80e33
children bc91bdb2e644
files galaxy.datatypes.mrh.py hifive.xml hifive_macros.xml readme.rst tool_dependencies.xml
diffstat 5 files changed, 91 insertions(+), 18 deletions(-) [+]
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/galaxy.datatypes.mrh.py	Wed Aug 26 16:53:42 2015 -0400
@@ -0,0 +1,33 @@
+from galaxy import eggs
+
+import pkg_resources
+pkg_resources.require( "bx-python" )
+
+import logging, os, sys, time, sets, tempfile, shutil
+import data
+from galaxy import util
+from galaxy.datatypes.sniff import *
+from cgi import escape
+import urllib
+from bx.intervals.io import *
+from galaxy.datatypes import metadata
+from galaxy.datatypes.metadata import MetadataElement
+from galaxy.datatypes.binary import Binary
+
+
+class Mrh( Binary ):
+    """Class describing a MRH file"""
+    file_ext = "mrh"
+
+    def sniff( self, filename ):
+        # MRH is a binary file type.
+        # The first 8 bytes of any mrh file is '42054205'.
+        try:
+            header = open( filename, 'rb' ).read(8)
+            if binascii.b2a_hex( header ) == binascii.hexlify( '42054205' ):
+                return True
+            return False
+        except:
+            return False
+
+Binary.register_sniffable_binary_format("mrh", "mrh", Mrh)
--- a/hifive.xml	Fri Jun 05 14:09:00 2015 -0400
+++ b/hifive.xml	Wed Aug 26 16:53:42 2015 -0400
@@ -74,6 +74,13 @@
 	#end if
 	$hic_project $hic_int_output
 #end if
+#if str( $command.command_select ) == "hic-mrheatmap":
+	@HIC_CHROMOSOMES@
+	@HIC_DATATYPE@
+	$command.trans1
+	@MRH_OPTIONS@
+	$hic_project $hic_mrheatmap
+#end if
 #if str( $command.command_select ) == "5c-complete":
 	@5C_NORMALIZE@
 	@5C_SEQUENCE@
@@ -148,6 +155,7 @@
 				<option value="hic-normalize">Normalize HiC project</option>
 				<option value="hic-heatmap">Create HiC heatmap set</option>
 				<option value="hic-interval">Extract HiC interval</option>
+				<option value="hic-mrheatmap">Create HiC multi-resolution heatmap</option>
 				<option value="fragments">Create 5C fragment set</option>
 				<option value="5c-data">Create 5C data set</option>
 				<option value="5c-project">Create 5C project</option>
@@ -232,6 +240,16 @@
 		            <when value="no"/>
 		        </conditional>
 		    </when>
+		   	<when value="hic-mrheatmap">
+		        <param name="hic_project" type="data" format="h5" label="HiFive HiC project file" optional="False"/>
+				<expand macro="hic_chromosomes_xml"/>
+		        <param type="select" name="trans1" label="Calculate and include trans interactions">
+		            <option value="-t">yes</option>
+		            <option value="">no</option>
+		        </param>
+		        <expand macro="mrh_options_xml"/>
+		        <expand macro="hic_datatype_xml"/>
+			</when>
 			<when value="5c-complete">
 				<expand macro="5c_fragment_xml"/>
 				<expand macro="5c_sequence_xml"/>
@@ -344,6 +362,9 @@
         	<filter>(command["command_select"] == "hic-interval")</filter>
             <filter>(command["image"]["generate"] == "yes")</filter>
         </data>
+        <data format="mrh" name="hic_mrheatmap" label="${tool.name} on ${on_string}: HiC MR-heatmap">
+        	<filter>(command["command_select"] == "hic-mrheatmap")</filter>
+        </data>
         <data format="h5" name="fivec_comp_frags" label="${tool.name} on ${on_string}: 5C frags">
         	<filter>(command["command_select"] == "5c-complete")</filter>
         </data>
--- a/hifive_macros.xml	Fri Jun 05 14:09:00 2015 -0400
+++ b/hifive_macros.xml	Wed Aug 26 16:53:42 2015 -0400
@@ -659,6 +659,31 @@
             <validator type="in_range" min="0"/>
         </param>
     </xml>
+    <token name="@MRH_OPTIONS@">
+-f $command.mrhminobs
+-b $command.mrhminbinsize
+-B $command.mrhmaxbinsize
+#if str( $command.mrhtransminbinsize ) != "":
+    -r $command.mrhtransminbinsize
+#end if
+#if str( $command.mrhtransmaxbinsize ) != "":
+    -R $command.mrhtransmaxbinsize
+#end if
+    </token>
+    <xml name="mrh_options_xml">
+        <param name="mrhminobs" type="integer" label="Minimum observations" value="20" help="The number of observations needed to include a bin." >
+            <validator type="in_range" min="1"/>
+        </param>
+        <!-- Options controlling binning sizes-->
+        <param type="integer" name="mrhminbinsize" label="Cis minimum binsize (bp)" value="5000" >
+            <validator type="in_range" min="1"/>
+        </param>
+        <param type="integer" name="mrhmaxbinsize" label="Cis maximum binsize (bp)" value="1280000" help="Must be a multiple of an integer power of two times the minimum binsize (i.e. minbin * 2^N = maxbin for an integer N). ">
+            <validator type="in_range" min="1"/>
+        </param>
+        <param type="integer" name="mrhtransminbinsize" label="Trans minimum binsize (bp)" value='' help="If not specified, this will be set to the cis minimum binsize." />
+        <param type="integer" name="mrhtransmaxbinsize" label="Trans maximum binsize (bp)" value='' help="If not specified, this will be set to the cis maximum binsize." />
+    </xml>
     <token name="@HIC_DYNAMIC@">
 #if str( $command.dynamic.binning ) == "yes":
     -y
@@ -756,6 +781,8 @@
 
 Extract HiC interval / Extract 5C interval - this command returns a genomic interval files with data from a specified region. This data may also be plotted at the tie of extraction.
 
+Create HiC multi-resolution heatmap - this command returns a multi-resolution heatmap file with data heatmapped across resolutions from the smallest to largest specified binsizes in 2X steps.
+
 ]]></token>
     <token name="@HIC_HELP@"><![CDATA[
 HiC genomic partitioning - fend file
@@ -784,6 +811,11 @@
 
 The binning algorithm divides each model parameter into some number of bins and based on a binomial distribution, correction values for each bin are learned, maximizing the log-likelihood of the data. Model parameters can be the fend lengths ('len'), fend GC content ('gc'), and any other characteristics passed as additional columns (with header labels) in the bed file used to create the HiFive fend file. Each parameter has a number of bins specified to divide it into and can be partitioned according to its type to contain approximately equal numbers of fends ('even'), or to cover equal portions of the range of parameter values ('fixed'). In addition, parameter types can include the '-const' suffix to denote a parameter that should not be optimized after seeding.
 
+HiC multi-resolution heatmapping
+--------------------------------
+
+Multi-resolution heatmapping (MRH) allows multiple levels of resolution to be stored and accessed simultaneously using an intelligent binning scheme that only accepts bin with a number of observed reads meeting the minimum observation threshold. MRH files can be interactively explored through the MRH plugin in Galaxy.
+
 ]]></token>
     <token name="@5C_HELP@"><![CDATA[
 5C genomic partitioning - fragment file
--- a/readme.rst	Fri Jun 05 14:09:00 2015 -0400
+++ b/readme.rst	Wed Aug 26 16:53:42 2015 -0400
@@ -12,7 +12,7 @@
 Once normalized, data can be used for plotting, binning, or other statistical
 tests within the package very quickly.
 
-Original documentation can be found `here <http://hifive.docs.taylorlab.org/en/latest/>`_.
+Original documentation can be found `here <http://bxlab-hifive.readthedocs.org/en/latest/>`_.
 
 Automated Installation
 ======================
@@ -28,20 +28,7 @@
 XML files to your ``tool_conf.xml`` as normal.  For example, use::
 
   <section name="HiFive" id="hifive_tools">
-    <tool file="hifive/complete_hic_project.xml" />
-    <tool file="hifive/create_hic_fendset.xml" />
-    <tool file="hifive/create_hic_dataset.xml" />
-    <tool file="hifive/create_hic_project.xml" />
-    <tool file="hifive/learn_hic_normalization.xml" />
-    <tool file="hifive/create_hic_heatmap.xml" />
-    <tool file="hifive/get_interval_hic_data.xml" />
-    <tool file="hifive/complete_fivec_project.xml" />
-    <tool file="hifive/create_fivec_fragmentset.xml" />
-    <tool file="hifive/create_fivec_dataset.xml" />
-    <tool file="hifive/create_fivec_project.xml" />
-    <tool file="hifive/learn_fivec_normalization.xml" />
-    <tool file="hifive/create_fivec_heatmap.xml" />
-    <tool file="hifive/get_interval_fivec_data.xml" />
+    <tool file="hifive.xml" />
   </section>
 
 
--- a/tool_dependencies.xml	Fri Jun 05 14:09:00 2015 -0400
+++ b/tool_dependencies.xml	Wed Aug 26 16:53:42 2015 -0400
@@ -4,7 +4,7 @@
         <repository changeset_revision="cfbbe183f8a7" name="package_scipy_0_12" owner="iuc" toolshed="https://toolshed.g2.bx.psu.edu" />
     </package>
     <package name="numpy" version="1.7.1">
-        <repository changeset_revision="8b3a5c7061d8" name="package_numpy_1_7" owner="iuc" prior_installation_required="True" toolshed="https://toolshed.g2.bx.psu.edu" />
+        <repository changeset_revision="300877695495" name="package_numpy_1_7" owner="iuc" prior_installation_required="True" toolshed="https://toolshed.g2.bx.psu.edu" />
     </package>
     <package name="cython" version="0.20.1">
         <repository changeset_revision="c3a8c46fcb97" name="package_cython_0_20_1" owner="iuc" prior_installation_required="True" toolshed="https://toolshed.g2.bx.psu.edu" />
@@ -12,7 +12,7 @@
     <package name="h5py" version="2.5.0">
         <repository changeset_revision="cc1a2aae5057" name="package_h5py_2_5_0" owner="sauria" toolshed="https://toolshed.g2.bx.psu.edu" />
     </package>
-    <package name="hifive" version="1.0.3">
-        <repository changeset_revision="8cecdadaf46e" name="package_hifive_1_0_3" owner="sauria" toolshed="https://toolshed.g2.bx.psu.edu" />
+    <package name="hifive" version="1.1">
+        <repository changeset_revision="bb42e6b76d5e" name="package_hifive_1_1" owner="sauria" toolshed="https://toolshed.g2.bx.psu.edu" />
     </package>
 </tool_dependency>