# HG changeset patch # User iracooke # Date 1431920604 14400 # Node ID 29c43b953c1c5d360bce8efabed05538f3e20fe3 # Parent e6a02a387448043bb5f3e03802b0775d0d4cd597 Fix splib sniffer diff -r e6a02a387448 -r 29c43b953c1c README.rst --- a/README.rst Sun May 17 23:33:49 2015 -0400 +++ b/README.rst Sun May 17 23:43:24 2015 -0400 @@ -35,8 +35,8 @@ IdXML idxml False OpenMS_ TandemXML_ tandem False XTandem output RAW raw False Raw Mass Spec Data -Msp_ msp True Spectral Library -SPLib splib True Spectral Library +Msp_ msp True Spectral Library +SPLib_ splib True Spectral Library Ms2 ms2 False MS/MS Spectra XHunterAslFormat hlf False Spectral Library ================ ===================== ======= ==================================== diff -r e6a02a387448 -r 29c43b953c1c proteomics.py --- 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"