示例#1
0
    def set_meta(self, dataset, **kwd):
        """
        for lped/pbed eg

        """
        Html.set_meta(self, dataset, **kwd)
        if not kwd.get('overwrite'):
            if verbose:
                gal_Log.debug('@@@ rgenetics set_meta called with overwrite = False')
            return True
        try:
            efp = dataset.extra_files_path
        except Exception:
            if verbose:
                gal_Log.debug('@@@rgenetics set_meta failed %s - dataset %s has no efp ?' % (sys.exc_info()[0], dataset.name))
            return False
        try:
            flist = os.listdir(efp)
        except Exception:
            if verbose:
                gal_Log.debug('@@@rgenetics set_meta failed %s - dataset %s has no efp ?' % (sys.exc_info()[0], dataset.name))
            return False
        if len(flist) == 0:
            if verbose:
                gal_Log.debug('@@@rgenetics set_meta failed - %s efp %s is empty?' % (dataset.name, efp))
            return False
        self.regenerate_primary_file(dataset)
        if not dataset.info:
            dataset.info = 'Galaxy genotype datatype object'
        if not dataset.blurb:
            dataset.blurb = 'Composite file - Rgenetics Galaxy toolkit'
        return True
示例#2
0
    def set_meta( self, dataset, **kwd ):

        """
        for lped/pbed eg

        """
        Html.set_meta( self, dataset, **kwd )
        if not kwd.get('overwrite'):
            if verbose:
                gal_Log.debug('@@@ rgenetics set_meta called with overwrite = False')
            return True
        try:
            efp = dataset.extra_files_path
        except:
            if verbose:
                gal_Log.debug('@@@rgenetics set_meta failed %s - dataset %s has no efp ?' % (sys.exc_info()[0], dataset.name))
            return False
        try:
            flist = os.listdir(efp)
        except:
            if verbose:
                gal_Log.debug('@@@rgenetics set_meta failed %s - dataset %s has no efp ?' % (sys.exc_info()[0], dataset.name))
            return False
        if len(flist) == 0:
            if verbose:
                gal_Log.debug('@@@rgenetics set_meta failed - %s efp %s is empty?' % (dataset.name, efp))
            return False
        self.regenerate_primary_file(dataset)
        if not dataset.info:
            dataset.info = 'Galaxy genotype datatype object'
        if not dataset.blurb:
            dataset.blurb = 'Composite file - Rgenetics Galaxy toolkit'
        return True
示例#3
0
 def set_meta(self, dataset, **kwd):
     Html.set_meta(self, dataset, **kwd)
     for fname in os.listdir(dataset.extra_files_path):
         if fname.startswith("chromosomes"):
             dataset.metadata.chrom_bed = os.path.join(dataset.extra_files_path, fname)
         elif fname.startswith("chromosome_windows"):
             dataset.metadata.chrom_windows = os.path.join(dataset.extra_files_path, fname)
         elif fname.startswith("IDEAS_input_config"):
             dataset.metadata.input_config = os.path.join(dataset.extra_files_path, fname)
         elif fname.startswith("tmp"):
             dataset.metadata.tmp_archive = os.path.join(dataset.extra_files_path, fname)
     self.regenerate_primary_file(dataset)
示例#4
0
 def set_meta(self, dataset, **kwd):
     Html.set_meta(self, dataset, **kwd)
     for fname in os.listdir(dataset.extra_files_path):
         if fname.startswith("chromosomes"):
             dataset.metadata.chrom_bed = os.path.join(dataset.extra_files_path, fname)
         elif fname.startswith("chromosome_windows"):
             dataset.metadata.chrom_windows = os.path.join(dataset.extra_files_path, fname)
         elif fname.startswith("IDEAS_input_config"):
             dataset.metadata.input_config = os.path.join(dataset.extra_files_path, fname)
         elif fname.startswith("tmp"):
             dataset.metadata.tmp_archive = os.path.join(dataset.extra_files_path, fname)
     self.regenerate_primary_file(dataset)
示例#5
0
    def set_meta(self, dataset, **kwd):
        """
        NOTE we apply the tabular machinary to the phenodata extracted
        from a BioC eSet or affybatch.

        """
        Html.set_meta(self, dataset, **kwd)
        try:
            flist = os.listdir(dataset.extra_files_path)
        except Exception:
            if verbose:
                gal_Log.debug('@@@rexpression set_meta failed - no dataset?')
            return False
        bn = dataset.metadata.base_name
        if not bn:
            for f in flist:
                n = os.path.splitext(f)[0]
                bn = n
                dataset.metadata.base_name = bn
        if not bn:
            bn = '?'
            dataset.metadata.base_name = bn
        pn = '%s.pheno' % (bn)
        pp = os.path.join(dataset.extra_files_path, pn)
        dataset.metadata.pheno_path = pp
        try:
            with open(pp) as f:
                pf = f.readlines(
                )  # read the basename.phenodata in the extra_files_path
        except Exception:
            pf = None
        if pf:
            h = pf[0].strip()
            h = h.split('\t')  # hope is header
            h = [escape(x) for x in h]
            dataset.metadata.column_names = h
            dataset.metadata.columns = len(h)
            dataset.peek = ''.join(pf[:5])
        else:
            dataset.metadata.column_names = []
            dataset.metadata.columns = 0
            dataset.peek = 'No pheno file found'
        if pf and len(pf) > 1:
            dataset.metadata.pheCols = self.get_phecols(phenolist=pf)
        else:
            dataset.metadata.pheCols = [
                ('', 'No useable phenotypes found', False),
            ]
        if not dataset.info:
            dataset.info = 'Galaxy Expression datatype object'
        if not dataset.blurb:
            dataset.blurb = 'R loadable BioC expression object for the Rexpression Galaxy toolkit'
        return True
