Ejemplo n.º 1
0
from galaxy.datatypes.binary import Binary
from galaxy.datatypes.xml import GenericXml


class Group(Binary):
    """Class describing a ProteinPilot group files"""
    file_ext = "group"


Binary.register_unsniffable_binary_ext('group')


class ProteinPilotXml(GenericXml):
    file_ext = "proteinpilot.xml"
Ejemplo n.º 2
0
from galaxy.datatypes import data
from galaxy.datatypes.binary import Binary


class Cel(Binary):
    """Class for generic CEL binary format"""
    file_ext = "cel"


Binary.register_unsniffable_binary_ext("cel")
Ejemplo n.º 3
0
            return dataset.peek
        except:
            return "HMMER3 database (multiple files)"

    def __init__(self, **kwd):
        Binary.__init__(self, **kwd)
        # Binary model
        self.add_composite_file('model.hmm.h3m', is_binary=True)
        # SSI index for binary model
        self.add_composite_file('model.hmm.h3i', is_binary=True)
        # Profiles (MSV part)
        self.add_composite_file('model.hmm.h3f', is_binary=True)
        # Profiles (remained)
        self.add_composite_file('model.hmm.h3p', is_binary=True)

Binary.register_unsniffable_binary_ext("hmmpress")


class Stockholm_1_0( Text ):
    edam_data = "data_0863"
    edam_format = "format_1961"
    file_ext = "stockholm"

    MetadataElement( name="number_of_models", default=0, desc="Number of multiple alignments", readonly=True, visible=True, optional=True, no_value=0 )

    def set_peek( self, dataset, is_multi_byte=False ):
        if not dataset.dataset.purged:
            dataset.peek = get_file_peek( dataset.file_name, is_multi_byte=is_multi_byte )
            if (dataset.metadata.number_of_models == 1):
                dataset.blurb = "1 alignment"
            else:
Ejemplo n.º 4
0
"""
k-mer count and presence
"""

from galaxy.datatypes.binary import Binary

import logging

log = logging.getLogger(__name__)


class Count(Binary):

    def __init__(self, **kwd):
        Binary.__init__(self, **kwd)


class Presence(Binary):

    def __init__(self, **kwd):
        Binary.__init__(self, **kwd)

Binary.register_unsniffable_binary_ext("ct")
Binary.register_unsniffable_binary_ext("pt")
Ejemplo n.º 5
0
        else:
            dataset.peek = 'file does not exist'
            dataset.blurb = 'file purged from disk'
    def display_peek( self, dataset ):
        try:
            return dataset.peek
        except:
            return "Audio (WAV) file (%s)" % ( data.nice_size( dataset.get_size() ) )

    def display_data(self, trans, dataset, preview=False, filename=None, to_ext=None, size=None, offset=None, **kwd):
        if preview:    
            return ("WAV audio files cannot be previewed.")
        else:
            return super(Wav, self).display_data( trans, dataset, preview, filename, to_ext, size, offset, **kwd)      

Binary.register_unsniffable_binary_ext("wav")
    
class Mp3(Binary):

    file_ext = "mp3"
    def __init__( self, **kwd ):
        Binary.__init__( self, **kwd )

    def set_peek( self, dataset, is_multi_byte=False ):
        if not dataset.dataset.purged:
            dataset.peek  = "Audio (MP3) 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 ):
Ejemplo n.º 6
0
"""
k-mer count and presence
"""

from galaxy.datatypes.binary import Binary

import logging

log = logging.getLogger(__name__)


class Count(Binary):
    def __init__(self, **kwd):
        Binary.__init__(self, **kwd)


class Presence(Binary):
    def __init__(self, **kwd):
        Binary.__init__(self, **kwd)


Binary.register_unsniffable_binary_ext("ct")
Binary.register_unsniffable_binary_ext("pt")
Ejemplo n.º 7
0
from galaxy.datatypes.binary import Binary


class Sf3(Binary):
    """Class describing a Scaffold SF3 files"""
    file_ext = "sf3"

