comparison proteomics.py @ 17:29c43b953c1c draft

Fix splib sniffer
author iracooke
date Sun, 17 May 2015 23:43:24 -0400
parents e6a02a387448
children d1ea609e57d4
comparison
equal deleted inserted replaced
16:e6a02a387448 17:29c43b953c1c
296 dataset.peek = data.get_file_peek( dataset.file_name, is_multi_byte=is_multi_byte ) 296 dataset.peek = data.get_file_peek( dataset.file_name, is_multi_byte=is_multi_byte )
297 dataset.blurb = 'splib Spectral Library Format' 297 dataset.blurb = 'splib Spectral Library Format'
298 else: 298 else:
299 dataset.peek = 'file does not exist' 299 dataset.peek = 'file does not exist'
300 dataset.blurb = 'file purged from disk' 300 dataset.blurb = 'file purged from disk'
301
302
303 def sniff(self, filename):
304 """ Determines whether the file is a SpectraST generated file.
305 """
306 with open(filename, 'r') as contents:
307 return Msp.next_line_starts_with(contents, "Name:") and Msp.next_line_starts_with(contents, "LibID:")
308
301 309
302 310
303 class Ms2(Text): 311 class Ms2(Text):
304 file_ext = "ms2" 312 file_ext = "ms2"
305 313