commit/galaxy-central: 4 new changesets
4 new commits in galaxy-central: https://bitbucket.org/galaxy/galaxy-central/commits/dd67f14145f7/ Changeset: dd67f14145f7 Branch: rna_eps_format User: BjoernGruening Date: 2015-01-06 16:17:39+00:00 Summary: Add RNA dotplot matrix file type. This is a EPS file with additional informations. Affected #: 2 files diff -r d50ee9520583c225e48c577ab977f18fd6cb7d6a -r dd67f14145f75cbbe9ab3e73d40088a669139f07 lib/galaxy/datatypes/sequence.py --- a/lib/galaxy/datatypes/sequence.py +++ b/lib/galaxy/datatypes/sequence.py @@ -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, image=None): + """Determine if the file is in RNA dot plot format.""" + 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 + diff -r d50ee9520583c225e48c577ab977f18fd6cb7d6a -r dd67f14145f75cbbe9ab3e73d40088a669139f07 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 https://bitbucket.org/galaxy/galaxy-central/commits/e89b5465e914/ Changeset: e89b5465e914 Branch: rna_eps_format User: BjoernGruening Date: 2015-01-06 16:18:01+00:00 Summary: add rna_eps filetype Affected #: 1 file diff -r dd67f14145f75cbbe9ab3e73d40088a669139f07 -r e89b5465e914bec84d946c6163b415ebd57a038e 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"/> @@ -302,6 +303,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"/> https://bitbucket.org/galaxy/galaxy-central/commits/f5278f9e74a2/ Changeset: f5278f9e74a2 Branch: rna_eps_format User: BjoernGruening Date: 2015-01-06 17:54:03+00:00 Summary: Only walk through the file if it is a EPS file. Affected #: 1 file diff -r e89b5465e914bec84d946c6163b415ebd57a038e -r f5278f9e74a2e2855bf6661dc998d37abc6f86ff 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" ) @@ -826,22 +826,22 @@ dataset.peek = 'file does not exist' dataset.blurb = 'file purged from disk' - def sniff(self, filename, image=None): + def sniff(self, filename): """Determine if the file is in RNA dot plot format.""" - 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 - + 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 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.
participants (1)
-
commits-noreply@bitbucket.org