def updateStandardFoldersForAllGenomes(): for genomeinfo in GalaxyInterface.getAllGenomes(): genome = genomeinfo[1] if genome == "hg18": #trengs dette? genome = "hg18" if genome == "TestGenome": ############### ta bort for aa oppdatere alle genomer. updateOrCreateStandardFolders(genome)
def updateTrackFolderStatistics(): print('inne i updateTrackFolderStatistics') #trackInfoShelve = safeshelve.open(SHELVE_FN, 'w') for genomeinfo in GalaxyInterface.getAllGenomes(): genome = genomeinfo[1] if genome=="hg18": genome="hg18" print "dirname=",genome thisntracks=0 thisndirs=0 for startparenttrack in GalaxyInterface.getMainTrackNames(genome): #print "startparenttrack=",startparenttrack firstparenttrack=[startparenttrack[0]] ndirs,ntracks = countSubTracks(genome,firstparenttrack , 0 ) thisndirs=thisndirs+ndirs thisntracks=thisntracks+ntracks # put counts into genomeinfo.shelve? print('plan to update genomeinfo', genome, ' set number of folders to ', thisndirs, ' and number of tracks to ', thisntracks)
def updateTrackFolderStatistics(): print('inne i updateTrackFolderStatistics') #trackInfoShelve = safeshelve.open(SHELVE_FN, 'w') for genomeinfo in GalaxyInterface.getAllGenomes(): genome = genomeinfo[1] if genome == "hg18": genome = "hg18" print "dirname=", genome thisntracks = 0 thisndirs = 0 for startparenttrack in GalaxyInterface.getMainTrackNames(genome): #print "startparenttrack=",startparenttrack firstparenttrack = [startparenttrack[0]] ndirs, ntracks = countSubTracks(genome, firstparenttrack, 0) thisndirs = thisndirs + ndirs thisntracks = thisntracks + ntracks # put counts into genomeinfo.shelve? print('plan to update genomeinfo', genome, ' set number of folders to ', thisndirs, ' and number of tracks to ', thisntracks)
def execute(choices, galaxyFn=None, username=''): '''Is called when execute-button is pushed by web-user. Should print output as HTML to standard out, which will be directed to a results page in Galaxy history. If needed, StaticFile can be used to get a path where additional files can be put (e.g. generated image files). choices is a list of selections made by web-user in each options box. ''' genomesList = [] for v in GalaxyInterface.getAllGenomes(username): if choices[3].get(v[0]): if choices[3][v[0]] and isdir(createDirPath(choices[1].split(':'),v[1])): genomesList.append(v[1]) #genomesList = [v[1] for v in GalaxyInterface.getAllGenomes(username) if choices[3][v[0]] and isdir(createDirPath(choices[1].split(':'),v[1]))] #print 'Executing...' genomes = [choices[0]] + genomesList oldTn = choices[1] newTn = choices[2] for genome in genomes: renameTrack(genome, oldTn.split(':'), newTn.split(':')) print '%s renamed to %s in genome %s.' % (oldTn, newTn, genome)