changeset 55:e9cd105a8856

Uploaded
author bgruening
date Mon, 12 Aug 2013 09:06:47 -0400
parents 675d25a0b9d4
children 07a5042bbe90
files homer.py tools/makeTagDirectory.xml tools/tool_dependencies.xml
diffstat 3 files changed, 32 insertions(+), 33 deletions(-) [+]
line wrap: on
line diff
--- a/homer.py	Mon Aug 12 08:16:21 2013 -0400
+++ b/homer.py	Mon Aug 12 09:06:47 2013 -0400
@@ -8,7 +8,7 @@
 from galaxy.datatypes.images import Html
 
 
-class TagDirectory(object):
+class TagDirectory( Text ):
     """Base class for HOMER's Tag Directory datatype."""
 
     file_ext = 'homer_tagdir'
@@ -26,6 +26,29 @@
         self.add_composite_file('tagGCcontent.txt', description = 'Distribution of fragment GC%-content', mimetype = 'text/html', optional=True) # Distribution of fragment GC%-content.
         self.add_composite_file('genomeGCcontent.txt', description = 'Distribution of fragment GC%-content at each location in the genome', mimetype = 'text/html', optional=True) # Distribution of fragment GC%-content at each location in the genome.
 
+
+    def regenerate_primary_file(self,dataset):
+        """
+        cannot do this until we are setting metadata 
+        """
+        flist = os.listdir(dataset.extra_files_path)
+        rval = ['<html><head><title>CuffDiff Output</title></head>']
+        rval.append('<body>')
+        rval.append('<p/>CuffDiff Outputs:<p/><ul>')
+        for i,fname in enumerate(flist):
+            sfname = os.path.split(fname)[-1]
+            rval.append( '<li><a href="%s" type="text/html">%s</a>' % ( sfname, sfname ) )
+        rval.append( '</ul></body></html>' )
+        f = file(dataset.file_name,'w')
+        f.write("\n".join( rval ))
+        f.write('\n')
+        f.close()
+
+    def set_meta( self, dataset, **kwd ):
+        Text.set_meta( self, dataset, **kwd )
+        self.regenerate_primary_file(dataset)
+
+
     def generate_primary_file( self, dataset = None ):
         rval = ['<html><head><title>HOMER database files</title></head><ul>']
         for composite_name, composite_file in self.get_composite_files( dataset = dataset ).iteritems():
--- a/tools/makeTagDirectory.xml	Mon Aug 12 08:16:21 2013 -0400
+++ b/tools/makeTagDirectory.xml	Mon Aug 12 09:06:47 2013 -0400
@@ -7,17 +7,19 @@
     <description>(TagDirectory). Used by findPeaks</description>
     <!--<version_command></version_command>-->
     <command>
-    
-    export PATH=$PATH:$database.fields.path;
+    #set $HOMER_PATH = str($database.fields.path)
+    export PATH=\$PATH:$database.fields.path;
     
-    makeTagDirectory $tagdir
-    #for $infile in alignment_files:
-        $infile
+    makeTagDirectory $tag_dir.extra_files_path
+    #for $infile in $alignment_files:
+        $infile.file
     #end for
+    
+    2>&#38;1
 
     </command>
     <inputs>
-        <param name="database" type="select" label="HOMER database">
+        <param name="database" type="select" label="HOMER database" min="1">
             <options from_file="homer.loc">
                 <column name="value" index="0"/>
                 <column name="name" index="1"/>
--- a/tools/tool_dependencies.xml	Mon Aug 12 08:16:21 2013 -0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,26 +0,0 @@
-<?xml version="1.0"?>
-<tool_dependency>
-    <package name="homer" version="4.2">
-        <install version="1.0">
-        <actions>
-        <action type="download_file">http://biowhat.ucsd.edu/homer/configureHomer.pl</action>
-
-        <action type="make_directory">$INSTALL_DIR/homer/</action>
-            <action type="move_file">
-                <source>configureHomer.pl</source>
-                <destination>$INSTALL_DIR/homer/</destination>
-            </action>
-        <action type="shell_command">perl .$INSTALL_DIR/homer/configureHomer.pl -install</action>
-
-        <action type="set_environment">
-          <environment_variable name="PATH" action="prepend_to">$INSTALL_DIR/homer/bin</environment_variable>
-        </action>
-      </actions>
-    </install>
-    <readme>
-      I'm sorry but this may not work 
-      
-    </readme>
-  </package>
-</tool_dependency>
-