Binary.register_unsniffable_binary_ext('sf3')
Ejemplo n.º 8
0
        rval = ['<html><head><title>Wiff Composite Dataset </title></head><p/>']
        rval.append('<div>This composite dataset is composed of the following files:<p/><ul>')
        for composite_name, composite_file in self.get_composite_files(dataset=dataset).iteritems():
            fn = composite_name
            opt_text = ''
            if composite_file.optional:
                opt_text = ' (optional)'
            if composite_file.get('description'):
                rval.append('<li><a href="%s" type="text/plain">%s (%s)</a>%s</li>' % (fn, fn, composite_file.get('description'), opt_text))
            else:
                rval.append('<li><a href="%s" type="text/plain">%s</a>%s</li>' % (fn, fn, opt_text))
        rval.append('</ul></div></html>')
        return "\n".join(rval)

if hasattr(Binary, 'register_unsniffable_binary_ext'):
    Binary.register_unsniffable_binary_ext('wiff')


class IdpDB(Binary):
    file_ext = "idpDB"

if hasattr(Binary, 'register_unsniffable_binary_ext'):
    Binary.register_unsniffable_binary_ext('idpDB')


class PepXmlReport(Tabular):
    """pepxml converted to tabular report"""
    file_ext = "tsv"

    def __init__(self, **kwd):
        Tabular.__init__(self, **kwd)
Ejemplo n.º 9
0
from galaxy.datatypes.binary import Binary
from galaxy.datatypes.xml import GenericXml


class Group( Binary ):
    """Class describing a ProteinPilot group files"""
    file_ext = "group"

Binary.register_unsniffable_binary_ext('group')


class ProteinPilotXml( GenericXml ):
    file_ext = "proteinpilot.xml"
Ejemplo n.º 10
0
        if match:
            x = match.group('resx')
            y = match.group('resy')
            fps = match.group('fps')
        else:
            x = y = fps = 0
        return x, y, fps

    def set_meta(self, dataset, **kwd):
        (x, y, fps) = self._get_resolution( dataset.file_name )
        dataset.metadata.resolution_y = y
        dataset.metadata.resolution_x = x
        dataset.metadata.fps = fps

class Mp4( Video ):
    file_ext = "mp4"

    def sniff(self, filename):
        with magic.Magic(flags=magic.MAGIC_MIME_TYPE) as m:
            return m.id_filename(filename) is 'video/mp4'
#Binary.register_unsniffable_binary_ext("mp4")

class Flv( Video ):
    file_ext = "flv"

    def sniff(self, filename):
        with magic.Magic(flags=magic.MAGIC_MIME_TYPE) as m:
            return m.id_filename(filename) is 'video/x-flv'

Binary.register_unsniffable_binary_ext("flv")
Ejemplo n.º 11
0
            if composite_file.optional:
                opt_text = ' (optional)'
            if composite_file.get('description'):
                rval.append(
                    '<li><a href="%s" type="text/plain">%s (%s)</a>%s</li>' %
                    (fn, fn, composite_file.get('description'), opt_text))
            else:
                rval.append(
                    '<li><a href="%s" type="text/plain">%s</a>%s</li>' %
                    (fn, fn, opt_text))
        rval.append('</ul></div></html>')
        return "\n".join(rval)


if hasattr(Binary, 'register_unsniffable_binary_ext'):
    Binary.register_unsniffable_binary_ext('wiff')


class IdpDB(Binary):
    file_ext = "idpDB"


if hasattr(Binary, 'register_unsniffable_binary_ext'):
    Binary.register_unsniffable_binary_ext('idpDB')


class PepXmlReport(Tabular):
    """pepxml converted to tabular report"""
    file_ext = "tsv"

    def __init__(self, **kwd):
Ejemplo n.º 12
0
from galaxy.datatypes import data
from galaxy.datatypes.binary import Binary

class Cel( Binary ):
    """Class for generic CEL binary format"""
    file_ext = "cel"
Binary.register_unsniffable_binary_ext("cel")