Skip to content

Commit

Permalink
add Analyze75 datatype
Browse files Browse the repository at this point in the history
  • Loading branch information
bgruening committed Oct 21, 2017
1 parent faa50a2 commit 72dd4a3
Show file tree
Hide file tree
Showing 2 changed files with 48 additions and 0 deletions.
1 change: 1 addition & 0 deletions config/datatypes_conf.xml.sample
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,7 @@
<datatype extension="hardklor" type="galaxy.datatypes.tabular:Tabular" subclass="true" />
<datatype extension="kronik" type="galaxy.datatypes.tabular:Tabular" subclass="true" />
<datatype extension="imzml" type="galaxy.datatypes.proteomics:ImzML" mimetype="application/xml" display_in_upload="true"/>
<datatype extension="analyze75" type="galaxy.datatypes.proteomics:Analyze75" mimetype="application/xml" display_in_upload="true"/>
<!-- End Proteomics Datatypes -->
<datatype extension="deeptools_compute_matrix_archive" type="galaxy.datatypes.binary:CompressedArchive" subclass="true" display_in_upload="true"/>
<datatype extension="deeptools_coverage_matrix" type="galaxy.datatypes.binary:CompressedArchive" subclass="true" display_in_upload="true"/>
Expand Down
47 changes: 47 additions & 0 deletions lib/galaxy/datatypes/proteomics.py
Original file line number Diff line number Diff line change
Expand Up @@ -464,3 +464,50 @@ def generate_primary_file(self, dataset=None):
rval.append('<li><a href="%s" type="text/plain">%s</a>%s</li>' % (fn, fn, opt_text))
rval.append('</ul></div></html>')
return "\n".join(rval)


class Analyze75(Binary):
"""
Mayo Analyze 7.5 files
http://www.imzml.org
"""
file_ext = 'analyze75'
allow_datatype_change = False
composite_type = 'auto_primary_file'

def __init__(self, **kwd):
Binary.__init__(self, **kwd)

"""The header file. Provides information about dimensions, identification, and processing history."""
self.add_composite_file(
'hdr',
description='The Analyze75 header file.',
is_binary=False)

"""The image file. Image data, whose data type and ordering are described by the header file."""
self.add_composite_file(
'img',
description='The Analyze75 image file.',
is_binary=True)

"""The optional t2m file."""
self.add_composite_file(
't2m',
description='The Analyze75 t2m file.',
optional='True', is_binary=True)

def generate_primary_file(self, dataset=None):
rval = ['<html><head><title>Analyze75 Composite Dataset.</title></head><p/>']
rval.append('<div>This composite dataset is composed of the following files:<p/><ul>')
for composite_name, composite_file in self.get_composite_files(dataset=dataset).iteritems():
fn = composite_name
opt_text = ''
if composite_file.optional:
opt_text = ' (optional)'
if composite_file.get('description'):
rval.append('<li><a href="%s" type="text/plain">%s (%s)</a>%s</li>' % (fn, fn, composite_file.get('description'), opt_text))
else:
rval.append('<li><a href="%s" type="text/plain">%s</a>%s</li>' % (fn, fn, opt_text))
rval.append('</ul></div></html>')
return "\n".join(rval)

0 comments on commit 72dd4a3

Please sign in to comment.