changeset 0:f7801f8191e0 draft

Uploaded
author geert-vandeweyer
date Mon, 04 Aug 2014 08:26:15 -0400
parents
children e12a09256097
files README cuffquant.py datatypes_conf.xml
diffstat 3 files changed, 63 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/README	Mon Aug 04 08:26:15 2014 -0400
@@ -0,0 +1,6 @@
+## What is it?
+Galaxy datatype definitions for Cuffquant output data (cxb file). Cuffquant is available starting from cufflinks 2.2.0. Wrappers are available from the toolshed.
+
+## Installation
+Install into your local galaxy instance from the galaxy toolshed at http://testtoolshed.g2.bx.psu.edu/ or http://toolshed.g2.bx.psu.edu/
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/cuffquant.py	Mon Aug 04 08:26:15 2014 -0400
@@ -0,0 +1,45 @@
+"""
+Cuffquant format class
+"""
+import logging
+import re
+import binascii
+
+from galaxy.ddatatypes.sniff import *
+from galaxy.datatypes import data
+from galaxy.datatypes.data import Text
+from galaxy.datatypes.xml import GenericXml
+from galaxy.datatypes.binary import Binary
+from galaxy.datatypes.tabular import Tabular
+from galaxy.datatypes.interval import Gff
+
+log = logging.getLogger(__name__)
+
+class Cuffquant( Binary ):
+  """Class describing a CuffQuant output file"""
+  file_ext = "cxb"
+  def sniff(self,filename):
+	# cuffquant cxb file is not documented. the file seems to start with 'serialization::'
+	try:
+	  header = open(filename).read(23)
+	  if header == 'serialization::':
+		return True
+          return False
+        except:
+	  return False
+  
+  def set_peek( self, dataset, is_multi_byte=False):
+	if not dataset.dataset.purged:
+	  dataset.peek = 'Cuffquant cxb file'
+  	  dataset.blurb = data.nice_size( dataset.get_size())
+  	else:
+	  dataset.peek = 'file does not exist'
+	  dataset.blurb = 'file purged from disk'
+  def display_peek (self,dataset):
+	try:
+	  return dataset.peek
+	except:
+	  return "Cuffquant output file (%s)" % ( data.nice_size( dataset.get_size() ) )  
+
+if hasattr(Binary, 'register_sniffable_binary_format'):
+    Binary.register_sniffable_binary_format('cxb', 'cxb', Cuffquant)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/datatypes_conf.xml	Mon Aug 04 08:26:15 2014 -0400
@@ -0,0 +1,12 @@
+<?xml version="1.0"?>
+<datatypes>
+  <datatype_files>
+    <datatype_file name="cuffquant.py"/>
+  </datatype_files>
+  <registration>
+	<datatype extension="cxb" type="galaxy.datatypes.binary:Cuffquant" mimetype="application/octet-stream" subclass="True" display_in_upload="True" />
+  </registration>
+  <sniffers >
+	<sniffer type="galaxy.datatypes.binary:Cuffquant"/>
+  </sniffers>
+</datatypes>