diff --git a/config/datatypes_conf.xml.sample b/config/datatypes_conf.xml.sample index 056f6a3d383..84c3ec9a89d 100644 --- a/config/datatypes_conf.xml.sample +++ b/config/datatypes_conf.xml.sample @@ -240,6 +240,7 @@ + diff --git a/lib/galaxy/datatypes/proteomics.py b/lib/galaxy/datatypes/proteomics.py index de6229b81f9..1d61d1f375a 100644 --- a/lib/galaxy/datatypes/proteomics.py +++ b/lib/galaxy/datatypes/proteomics.py @@ -425,3 +425,42 @@ class XHunterAslFormat(Binary): class Sf3(Binary): """Class describing a Scaffold SF3 files""" file_ext = "sf3" + + +class ImzML(Binary): + """ + Class for imzML files. + http://www.imzml.org + """ + edam_format = "format_3682" + file_ext = 'imzml' + allow_datatype_change = False + composite_type = 'auto_primary_file' + + def __init__(self, **kwd): + Binary.__init__(self, **kwd) + + """The metadata""" + self.add_composite_file( + 'imzml', + description='The imzML metadata component.', + is_binary=False) + + """The mass spectral data""" + self.add_composite_file( + 'ibd', + description='The mass spectral data component.', + is_binary=True) + + def generate_primary_file(self, dataset=None): + rval = ['imzML Composite Dataset

'] + rval.append('

This composite dataset is composed of the following files:

    ') + for composite_name, composite_file in self.get_composite_files(dataset=dataset).iteritems(): + fn = composite_name + opt_text = '' + if composite_file.get('description'): + rval.append('
  • %s (%s)%s
  • ' % (fn, fn, composite_file.get('description'), opt_text)) + else: + rval.append('
  • %s%s
  • ' % (fn, fn, opt_text)) + rval.append('
') + return "\n".join(rval)