Mercurial > repos > iracooke > proteomics_datatypes
changeset 17:29c43b953c1c draft
Fix splib sniffer
author | iracooke |
---|---|
date | Sun, 17 May 2015 23:43:24 -0400 |
parents | e6a02a387448 |
children | d1ea609e57d4 |
files | README.rst proteomics.py |
diffstat | 2 files changed, 10 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- 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 ================ ===================== ======= ====================================
--- 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"