# HG changeset patch # User mish # Date 1398245123 14400 # Node ID d00379767dbf75a63cd0eb63b3a62387b34bcd15 Uploaded diff -r 000000000000 -r d00379767dbf xcms_datatypes/.hg_archival.txt --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/xcms_datatypes/.hg_archival.txt Wed Apr 23 05:25:23 2014 -0400 @@ -0,0 +1,5 @@ +repo: d2c59f917d24d97293bbeb1efb48ae8292cae463 +node: 284ba0d136f9dff81b43abc91785d8a437abb637 +branch: default +latesttag: null +latesttagdistance: 2 diff -r 000000000000 -r d00379767dbf xcms_datatypes/README.txt --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/xcms_datatypes/README.txt Wed Apr 23 05:25:23 2014 -0400 @@ -0,0 +1,57 @@ +README +----------------------------------------------------------------------- + XCMS Suite datatypes: A Workflow for metabolomics by ABIMS team +----------------------------------------------------------------------- + +This package contains the datatypes for the XCMS suite. + +-------------------------------------------------------------------- +Instructions for integration of the XCMS datatypes into the workflow-system +Galaxy (http://getgalaxy.org) +-------------------------------------------------------------------- + +In order to install the datatypes for the XCMS Suite into your Galaxy installation, please do the following: + +$galaxybase: Your galaxy-dist location + +-- Add the two datatypes and sniffer to the $galaxybase/datatypes_conf.xml + + + + + +-- Copy xcms.py to $galaxybase/lib/galaxy/datatypes/ + +-- Add "import xcms" to the beginning of the file $galaxybase/lib/galaxy/datatypes/registry.py + +-- Modify the $galaxybase/tools/data_source/upload.py: + + + -At the beginning of the file, put this line : + from galaxy.datatypes.xcms import * + -Then add the function: + def check_ms_zip( file_name ): + return MSZip().sniff( file_name ) + -Add the following lines between the two : + + if image: + if not PIL: + image = None + # get_image_ext() returns None if nor a supported Image type + ext = get_image_ext( dataset.path, image ) + data_type = ext + # Is dataset content multi-byte? + elif dataset.is_multi_byte: + data_type = 'multi-byte char' + ext = sniff.guess_ext( dataset.path, is_multi_byte=True ) + # + # Is dataset content supported Abims datatype + elif check_ms_zip( dataset.name ): + ext = 'ms_zip' + data_type = 'ms_zip' + # + # Is dataset content supported sniffable binary? + + + +Last but not least, restart Galaxy. diff -r 000000000000 -r d00379767dbf xcms_datatypes/datatypes_conf.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/xcms_datatypes/datatypes_conf.xml Wed Apr 23 05:25:23 2014 -0400 @@ -0,0 +1,14 @@ + + + + + + + + + + + + + + diff -r 000000000000 -r d00379767dbf xcms_datatypes/xcms.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/xcms_datatypes/xcms.py Wed Apr 23 05:25:23 2014 -0400 @@ -0,0 +1,51 @@ +""" +XCMS datatypes +""" + +import logging +import os,os.path,re +import galaxy.datatypes.data +from galaxy.datatypes.data import Data +from galaxy.datatypes.binary import Binary +from galaxy.datatypes.metadata import MetadataElement + +log = logging.getLogger(__name__) + +class RData( Binary ): + """ + A R session Image + """ + + file_ext = 'rdata' + is_binary = True + + + +class MSZip( Data ): + """ + A zip container for xcms input files + """ + + file_ext = 'ms_zip' + is_binary = False + + def sniff( self, filename ): + """ + Check REAL file name (dataset.name) and NOT tmp file name (dataset.path) for ".ms.zip" extension + """ + try: + return (filename[-7:] == '.ms.zip') + except: + return False + + + + + + + + + + + +