def extractTestGenomeAndPreProcess(galaxy_dir): hbPath = os.path.join(galaxy_dir, 'lib', 'hb') from config.Config import ORIG_DATA_PATH from gold.origdata.PreProcessTracksJob import PreProcessAllTracksJob from setup.InstallFunctions import executeShellCmd from gold.util.CommonFunctions import createDirPath from quick.util.GenomeInfo import GenomeInfo from quick.application.ProcTrackOptions import ProcTrackOptions from gold.description.TrackInfo import TrackInfo import shutil testGenomeFn = os.sep.join([hbPath, 'data', 'TestGenome.tar.gz']) executeShellCmd('tar xfz %s --keep-newer-files -C %s' % (testGenomeFn, ORIG_DATA_PATH), \ pipe=False, printError=True, onError='exit') print 'OK: Extracted TestGenome files.' PreProcessAllTracksJob.PASS_ON_EXCEPTIONS = True try: PreProcessAllTracksJob('TestGenome').process() PreProcessAllTracksJob( 'TestGenome', GenomeInfo.getChrTrackName('TestGenome')).process() print 'OK: Finished preprocessing TestGenome.' except Exception, e: print 'FAILED: Error when preprocessing TestGenome. Error:' print ' ' + str(e).strip() sys.exit(1)
def createNewTrack(self, outTrackName, username=''): print 'Creating segmentation...' self.extractToFile( createOrigPath(self._genome, outTrackName, 'generated'), outTrackName) print 'Preprocessing segmentation...' PreProcessAllTracksJob(self._genome, outTrackName, username=username).process()
def _preProcess(self, trackName): self._removeDir( createDirPath(trackName, self.GENOME, allowOverlaps=False), trackName) self._removeDir( createDirPath(trackName, self.GENOME, allowOverlaps=True), trackName) PreProcessAllTracksJob(self.GENOME, trackName, username="******").process()
def createGenome(cls, genome, fullName, chromNamesDict, standardChromosomes, username=''): basePath = cls.getBasePathSequence(genome) trackName=GenomeInfo.getSequenceTrackName(genome) print "Splitting genome file into chromosomes." SplitFasta.parseFiles(genome, trackName, chromNamesDict=chromNamesDict) print "Processing genome" PreProcessAllTracksJob(genome).process() #print "Writing name file.:", fullName #nameFn=createOrigPath(genome,[], "_name.txt" if experimental else "#name.txt") #ensurePathExists(nameFn) #f=open(nameFn, "w") #f.write(fullName) #f.close() print "Creating chromosome file" createChromosomeFile(genome, ",".join(standardChromosomes)) print "Creating assembly gaps file" createAssemblyGapsFile(genome) print "Generating genome annotations (if any)" cls.generateGenomeAnnotations(genome) print "Processing genome" PreProcessAllTracksJob(genome).process() print genome + " genome added"
def _preProcess(self, subTrackName, noOverlapsFileCount=None, withOverlapsFileCount=None, noOverlapsChrElCount=None, withOverlapsChrElCount=None): trackName = self.TRACK_NAME_PREFIX + subTrackName self._removePreprocessedTrackData(trackName) # aeval = Interpreter() # aeval.symtable.update({'PreProcessAllTracksJob': PreProcessAllTracksJob}) # cmd = "PreProcessAllTracksJob(" + repr(self.GENOME) + "," + \ # repr(trackName) + ", username='******').process()" # aeval(cmd) PreProcessAllTracksJob(self.GENOME, trackName, username='******').process() self._assertCounts(trackName, noOverlapsFileCount, withOverlapsFileCount, noOverlapsChrElCount, withOverlapsChrElCount) self._assertHasTrackFormatHash(trackName)
def preProcessTrackData(genome, tn, username): from gold.origdata.PreProcessTracksJob import PreProcessAllTracksJob PreProcessAllTracksJob(genome, tn, username=username, mergeChrFolders=True).process()