1 new commit in galaxy-central: https://bitbucket.org/galaxy/galaxy-central/commits/7f27fc6cb8b6/ Changeset: 7f27fc6cb8b6 User: dannon Date: 2015-01-12 21:55:10+00:00 Summary: Merged in BjoernGruening/galaxy-central-1/rna_eps_format (pull request #625) Add RNA dotplot matrix as datatype. Affected #: 3 files diff -r 748cb48d79e8c3770623a0a76e2b56e332b19cc7 -r 7f27fc6cb8b6fa31b24267a25ee375ef346dde02 config/datatypes_conf.xml.sample --- a/config/datatypes_conf.xml.sample +++ b/config/datatypes_conf.xml.sample @@ -140,6 +140,7 @@ <datatype extension="rgb" type="galaxy.datatypes.images:Rgb" mimetype="image/rgb"/><datatype extension="pbm" type="galaxy.datatypes.images:Pbm" mimetype="image/pbm"/><datatype extension="pgm" type="galaxy.datatypes.images:Pgm" mimetype="image/pgm"/> + <datatype extension="rna_eps" type="galaxy.datatypes.sequence:RNADotPlotMatrix" mimetype="image/eps" display_in_upload="True"/><datatype extension="eps" type="galaxy.datatypes.images:Eps" mimetype="image/eps"/><datatype extension="rast" type="galaxy.datatypes.images:Rast" mimetype="image/rast"/><datatype extension="laj" type="galaxy.datatypes.images:Laj"/> @@ -304,6 +305,7 @@ <sniffer type="galaxy.datatypes.text:Arff"/><sniffer type="galaxy.datatypes.text:Ipynb"/><sniffer type="galaxy.datatypes.text:Json"/> + <sniffer type="galaxy.datatypes.sequence:RNADotPlotMatrix"/><sniffer type="galaxy.datatypes.images:Jpg"/><sniffer type="galaxy.datatypes.images:Png"/><sniffer type="galaxy.datatypes.images:Tiff"/> diff -r 748cb48d79e8c3770623a0a76e2b56e332b19cc7 -r 7f27fc6cb8b6fa31b24267a25ee375ef346dde02 lib/galaxy/datatypes/sequence.py --- a/lib/galaxy/datatypes/sequence.py +++ b/lib/galaxy/datatypes/sequence.py @@ -17,7 +17,7 @@ from galaxy.datatypes.checkers import is_gzip from galaxy.datatypes.sniff import get_test_fname, get_headers from galaxy.datatypes.metadata import MetadataElement - +from galaxy.datatypes.util.image_util import check_image_type try: eggs.require( "bx-python" ) @@ -814,3 +814,34 @@ except: return False + +class RNADotPlotMatrix( data.Data ): + file_ext = "rna_eps" + + def set_peek( self, dataset, is_multi_byte=False ): + if not dataset.dataset.purged: + dataset.peek = 'RNA Dot Plot format (Postscript derivative)' + dataset.blurb = data.nice_size( dataset.get_size() ) + else: + dataset.peek = 'file does not exist' + dataset.blurb = 'file purged from disk' + + def sniff(self, filename): + """Determine if the file is in RNA dot plot format.""" + if check_image_type( filename, ['EPS'] ): + seq = False + coor = False + pairs = False + with open( filename ) as handle: + for line in handle: + line = line.strip() + if line: + if line.startswith('/sequence'): + seq = True + elif line.startswith('/coor'): + coor = True + elif line.startswith('/pairs'): + pairs = True + if seq and coor and pairs: + return True + return False \ No newline at end of file diff -r 748cb48d79e8c3770623a0a76e2b56e332b19cc7 -r 7f27fc6cb8b6fa31b24267a25ee375ef346dde02 lib/galaxy/datatypes/util/image_util.py --- a/lib/galaxy/datatypes/util/image_util.py +++ b/lib/galaxy/datatypes/util/image_util.py @@ -71,6 +71,4 @@ return 'pbm' if format == 'PGM': return 'pgm' - if format == 'EPS': - return 'eps' return None Repository URL: https://bitbucket.org/galaxy/galaxy-central/ -- This is a commit notification from bitbucket.org. You are receiving this because you have the service enabled, addressing the recipient of this email.