Merge pull request #4370 from bgruening/mzml

Add imzML datatype
This commit is contained in:
Eric Rasche
2017-08-03 10:36:09 +02:00
committed by GitHub
2 changed files with 40 additions and 0 deletions
+1
View File
@@ -240,6 +240,7 @@
<datatype extension="percout" type="galaxy.datatypes.xml:GenericXml" subclass="true" />
<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"/>
<!-- End Proteomics Datatypes -->
<datatype extension="netcdf" type="galaxy.datatypes.binary:NetCDF" mimetype="application/octet-stream" display_in_upload="true" description="Format used by netCDF software library for writing and reading chromatography-MS data files." />
<datatype extension="eps" type="galaxy.datatypes.images:Eps" mimetype="image/eps"/>
+39
View File
@@ -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 = ['<html><head><title>imzML 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.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)