# HG changeset patch # User bgruening # Date 1376331953 14400 # Node ID 07a5042bbe9032e508b8e3d8255a364643cf1e5b # Parent e9cd105a8856be3aa5d38339bbb54ce9cef8472f Uploaded diff -r e9cd105a8856 -r 07a5042bbe90 homer.py --- a/homer.py Mon Aug 12 09:06:47 2013 -0400 +++ b/homer.py Mon Aug 12 14:25:53 2013 -0400 @@ -1,14 +1,14 @@ """ HOMER special datatypes """ - +import os from galaxy.datatypes.data import get_file_peek from galaxy.datatypes.data import Text, Data from galaxy.datatypes.metadata import MetadataElement from galaxy.datatypes.images import Html -class TagDirectory( Text ): +class TagDirectory( Html ): """Base class for HOMER's Tag Directory datatype.""" file_ext = 'homer_tagdir' @@ -16,7 +16,7 @@ allow_datatype_change = False def __init__(self, **kwd): - Text.__init__( self, **kwd ) + Html.__init__( self, **kwd ) #self.add_composite_file('tagInfo.txt', description = 'basic configuration information', mimetype = 'text/html') # Contains basic configuration information self.add_composite_file('tagLengthDistribution.txt', description = 'histogram of read lengths used for alignment', mimetype = 'text/html') # File contains a histogram of read lengths used for alignment. self.add_composite_file('tagCountDistribution.txt', description = 'histogram of clonal read depth, showing the number of reads per unique position', mimetype = 'text/html') # File contains a histogram of clonal read depth, showing the number of reads per unique position. @@ -29,25 +29,23 @@ def regenerate_primary_file(self,dataset): """ - cannot do this until we are setting metadata + regenerate the index file after metadata generation """ - flist = os.listdir(dataset.extra_files_path) - rval = ['CuffDiff Output'] + rval = ['HOMER database files'] rval.append('') rval.append('

CuffDiff Outputs:

' ) - f = file(dataset.file_name,'w') - f.write("\n".join( rval )) - f.write('\n') + f = file( dataset.file_name, 'w' ) + f.write( '%s\n' % '\n'.join( rval ) ) f.close() - - def set_meta( self, dataset, **kwd ): - Text.set_meta( self, dataset, **kwd ) - self.regenerate_primary_file(dataset) - + if not dataset.info: + dataset.info = 'HOMER datatype object' + if not dataset.blurb: + dataset.blurb = 'Composite file - HOMER' + return True def generate_primary_file( self, dataset = None ): rval = ['HOMER database files' ) return "\n".join( rval ) + def set_meta( self, dataset, **kwd ): + Html.set_meta( self, dataset, **kwd ) + self.regenerate_primary_file(dataset) + + def display_data(self, trans, data, preview=False, filename=None, to_ext=None, size=None, offset=None, **kwd): """Apparently an old display method, but still gets called. diff -r e9cd105a8856 -r 07a5042bbe90 tool-data/homer_available_genomes.loc.sample --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tool-data/homer_available_genomes.loc.sample Mon Aug 12 14:25:53 2013 -0400 @@ -0,0 +1,6 @@ +hg18 +hg19 +mm9 +mm10 + + diff -r e9cd105a8856 -r 07a5042bbe90 tools/findMotifsGenome.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tools/findMotifsGenome.xml Mon Aug 12 14:25:53 2013 -0400 @@ -0,0 +1,61 @@ + + + blat + weblogo + ghostscript + + + + + #import tempfile + #set $tmpdir = tempfile.mkdtemp() + export PATH=\$PATH:$database.fields.path; + + findMotifsGenome $infile ${infile.metadata.dbkey} $tmpdir + + + ; + cp $tmpdir/homerResults.html $denovo_results_html; + cp -r $tmpdir/homerResults/* "$denovo_results_html.files_path"; + + cp $tmpdir/knownResults.html $known_results_html; + cp -r $tmpdir/knownResults/* "$known_results_html.files_path"; + + + + 2>&1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + .. class:: infomark + + **Homer findMotifsGenome** + + + + diff -r e9cd105a8856 -r 07a5042bbe90 tools/findPeaks.xml --- a/tools/findPeaks.xml Mon Aug 12 09:06:47 2013 -0400 +++ b/tools/findPeaks.xml Mon Aug 12 14:25:53 2013 -0400 @@ -1,38 +1,40 @@ - homer + blat + weblogo + ghostscript Homer's peakcaller. Requires tag directories (see makeTagDirectory) - findPeaks $tagDir.extra_files_path $options -o $outputPeakFile + export PATH=\$PATH:$database.fields.path; - #if $control_tagDir: - -i $control_tagDir.extra_files_path + findPeaks $affected_tag_dir.extra_files_path -o $outputPeakFile + + #if $control_tag_dir: + -i $control_tag_dir.extra_files_path #end if - 2> $out_log || echo "Error running findPeaks." >&2 + 2>&1 + - - - - - - - - - - - - + + + + + + + + + - - + +