当前位置: 首页>>代码示例>>Python>>正文


Python ExternalTrackManager.extractFileSuffixFromGalaxyTN方法代码示例

本文整理汇总了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
开发者ID:johhorn,项目名称:gwas-clustering,代码行数:33,代码来源:LDExpansions.py

示例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
开发者ID:Anderrb,项目名称:Dynamic-benchmark,代码行数:16,代码来源:UniversalConverterTool.py

示例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
开发者ID:Anderrb,项目名称:Dynamic-benchmark,代码行数:17,代码来源:ConvertToLinkedValuedSegments.py

示例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
开发者ID:Anderrb,项目名称:Dynamic-benchmark,代码行数:19,代码来源:UserBinSelector.py

示例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)
开发者ID:Anderrb,项目名称:Dynamic-benchmark,代码行数:24,代码来源:GeneralGuiTool.py

示例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
开发者ID:johhorn,项目名称:gwas-clustering,代码行数:25,代码来源:LDExpansions.py

示例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
开发者ID:Anderrb,项目名称:Dynamic-benchmark,代码行数:26,代码来源:UserBinSelector.py

示例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)
开发者ID:Anderrb,项目名称:Dynamic-benchmark,代码行数:8,代码来源:UniversalConverterTool.py


注:本文中的quick.application.ExternalTrackManager.ExternalTrackManager.extractFileSuffixFromGalaxyTN方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。