diff --git a/config/datatypes_conf.xml.sample b/config/datatypes_conf.xml.sample index b8dd3802cb1..ac3fd9bc06a 100644 --- a/config/datatypes_conf.xml.sample +++ b/config/datatypes_conf.xml.sample @@ -491,6 +491,7 @@ + @@ -682,6 +683,7 @@ + diff --git a/lib/galaxy/datatypes/binary.py b/lib/galaxy/datatypes/binary.py index 87cf9aeee92..ac482bafb2a 100644 --- a/lib/galaxy/datatypes/binary.py +++ b/lib/galaxy/datatypes/binary.py @@ -1792,6 +1792,32 @@ class DMND(Binary): Binary.register_sniffable_binary_format("dmnd", "dmnd", DMND) +class ICM(Binary): + """ + Class describing an ICM (interpolated context model) file, used by Glimmer + """ + file_ext = "icm" + edam_data = "data_0950" + + def set_peek(self, dataset, is_multi_byte=False): + if not dataset.dataset.purged: + dataset.peek = "Binary ICM (interpolated context model) file" + dataset.blurb = nice_size(dataset.get_size()) + else: + dataset.peek = 'file does not exist' + dataset.blurb = 'file purged from disk' + + def sniff(self, dataset): + line = open(dataset).readline() + if '>ver = ' in line and 'len = ' in line and 'depth = ' in line and 'periodicity =' in line and 'nodes = ' in line: + return True + + return False + + +Binary.register_sniffable_binary_ext("icm", "icm", ICM) + + if __name__ == '__main__': import doctest doctest.testmod(sys.modules[__name__])