예제 #1
0
 def execute(self):
     self.stdoutToHistory()
     #print self.params
     #tracks = self.params['track1'].split(':')
     username = self.params['userEmail'] if self.params.has_key('userEmail') else ''
     track = self.params['track1'] if self.params.has_key('track1') else []
     print 'GalaxyInterface.startPreProcessing', (self.genome, track, username)
     GalaxyInterface.startPreProcessing(self.genome, track, username)
 def execute(self):
     self.stdoutToHistory()
     #print self.params
     #tracks = self.params['track1'].split(':')
     username = self.params['userEmail'] if self.params.has_key(
         'userEmail') else ''
     track = self.params['track1'] if self.params.has_key('track1') else []
     print 'GalaxyInterface.startPreProcessing', (self.genome, track,
                                                  username)
     GalaxyInterface.startPreProcessing(self.genome, track, username)
예제 #3
0
def reinstallGenomes(genomeList, username, genomeListIsFn='True', verbose='False'):
    "genomeList username genomeListIsFn=True verbose=False"
    from quick.application.GalaxyInterface import GalaxyInterface
    from gold.util.CustomExceptions import PreprocessError
    from quick.extra.StandardizeTrackFiles import PlainMover
    from config.Config import DebugConfig

    genomeListIsFn = ast.literal_eval(genomeListIsFn)
    verbose = ast.literal_eval(verbose)

    prevPassOnPreprocessExceptions = DebugConfig.PASS_ON_PREPROCESS_EXCEPTIONS
    prevVerbose = DebugConfig.VERBOSE
    DebugConfig.PASS_ON_PREPROCESS_EXCEPTIONS = True
    DebugConfig.VERBOSE = verbose

    track_cats = ['Sequence:DNA', 'Genome build properties', 'Genes and gene subsets', 'Sample data']

    if genomeListIsFn:
        genomes = [_.strip() for _ in open(genomeList)]
    else:
        genomes = genomeList.split(',')

    for genome in genomes:
        genome = genome.strip()
        print genome

        if GenomeInfo(genome).installed and GenomeInfo._queryShelveWithKey(genome, 'r', old=False) is not None:
            # Trigger installation double-check
            gi = GenomeInfo(genome)
            gi.installed = False
            gi.store()
            if gi.isInstalled():
                print '\n**Genome "{}" was alread installed in the new shelve. Skipping!**\n'.format(genome)
                continue

        for track_cat in track_cats:
            try:
                GalaxyInterface.startPreProcessing(genome, track_cat.split(':'), username)
            except PreprocessError, e:
                traceback.print_exc()
                print

                match = re.search(r'trackName="([^"]+)"', str(e))
                if match:
                    trackName = match.group(1).split(':')
                    PlainMover.parseFiles(genome, trackName, 'std_to_error')
                    print '\n\n**Moved track "{}" to "parsingErrorTracks" file structure**\n'.format(':'.join(trackName))

        genome_info = GenomeInfo(genome)
        installed = genome_info.flagAsInstalled(username)
        if installed:
            print '\n**Genome "{}" was reinstalled successfully!**\n'.format(genome)
        else:
            print '\n**Genome "{}" was not reinstalled!**\n'.format(genome)