Repository 'proteomics_datatypes'
hg clone https://toolshed.g2.bx.psu.edu/repos/iracooke/proteomics_datatypes

Changeset 4:09b89b345de2 (2013-06-09)
Previous changeset 3:463328a6967f (2013-03-04) Next changeset 5:df8b867ab71a (2014-02-07)
Commit message:
Update
modified:
datatypes_conf.xml
proteomics.py
b
diff -r 463328a6967f -r 09b89b345de2 datatypes_conf.xml
--- a/datatypes_conf.xml Mon Mar 04 19:00:50 2013 -0500
+++ b/datatypes_conf.xml Sun Jun 09 08:16:08 2013 -0500
b
@@ -3,7 +3,10 @@
   <datatype_files>
     <datatype_file name="proteomics.py"/>
   </datatype_files>
-  <registration display_path="display_applications">
+  <registration display_path="display_applications">
+    <datatype extension="prot_gff" type="galaxy.datatypes.proteomics:ProtGff" mimetype="application/xml" display_in_upload="true">
+       <display file="proteomics/ProtGff.xml" />
+    </datatype>
     <datatype extension="pepxml" type="galaxy.datatypes.proteomics:PepXml" mimetype="application/xml" display_in_upload="true">
       <display file="proteomics/PepXml.xml" />
     </datatype>
@@ -35,6 +38,7 @@
     <datatype extension="hlf" type="galaxy.datatypes.proteomics:XHunterAslFormat" display_in_upload="true" />
   </registration>
   <sniffers>
+    <sniffer type="galaxy.datatypes.proteomics:ProtGff"/>
     <sniffer type="galaxy.datatypes.proteomics:MzML"/>        
     <sniffer type="galaxy.datatypes.proteomics:PepXml"/>
     <sniffer type="galaxy.datatypes.proteomics:Mgf"/>
b
diff -r 463328a6967f -r 09b89b345de2 proteomics.py
--- a/proteomics.py Mon Mar 04 19:00:50 2013 -0500
+++ b/proteomics.py Sun Jun 09 08:16:08 2013 -0500
b
@@ -7,9 +7,34 @@
 from galaxy.datatypes.xml import *
 from galaxy.datatypes.sniff import *
 from galaxy.datatypes.binary import *
+from galaxy.datatypes.interval import *
 
 log = logging.getLogger(__name__)
 
+class ProtGff( Gff ):
+    """Tab delimited data in Gff format"""
+    file_ext = "prot_gff"
+    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 = 'Proteogenomics GFF'
+        else:
+            dataset.peek = 'file does not exist'
+            dataset.blurb = 'file purged from disk'
+
+    def sniff( self, filename ):
+        handle = open(filename)
+        xmlns_re = re.compile("^##gff-version")
+        for i in range(3):
+            line = handle.readline()
+            if xmlns_re.match(line.strip()):
+                handle.close()
+                return True
+
+        handle.close()
+        return False
+
 
 class Xls( Binary ):
     """Class describing a binary excel spreadsheet file"""