本文整理汇总了Python中quick.application.ExternalTrackManager.ExternalTrackManager.extractFileSuffixFromGalaxyTN方法的典型用法代码示例。如果您正苦于以下问题:Python ExternalTrackManager.extractFileSuffixFromGalaxyTN方法的具体用法?Python ExternalTrackManager.extractFileSuffixFromGalaxyTN怎么用?Python ExternalTrackManager.extractFileSuffixFromGalaxyTN使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类quick.application.ExternalTrackManager.ExternalTrackManager
的用法示例。
在下文中一共展示了ExternalTrackManager.extractFileSuffixFromGalaxyTN方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: createRSquareGraph
# 需要导入模块: from quick.application.ExternalTrackManager import ExternalTrackManager [as 别名]
# 或者: from quick.application.ExternalTrackManager.ExternalTrackManager import extractFileSuffixFromGalaxyTN [as 别名]
def createRSquareGraph(cls, ldGraphTrackName, r2_threshold):
"""
Creates a dictionary of all pairs in a linked point track.
Variants in LD must have rsquare >= the rsquare threshold passed to the function.
:param ldGraphTrackName: linked point track, as chosen in tool (choices.ldtrack)
:param r2_threshold: Lower limit of square value
:return: Dictionary of all ld-pairs with sorted key = (rsid1, rsid2), value = rSquare
"""
from quick.application.ExternalTrackManager import ExternalTrackManager
from gold.origdata.GtrackGenomeElementSource import GtrackGenomeElementSource
fileName = ExternalTrackManager.extractFnFromGalaxyTN(ldGraphTrackName)
suffix = ExternalTrackManager.extractFileSuffixFromGalaxyTN(ldGraphTrackName)
gtSource = GtrackGenomeElementSource(fileName, suffix=suffix)
r2graph = {}
for ge in gtSource:
rsid = ge.id
edges = ge.edges
weights = ge.weights
for i in range(0, len(edges)):
ldRsid = edges[i]
r2 = weights[i]
if r2 >= float(r2_threshold):
cls.addEdge(r2graph, rsid, ldRsid, r2)
return r2graph
示例2: validateAndReturnErrors
# 需要导入模块: from quick.application.ExternalTrackManager import ExternalTrackManager [as 别名]
# 或者: from quick.application.ExternalTrackManager.ExternalTrackManager import extractFileSuffixFromGalaxyTN [as 别名]
def validateAndReturnErrors(choices):
genome = choices.genome if choices.selectGenome == 'Yes' else None
if genome == '':
return 'Please select a genome build.'
error = GeneralGuiTool._checkHistoryTrack(choices, 'history', GenomeElementSource, genome)
if error:
return error
if choices.conversion is None:
suffix = ExternalTrackManager.extractFileSuffixFromGalaxyTN(choices.history.split(':'))
return 'No conversions available for the selected file. Please make ' \
'sure that the file type is correct. Current file type: %s' % suffix
示例3: execute
# 需要导入模块: from quick.application.ExternalTrackManager import ExternalTrackManager [as 别名]
# 或者: from quick.application.ExternalTrackManager.ExternalTrackManager import extractFileSuffixFromGalaxyTN [as 别名]
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 getOutputFormat is anything else than HTML, the output should be written to the file with path galaxyFn.gtr
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.
'''
genome = choices[1] if choices[0] == 'Yes' else None
suffix = ExternalTrackManager.extractFileSuffixFromGalaxyTN(choices[2].split(':'))
inFn = ExternalTrackManager.extractFnFromGalaxyTN(choices[2].split(':'))
try:
standardizeGtrackFileAndWriteToFile(inFn, galaxyFn, genome, suffix=suffix)
except Exception, e:
import sys
print >> sys.stderr, e
示例4: getRegsAndBinsSpec
# 需要导入模块: from quick.application.ExternalTrackManager import ExternalTrackManager [as 别名]
# 或者: from quick.application.ExternalTrackManager.ExternalTrackManager import extractFileSuffixFromGalaxyTN [as 别名]
def getRegsAndBinsSpec(choices):
'''
Returns teh regSpec and binSpec for the choices made on the gui.
'''
regsMapper = {'Chromosome arms':'__chrArms__','Chromosomes':'__chrs__','Cytobands':'__chrBands__','Genes(Ensembl)':'__genes__','ENCODE Pilot regions':'__encode__'}
if choices.CompareIn == 'Custom specification':
regSpec = choices.CustomRegion
binSpec = choices.BinSize
elif regsMapper.get(choices.CompareIn):
regSpec = regsMapper[choices.CompareIn]
binSpec = choices.Bins
else:
histItem = choices.HistoryBins.split(':')
binSpec = ExternalTrackManager.extractFnFromGalaxyTN(histItem)
regSpec = ExternalTrackManager.extractFileSuffixFromGalaxyTN(histItem)
return regSpec, binSpec
示例5: _checkHistoryTrack
# 需要导入模块: from quick.application.ExternalTrackManager import ExternalTrackManager [as 别名]
# 或者: from quick.application.ExternalTrackManager.ExternalTrackManager import extractFileSuffixFromGalaxyTN [as 别名]
def _checkHistoryTrack(prevChoices, historyChoiceIndex, geSourceCls, genome=None, filetype='', validateFirstLine=True):
fileStr = filetype + ' file' if filetype else 'file'
if type(historyChoiceIndex) == int:
historyTrackName = prevChoices[historyChoiceIndex]
else:
historyTrackName = getattr(prevChoices, historyChoiceIndex)
if historyTrackName is None:
return 'Please select a ' + fileStr + ' from history.'
if validateFirstLine:
from quick.application.ExternalTrackManager import ExternalTrackManager
galaxyTN = historyTrackName.split(':')
suffix = ExternalTrackManager.extractFileSuffixFromGalaxyTN(galaxyTN)
fn = ExternalTrackManager.extractFnFromGalaxyTN(galaxyTN)
try:
geSourceCls(fn , genome, suffix=suffix).parseFirstDataLine()
except Exception, e:
return fileStr.capitalize() + ' invalid: ' + str(e)
示例6: createPositionDict
# 需要导入模块: from quick.application.ExternalTrackManager import ExternalTrackManager [as 别名]
# 或者: from quick.application.ExternalTrackManager.ExternalTrackManager import extractFileSuffixFromGalaxyTN [as 别名]
def createPositionDict(cls, ldGraphTrackName):
"""
Creates position dictionary from linked point track. To be used for empiric exploration of positions,
based on LD correlation (rsquare values)
:param ldGraphTrackName: linked point track, as chosen in tool (choices.ldtrack)
:return: Dictionary of all nodes in track with key = rsid, value = position
"""
from quick.application.ExternalTrackManager import ExternalTrackManager
from gold.origdata.GtrackGenomeElementSource import GtrackGenomeElementSource
fileName = ExternalTrackManager.extractFnFromGalaxyTN(ldGraphTrackName)
suffix = ExternalTrackManager.extractFileSuffixFromGalaxyTN(ldGraphTrackName)
gtSource = GtrackGenomeElementSource(fileName, suffix=suffix)
positionDict = {}
for ge in gtSource:
rsid = ge.id
position = ge.start
cls.addPosition(positionDict, rsid, position)
return positionDict
示例7: validateUserBins
# 需要导入模块: from quick.application.ExternalTrackManager import ExternalTrackManager [as 别名]
# 或者: from quick.application.ExternalTrackManager.ExternalTrackManager import extractFileSuffixFromGalaxyTN [as 别名]
def validateUserBins(choices):
'''
See getOptionsBox1().
'''
from quick.util.GenomeInfo import GenomeInfo
genome = choices.Genome
regsMapper = {'Chromosome arms':'__chrArms__','Chromosomes':'__chrs__','Cytobands':'__chrBands__','Genes(Ensembl)':'__genes__','ENCODE Pilot regions':'__encode__'}
if choices.CompareIn == 'Custom specification':
regSpec = choices.CustomRegion
binSpec = choices.BinSize
if re.match('[0-9]+[mk]?', binSpec).end() != len(binSpec):
return 'Invalid Syntax for Bin size(only numbers and the characters "mk" allowed)'
elif regsMapper.get(choices.CompareIn):
regSpec = regsMapper[choices.CompareIn]
binSpec = choices.Bins
else:
histItem = choices.HistoryBins.split(':')
binSpec = ExternalTrackManager.extractFnFromGalaxyTN(histItem)
regSpec = ExternalTrackManager.extractFileSuffixFromGalaxyTN(histItem)
return regSpec, binSpec
示例8: _getGESource
# 需要导入模块: from quick.application.ExternalTrackManager import ExternalTrackManager [as 别名]
# 或者: from quick.application.ExternalTrackManager.ExternalTrackManager import extractFileSuffixFromGalaxyTN [as 别名]
def _getGESource(choices):
genome = choices.genome if choices.selectGenome == 'Yes' else None
galaxyTN = choices.history.split(':')
suffix = ExternalTrackManager.extractFileSuffixFromGalaxyTN(galaxyTN)
fn = ExternalTrackManager.extractFnFromGalaxyTN(galaxyTN)
return GenomeElementSource(fn, genome=genome, printWarnings=False, suffix=suffix)