Mercurial > repos > iracooke > proteomics_datatypes
diff proteomics.py @ 17:29c43b953c1c draft
Fix splib sniffer
author | iracooke |
---|---|
date | Sun, 17 May 2015 23:43:24 -0400 |
parents | e6a02a387448 |
children | d1ea609e57d4 |
line wrap: on
line diff
--- a/proteomics.py Sun May 17 23:33:49 2015 -0400 +++ b/proteomics.py Sun May 17 23:43:24 2015 -0400 @@ -300,6 +300,14 @@ dataset.blurb = 'file purged from disk' + def sniff(self, filename): + """ Determines whether the file is a SpectraST generated file. + """ + with open(filename, 'r') as contents: + return Msp.next_line_starts_with(contents, "Name:") and Msp.next_line_starts_with(contents, "LibID:") + + + class Ms2(Text): file_ext = "ms2"