diff proteomics.py @ 16:e6a02a387448 draft

planemo upload commit 4f23896d1a519a87f189c6238a95b8f5b5933e9a-dirty
author iracooke
date Sun, 17 May 2015 23:33:49 -0400
parents 74dae57933ae
children 29c43b953c1c
line wrap: on
line diff
--- a/proteomics.py	Sun Mar 29 19:24:40 2015 -0400
+++ b/proteomics.py	Sun May 17 23:33:49 2015 -0400
@@ -285,6 +285,21 @@
         with open(filename, 'r') as contents:
             return Msp.next_line_starts_with(contents, "Name:") and Msp.next_line_starts_with(contents, "MW:")
 
+
+class SPLib( Msp ):
+    """SpectraST Spectral Library. Closely related to msp format"""
+    file_ext = "splib"
+
+    def set_peek( self, dataset, is_multi_byte=False ):
+        """Set the peek and blurb text"""
+        if not dataset.dataset.purged:
+            dataset.peek = data.get_file_peek( dataset.file_name, is_multi_byte=is_multi_byte )
+            dataset.blurb = 'splib Spectral Library Format'
+        else:
+            dataset.peek = 'file does not exist'
+            dataset.blurb = 'file purged from disk'
+
+
 class Ms2(Text):
     file_ext = "ms2"