本文整理汇总了Python中quick.util.GenomeInfo.GenomeInfo.getSequenceTrackName方法的典型用法代码示例。如果您正苦于以下问题:Python GenomeInfo.getSequenceTrackName方法的具体用法?Python GenomeInfo.getSequenceTrackName怎么用?Python GenomeInfo.getSequenceTrackName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类quick.util.GenomeInfo.GenomeInfo
的用法示例。
在下文中一共展示了GenomeInfo.getSequenceTrackName方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: execute
# 需要导入模块: from quick.util.GenomeInfo import GenomeInfo [as 别名]
# 或者: from quick.util.GenomeInfo.GenomeInfo import getSequenceTrackName [as 别名]
def execute(cls, 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.
'''
#print 'Executing... with choices %s'%str(choices)
abbrv = choices[0]
name = choices[1]
#Should test that the genome is not in hyperbrowser.
gi = GenomeInfo(abbrv)
if gi.hasOrigFiles():
sys.stderr.write( "Genome "+abbrv+ " is already in the Genomic HyperBrowser. Remove the old first.")
else:
gi.fullName = name
if choices[2] == 'URL':
urls = choices[3].split()
gi.sourceUrls = urls
for url in urls:
try:
GenomeImporter.downloadGenomeSequence(abbrv, url)
except InvalidFormatError:
return
else:
basePath = os.sep.join([NONSTANDARD_DATA_PATH, abbrv] + GenomeInfo.getSequenceTrackName(abbrv))
fnSource = ExternalTrackManager.extractFnFromGalaxyTN(choices[4].split(':'))
fnDest = basePath+'/'+abbrv+'Sequence.fasta'
ensurePathExists(fnDest)
copyfile(fnSource, fnDest)
chrs=GenomeImporter.extractChromosomesFromGenome(abbrv)
gi.sourceChrNames = chrs
gi.installedBy = username
gi.genomeBuildSource = choices[5]
gi.genomeBuildName = choices[6]
gi.species = choices[7]
gi.speciesTaxonomyUrl = choices[8]
gi.assemblyDetails = choices[9]
gi.privateAccessList = [v.strip() for v in choices[10].replace(os.linesep, ' ').replace(',', ' ').split(' ') if v.find('@')>0]
gi.isPrivate = (choices[11] != 'All')
gi.isExperimental = (choices[12] != 'All')
gi.ucscClade = choices[13]
gi.ucscGenome = choices[14]
gi.ucscAssembly = choices[15]
galaxyFile=open(galaxyFn, "w")
galaxyFile.write( 'Genome abbreviation: ' + abbrv + os.linesep)
galaxyFile.write( 'Genome full name: ' + name + os.linesep)
galaxyFile.write( 'Track name: ' + ':'.join(GenomeInfo.getSequenceTrackName(abbrv)) + os.linesep)
galaxyFile.write( 'Temp chromosome names: ' + ' || '.join(chrs) + os.linesep)
#GenomeImporter.saveTempInfo(abbrv, name, chrs)
#print 'Chromosomes: '+chrs
gi.store()
示例2: execute
# 需要导入模块: from quick.util.GenomeInfo import GenomeInfo [as 别名]
# 或者: from quick.util.GenomeInfo.GenomeInfo import getSequenceTrackName [as 别名]
def execute(cls, 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 getOutputFormat is anything else than HTML, the
output should be written to the file with path galaxyFn. 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.
'''
try:
historyInputTN = choices[0].split(':') #from history
historyGalaxyFn = ExternalTrackManager.extractFnFromGalaxyTN( historyInputTN) #same as galaxyFn in execute of create benchmark..
randomStatic = RunSpecificPickleFile(historyGalaxyFn) #finds path to static file created for a previous history element, and directs to a pickle file
myInfo = randomStatic.loadPickledObject()
except:
return None
galaxyTN = myInfo[3].split(':')
myFileName = ExternalTrackManager.extractFnFromGalaxyTN(galaxyTN)
genome = myInfo[0]
gtrackSource = GtrackGenomeElementSource(myFileName, genome)
regionList = []
for obj in gtrackSource:
regionList.append(GenomeRegion(obj.genome, obj.chr, obj.start, obj.end))
extractor = TrackExtractor()
fn = extractor.extract(GenomeInfo.getSequenceTrackName(genome), regionList, galaxyFn, 'fasta')
示例3: createNmerChains
# 需要导入模块: from quick.util.GenomeInfo import GenomeInfo [as 别名]
# 或者: from quick.util.GenomeInfo.GenomeInfo import getSequenceTrackName [as 别名]
def createNmerChains(self, n):
for chr in GenomeInfo.getChrList(self._genome):
print 'Creating chains of nmers of length ', n, ' for chromosome ', chr
chrLen = GenomeInfo.getChrLen(self._genome,chr)
chrReg = GenomeRegion( self._genome, chr, 0, chrLen )
seqTV = PlainTrack( GenomeInfo.getSequenceTrackName(self._genome) ).getTrackView(chrReg)
#nmersAsInts = NmerAsIntSlidingWindow(n, FuncValTvWrapper(seqTV))
nmersAsInts = NmerAsIntSlidingWindow(n, seqTV.valsAsNumpyArray())
SameValueIndexChainsFactory.generate( nmersAsInts, chrLen, 4**n, self._createPath(n), chr )
示例4: retrieveTrack
# 需要导入模块: from quick.util.GenomeInfo import GenomeInfo [as 别名]
# 或者: from quick.util.GenomeInfo.GenomeInfo import getSequenceTrackName [as 别名]
def retrieveTrack(self, regionTrackName, fastaFileName):
regionTrackName = regionTrackName.split(':')
myFileName = ExternalTrackManager.extractFnFromGalaxyTN(regionTrackName)
gtrackSource = GtrackGenomeElementSource(myFileName, self._genome)
regionList = []
for obj in gtrackSource:
regionList.append(GenomeRegion(obj.genome, obj.chr, obj.start, obj.end))
return self._extractor.extract(GenomeInfo.getSequenceTrackName(self._genome), regionList, fastaFileName, 'fasta')
示例5: createGenome
# 需要导入模块: from quick.util.GenomeInfo import GenomeInfo [as 别名]
# 或者: from quick.util.GenomeInfo.GenomeInfo import getSequenceTrackName [as 别名]
def createGenome(cls, genome, fullName, chromNamesDict, standardChromosomes, username=''):
basePath = cls.getBasePath(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("Processing genome")
PreProcessAllTracksJob(genome).process()
print(genome + " genome added")
示例6: getBasePath
# 需要导入模块: from quick.util.GenomeInfo import GenomeInfo [as 别名]
# 或者: from quick.util.GenomeInfo.GenomeInfo import getSequenceTrackName [as 别名]
def getBasePath(cls, abbrv):
return os.sep.join([NONSTANDARD_DATA_PATH, abbrv] + GenomeInfo.getSequenceTrackName(abbrv))