示例#6
0
    def set_meta( self, dataset, **kwd ):

        """
        NOTE we apply the tabular machinary to the phenodata extracted
        from a BioC eSet or affybatch.

        """
        Html.set_meta(self, dataset, **kwd)
        try:
            flist = os.listdir(dataset.extra_files_path)
        except:
            if verbose:
                gal_Log.debug('@@@rexpression set_meta failed - no dataset?')
            return False
        bn = dataset.metadata.base_name
        if not bn:
            for f in flist:
                n = os.path.splitext(f)[0]
                bn = n
                dataset.metadata.base_name = bn
        if not bn:
            bn = '?'
            dataset.metadata.base_name = bn
        pn = '%s.pheno' % (bn)
        pp = os.path.join(dataset.extra_files_path, pn)
        dataset.metadata.pheno_path = pp
        try:
            pf = open(pp, 'r').readlines()  # read the basename.phenodata in the extra_files_path
        except:
            pf = None
        if pf:
            h = pf[0].strip()
            h = h.split('\t')  # hope is header
            h = [escape(x) for x in h]
            dataset.metadata.column_names = h
            dataset.metadata.columns = len(h)
            dataset.peek = ''.join(pf[:5])
        else:
            dataset.metadata.column_names = []
            dataset.metadata.columns = 0
            dataset.peek = 'No pheno file found'
        if pf and len(pf) > 1:
            dataset.metadata.pheCols = self.get_phecols(phenolist=pf)
        else:
            dataset.metadata.pheCols = [('', 'No useable phenotypes found', False), ]
        if not dataset.info:
            dataset.info = 'Galaxy Expression datatype object'
        if not dataset.blurb:
            dataset.blurb = 'R loadable BioC expression object for the Rexpression Galaxy toolkit'
        return True
示例#7
0
 def __init__(self, **kwd):
     Html.__init__(self, **kwd)
     self.add_composite_file('chromosome_windows.txt',
                             description='Chromosome window positions',
                             is_binary=False,
                             optional=True)
     self.add_composite_file(
         'chromosomes.bed',
         description='Bed file specifying window positions',
         is_binary=False,
         optional=True)
     self.add_composite_file('IDEAS_input_config.txt',
                             description='IDEAS input config',
                             is_binary=False)
     self.add_composite_file(
         'tmp.tar.gz',
         description='Compressed archive of compressed bed files',
         is_binary=True)
示例#8
0
 def __init__(self, **kwd):
     Html.__init__(self, **kwd)
     self.add_composite_file('Sequences',
                             mimetype='text/html',
                             description='Sequences',
                             substitute_name_with_metadata=None,
                             is_binary=False)
     self.add_composite_file('Roadmaps',
                             mimetype='text/html',
                             description='Roadmaps',
                             substitute_name_with_metadata=None,
                             is_binary=False)
     self.add_composite_file('Log',
                             mimetype='text/html',
                             description='Log',
                             optional='True',
                             substitute_name_with_metadata=None,
                             is_binary=False)
示例#9
0
 def __init__(self, **kwd):
     Html.__init__(self, **kwd)
     self.add_composite_file('%s.pheno',
                             description='Phenodata tab text file',
                             substitute_name_with_metadata='base_name',
                             is_binary=False)
示例#10
0
 def __init__(self, **kwd):
     Html.__init__(self, **kwd)
     self.add_composite_file('%s.pheno', description='Phenodata tab text file',
                             substitute_name_with_metadata='base_name', is_binary=False)
示例#11
0
 def __init__(self, **kwd):
     Html.__init__(self, **kwd)
     self.add_composite_file('chromosome_windows.txt', description='Chromosome window positions', is_binary=False, optional=True)
     self.add_composite_file('chromosomes.bed', description='Bed file specifying window positions', is_binary=False, optional=True)
     self.add_composite_file('IDEAS_input_config.txt', description='IDEAS input config', is_binary=False)
     self.add_composite_file('tmp.tar.gz', description='Compressed archive of compressed bed files', is_binary=True)
示例#12
0
 def __init__(self, **kwd):
     Html.__init__(self, **kwd)
示例#13
0
 def set_meta( self, dataset, **kwd ):
     Html.set_meta( self, dataset, **kwd )
     self.regenerate_primary_file(dataset)
示例#14
0
 def __init__( self, **kwd ):
     Html.__init__( self, **kwd )
     self.add_composite_file( 'Sequences', mimetype='text/html', description='Sequences', substitute_name_with_metadata=None, is_binary=False )
     self.add_composite_file( 'Roadmaps', mimetype='text/html', description='Roadmaps', substitute_name_with_metadata=None, is_binary=False )
     self.add_composite_file( 'Log', mimetype='text/html', description='Log', optional='True', substitute_name_with_metadata=None, is_binary=False )
示例#15
0
 def set_meta(self, dataset, **kwd):
     Html.set_meta(self, dataset, **kwd)
     self.regenerate_primary_file(dataset)
示例#16
0
 def __init__(self, **kwd):
     Html.__init__(self, **kwd)