예제 #1
0
    def getToolDescription(cls):
        '''
        Specifies a help text in HTML that is displayed below the tool.
        '''
        from proto.hyperbrowser.HtmlCore import HtmlCore

        core = HtmlCore()
        core.paragraph(
            'This tool provides the option of filtering tracks in a GSuite file '
            'generating as output a GSuite file with the same columns, but '
            'with only a subset of tracks (rows) as selected by the user.')
        core.divider()
        core.paragraph('To filter a GSuite file, please follow these steps: ')
        core.orderedList([
            'Select the input GSuite file from history',
            'Select the tracks that should be kept (described in the list '
            'by its title, or by the whole uri if the title is not defined)',
            'Click the "Execute" button'
        ])

        cls._addGSuiteFileDescription(core,
                                      alwaysShowRequirements=True,
                                      alwaysShowOutputFile=True)

        return str(core)
    def getToolDescription(cls):
        '''
        Specifies a help text in HTML that is displayed below the tool.
        '''
        from proto.hyperbrowser.HtmlCore import HtmlCore

        core = HtmlCore()
        core.smallHeader('General')
        core.paragraph(
            'This tool exports selected tracks in a local GSuite file to the Galaxy history. '
            'The tool creates a new GSuite file with points to the exported tracks. '
            ' In addition, the tool can provide a preview of the the beginning of any track '
            'directly from the tool interface.')
        core.divider()
        core.smallHeader('Conversion')
        core.paragraph(
            'As part of the export process, the tracks can be converted into another file format. '
            'The list of file formats are dynamically created based upon the selected tracks. The list '
            'contains only file formats that allow conversion from all the selected tracks.'
        )

        cls._addGSuiteFileDescription(
            core,
            allowedLocations=cls.GSUITE_ALLOWED_LOCATIONS,
            allowedFileFormats=cls.GSUITE_ALLOWED_FILE_FORMATS,
            allowedTrackTypes=cls.GSUITE_ALLOWED_TRACK_TYPES,
            outputLocation=cls.GSUITE_OUTPUT_LOCATION,
            outputFileFormat=cls.GSUITE_OUTPUT_FILE_FORMAT,
            outputTrackType=cls.GSUITE_OUTPUT_TRACK_TYPE)

        return str(core)
예제 #3
0
    def generateQ1output(cls, additionalResultsDict, analysisQuestion, choices, galaxyFn,
                         gsPerTrackResults, queryTrackTitle, gsuite, results,
                         similarityStatClassName):
        core = HtmlCore()
        core.begin()
        core.divBegin(divId='results-page')
        core.divBegin(divClass='results-section')
        core.header(analysisQuestion)
        topTrackTitle = results.keys()[0]
        core.paragraph('''
                The track "%s" in the GSuite is the one most similar to the query track %s, with a similarity score of %s
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                as measured by the "%s" track similarity measure.
            ''' % (
            topTrackTitle, queryTrackTitle, strWithNatLangFormatting(results[topTrackTitle]),
            similarityStatClassName))
        core.divBegin()

        addTableWithTabularAndGsuiteImportButtons(
            core, choices, galaxyFn, cls.Q1_SHORT, tableDict=gsPerTrackResults[1],
            columnNames=gsPerTrackResults[0], gsuite=gsuite, results=results,
            gsuiteAppendAttrs=['similarity_score'], sortable=True)

        core.divEnd()
        columnInd = 0
        if choices.leadAttribute and choices.leadAttribute != GSuiteConstants.TITLE_COL:
            columnInd = 1

        res = GSuiteTracksCoincidingWithQueryTrackTool.drawPlot(
            results, additionalResultsDict,
            'Similarity to query track', columnInd=columnInd)
        core.line(res)
        core.divEnd()
        core.divEnd()
        core.end()
        return core
    def getToolDescription(cls):
        '''
        Specifies a help text in HTML that is displayed below the tool.
        '''
        from proto.hyperbrowser.HtmlCore import HtmlCore

        core = HtmlCore()
        core.paragraph(
            'Converts a preprocessed GSuite into a primary GSuite with local file paths'
        )

        core.divider()
        core.paragraph(
            str(HtmlCore().highlight(
                'NOTE: SHOULD NOT BE MADE PUBLIC FOR SECURITY '
                'REASONS.')))

        cls._addGSuiteFileDescription(
            core,
            allowedLocations=cls.GSUITE_ALLOWED_LOCATIONS,
            allowedFileFormats=cls.GSUITE_ALLOWED_FILE_FORMATS,
            allowedTrackTypes=cls.GSUITE_ALLOWED_TRACK_TYPES,
            outputLocation=cls.GSUITE_OUTPUT_LOCATION,
            outputFileFormat=cls.GSUITE_OUTPUT_FILE_FORMAT,
            outputTrackType=cls.GSUITE_OUTPUT_TRACK_TYPE,
            errorFile=False,
            minTrackCount=cls.GSUITE_MIN_TRACK_COUNT)

        return str(core)
    def getToolDescription(cls):
        '''
        Specifies a help text in HTML that is displayed below the tool.
        '''
        from proto.hyperbrowser.HtmlCore import HtmlCore

        core = HtmlCore()
        core.paragraph(
            'This tool can be used to compile a GSuite file referring to a subset of the tracks '
            'in the HyperBrowser repository. To use the tool, please follow these steps:'
        )
        core.orderedList([
            'Select the genome build',
            'Select the parent track, i.e. the top level in the track hierarchy that '
            'you are interested in. The tool will return all tracks that are found in the '
            'hierarchy underneath the selected parent track, descending into all sublevels.'
        ])
        core.divider()
        core.smallHeader('Note')
        core.paragraph(
            'Even though this tool can be used to build GSuite compilations of any tracks, '
            'the resulting GSuite file will be more usable if the track are somewhat homogeneous '
            'in track type.')

        cls._addGSuiteFileDescription(
            core,
            outputLocation=cls.GSUITE_OUTPUT_LOCATION,
            outputFileFormat=cls.GSUITE_OUTPUT_FILE_FORMAT,
            outputTrackType=cls.GSUITE_OUTPUT_TRACK_TYPE)

        return str(core)
예제 #6
0
    def getToolDescription(cls):
        '''
        Specifies a help text in HTML that is displayed below the tool.
        '''
        from proto.hyperbrowser.HtmlCore import HtmlCore

        core = HtmlCore()
        core.paragraph(
            'This tool can be used to compile a GSuite file referring to a selection '
            'of files from the current Galaxy history. Selection of a genome build is optional.'
        )
        core.divider()
        core.smallHeader('Note')
        core.paragraph(
            'Even though this tool can be used to build GSuite compilations of any history elements, '
            'the resulting GSuite file will be more usable if the elements are somewhat homogeneous '
            'in file format and/or track type.')

        cls._addGSuiteFileDescription(
            core,
            outputLocation=cls.GSUITE_OUTPUT_LOCATION,
            outputFileFormat=cls.GSUITE_OUTPUT_FILE_FORMAT,
            outputTrackType=cls.GSUITE_OUTPUT_TRACK_TYPE)

        return str(core)
    def execute(cls, choices, galaxyFn=None, username=''):

        cls._setDebugModeIfSelected(choices)

        gSuite = getGSuiteFromGalaxyTN(choices.gsuite)
        if gSuite.genome != choices.genome:
            gSuite.setGenomeOfAllTracks(choices.genome)
        regSpec, binSpec = UserBinMixin.getRegsAndBinsSpec(choices)
        paragraphs = []
        paragraphs += generatePilotPageTwoParagraphs(gSuite,
                                                     galaxyFn,
                                                     regSpec=regSpec,
                                                     binSpec=binSpec)
        paragraphs += generatePilotPageThreeParagraphs(gSuite,
                                                       galaxyFn,
                                                       regSpec=regSpec,
                                                       binSpec=binSpec)

        core = HtmlCore()
        core.begin()
        core.divBegin(divId='results-page')
        core.divBegin(divClass='results-section')
        core.header('Similarity and uniqueness of tracks')
        for prg in paragraphs:
            core.paragraph(prg)
        core.divEnd()
        core.divEnd()
        core.end()

        print core
예제 #8
0
    def getToolDescription(cls):
        '''
        Specifies a help text in HTML that is displayed below the tool.
        '''
        from proto.hyperbrowser.HtmlCore import HtmlCore

        core = HtmlCore()
        core.paragraph(
            'This tools takes a single track as input. The user then'
            'selects one of the attributes of the track (typically a column).'
            'The tools creates a range of separate output track files, '
            'one for each of the different unique values for the selected '
            'attribute (column) thar are present in the track. The tool thens '
            'directs each track element (typically each line) into the '
            'relevant output track, thus splitting all lines with a '
            'particular value into a separate output track file. '
            'The output track files are collected in a output GSuite file.')
        core.paragraph('In addition, the tool supports:')
        core.unorderedList([
            'Summary statistics of the selected attribute (column)',
            'Conversion from the input file format into other supported '
            'file formats (collected in the output GSuite)'
        ])

        cls._addGSuiteFileDescription(
            core,
            outputLocation=cls.GSUITE_OUTPUT_LOCATION,
            outputFileFormat=cls.GSUITE_OUTPUT_FILE_FORMAT,
            outputTrackType=cls.GSUITE_OUTPUT_TRACK_TYPE,
            errorFile=False)

        return str(core)
예제 #9
0
    def getToolDescription():
        '''
        Specifies a help text in HTML that is displayed below the tool.
        '''
        from proto.hyperbrowser.HtmlCore import HtmlCore
        core = HtmlCore()
        core.paragraph('''
This tool combines elements from two separate data sets into a single track where
the elements are denoted as case (target) or control, depending on their source.
This allows analyses of how other tracks preferentially interact with case
elements as opposed to control elements.''')
        core.divider()
        core.smallHeader('Shared regions')
        core.paragraph('''
This tool supports four ways of handling regions that are found in both case and
control tracks. These regions do not need to be full segments, as defined in the
input tracks; the tool also correctly handles shared parts of segments.''')
        core.descriptionLine('Shared regions should be removed', \
            'the shared regions are not returned, neither as case nor as control segments')
        core.descriptionLine('Shared regions should be returned as case regions', \
            'the shared regions are all denoted as case regions and returned')
        core.descriptionLine('Shared regions should be returned as control regions', \
            'the shared regions are all denoted as control regions and returned')
        core.descriptionLine('Shared regions should be returned as they are', \
            '''
the shared regions are not handled in any way, but denoted according to whether
they were found in the case or the control input track. Note that this may
result in case and control regions that overlap. The subsequent analysis may not
handle this correctly.''')
        return str(core)
 def getInfoForOptionsBoxCompareIn(cls, prevChoices):
     core = HtmlCore()
     core.paragraph(
         'Select the region(s) of the genome in which to analyze and '
         'possibly how the analysis regions should be divided into bins. '
         'First select the main category, and if needed, provide further '
         'details in the subsequent fields.')
     return str(core)
예제 #11
0
 def getOptionsBoxExplainOutput(prevChoices):
     core = HtmlCore()
     core.divBegin(divClass='input-explanation')
     core.paragraph(
         """Select 'gsuite' for output to get a new GSuite with the results as a metadata column
     <br> or select 'html' to view a simple table of the results.""")
     core.divEnd()
     return '__rawstr__', str(core)
 def getOptionsBoxGenomeMismatchNote(cls, prevChoices):
     if cls._allowGenomeOverride(
             prevChoices
     ) and cls._getNumUniquelySpecifiedGenomes(prevChoices) > 1:
         core = HtmlCore()
         core.styleInfoBegin(styleClass="infomessagesmall")
         core.paragraph(cls.GENOME_MISMATCH_NOTE +
                        ', '.join(cls._getGsuiteGenomes(prevChoices)))
         core.styleInfoEnd()
         return '__rawstr__', str(core)
예제 #13
0
 def getToolDescription():
     from proto.hyperbrowser.HtmlCore import HtmlCore
     core = HtmlCore()
     core.paragraph(
         'Create density distribution or smoothed version of any track, based on a sliding window across the genome.'
     )
     core.divider()
     core.paragraph(
         'The available density/smoothing options will depend on the type of the selected track of interest. For instance, it gives meaning to compute the density along the genome of a point track, but for a function track it instead gives meaning to smooth function values in a sliding window. For segments, it may be meaningful to consider either the count or coverage of segments along the genome.'
     )
     return str(core)
예제 #14
0
    def __str__(self):
        core = HtmlCore()

        #core.begin()
        for i, viewer in enumerate(self._viewers):
            core.paragraph(str(viewer))
            if i < len(self._viewers) - 1:
                core.divider(withSpacing=True)
        #core.end()

        return str(core)
    def getOptionsBoxResultsExplanation(cls, prevChoices):
        core = HtmlCore()
        core.divBegin(divClass='resultsExplanation')

        core.paragraph('''
            The results page from this analysis will display the results in a table with one row per track.
            For your convenience you can include attribute (meta-data columns) from the selected GSuite to be displayed in the same table.
            Additionally you can select the leading column, which is by default the track title, but can also be any of the additional attributes you select here.
        ''')
        core.divEnd()

        return '__rawstr__', str(core)
    def getLinkToSingleLocalHtmlResultsTable(self, linkText, disease,
                                             resDictKey, galaxyFn):
        core = HtmlCore()
        core.begin()
        core.paragraph(
            self.getHtmlLocalResultsTable(resDictKey, fillInNoneValues=True))
        core.end()

        staticFile = GalaxyRunSpecificFile(
            ['LocalResultTables', resDictKey, disease + '.html'], galaxyFn)
        staticFile.writeTextToFile(str(core))
        return staticFile.getLink(linkText)
예제 #17
0
    def _createNextHistoryElement(cls, toolId, **kwArgs):
        from quick.util.CommonFunctions import createToolURL
        redirectUrl = createToolURL(toolId=toolId, **kwArgs)

        from proto.hyperbrowser.HtmlCore import HtmlCore
        core = HtmlCore()
        core.begin(redirectUrl=redirectUrl)
        core.paragraph('Redirecting to next tool')
        core.end()

        with open(cls.extraGalaxyFn[cls.NEXT_TOOL_TITLE], 'w') as nextToolFile:
            nextToolFile.write(str(core))
예제 #18
0
    def getToolDescription():
        from proto.hyperbrowser.HtmlCore import HtmlCore
        core = HtmlCore()
        
        core.paragraph('''
This tool generates a function track covering the whole genome, where each base
pair gets a value denoting the distance (in bps) to the nearest element in the
selected track.''')
        core.divider()
        core.paragraph('''
The distance measure may be transformed to other bps-derived values (e.g. the
logarithm or fifth square root of the bps distance), if desired.''')
        
        return str(core)
    def getToolDescription(cls):
        '''
        Specifies a help text in HTML that is displayed below the tool.
        '''
        from proto.hyperbrowser.HtmlCore import HtmlCore
        from gold.gsuite.GSuiteConstants import URI_COL, FILE_FORMAT_COL, \
                                                TRACK_TYPE_COL, TITLE_COL

        core = HtmlCore()
        core.paragraph('This tool provides the option of filtering metadata columns '
                       'in a GSuite file, generating as output a GSuite file with the '
                       'same tracks (rows), but with only a subset of '
                       'metadata columns as selected by the user. ')
        core.divider()
        core.paragraph('To filter a GSuite file, please follow these steps: ')
        core.orderedList(['Select the input GSuite file from history',
                          'Select the metadata columns that should be kept',
                          'Click the "Execute" button'])

        core.divider()
        core.smallHeader('Note')
        core.paragraph('The standard metadata columns of a GSuite file cannot be '
                       'removed by this tool: ')
        core.unorderedList([URI_COL, FILE_FORMAT_COL, TRACK_TYPE_COL])
        core.paragraph('The exception to this rule is the "%s" column.' % TITLE_COL)

        cls._addGSuiteFileDescription(core,
                                      alwaysShowRequirements=True,
                                      alwaysShowOutputFile=True)

        return str(core)
        string = 'This tool provides the option of filtering track attributes in a GSuite file and generates a GSuite with the user selected attributes. It takes a GSuite file as an input, and displays all the included attributes in mutiple selections box. Upon the user selection, only the selected attributes will appear in the resulted GSuite.'
        return string
예제 #20
0
    def generateQ2Output(cls, additionalAttributesDict, additionalResultsDict, analysisQuestion, choices,
                         galaxyFn, queryTrackTitle, gsuite, results, similarityStatClassName):
        gsPerTrackResultsModel = GSuitePerTrackResultModel(results, ['Similarity to query track', 'P-value'],
                                                           additionalResultsDict=additionalResultsDict,
                                                           additionalAttributesDict=additionalAttributesDict)
        if choices.leadAttribute and choices.leadAttribute != GSuiteConstants.TITLE_COL:
            gsPerTrackResults = gsPerTrackResultsModel.generateColumnTitlesAndResultsDict(choices.leadAttribute)
        else:
            gsPerTrackResults = gsPerTrackResultsModel.generateColumnTitlesAndResultsDict()
        core = HtmlCore()
        core.begin()
        core.divBegin(divId='results-page')
        core.divBegin(divClass='results-section')
        core.header(analysisQuestion)
        topTrackTitle = results.keys()[0]
        core.paragraph('''
                The track "%s" has the lowest P-value of %s corresponding to %s  similarity to the query track "%s"
                as measured by "%s" track similarity measure.
            ''' % (topTrackTitle, strWithNatLangFormatting(results[topTrackTitle][1]),
                   strWithNatLangFormatting(results[topTrackTitle][0]), queryTrackTitle, similarityStatClassName))

        addTableWithTabularAndGsuiteImportButtons(
            core, choices, galaxyFn, cls.Q2_SHORT, tableDict=gsPerTrackResults[1],
            columnNames=gsPerTrackResults[0], gsuite=gsuite, results=results,
            gsuiteAppendAttrs=['similarity_score', 'p_value'], sortable=True)

        columnInd = 0
        if choices.leadAttribute and choices.leadAttribute != GSuiteConstants.TITLE_COL:
            columnInd = 1

        resultsSeparateListPart = OrderedDict()
        additionalResultsDictIncludePartFromResults = OrderedDict()

        for k, v in results.iteritems():
            if k not in resultsSeparateListPart.keys():
                resultsSeparateListPart[k] = v[0]
            if k not in additionalResultsDictIncludePartFromResults.keys():
                additionalResultsDictIncludePartFromResults[k] = OrderedDict()
            additionalResultsDictIncludePartFromResults[k]['P-Value'] = v[1]
            for k1, v1 in additionalResultsDict[k].iteritems():
                additionalResultsDictIncludePartFromResults[k][k1] = v1

        res = GSuiteTracksCoincidingWithQueryTrackTool.drawPlot(
            resultsSeparateListPart, additionalResultsDictIncludePartFromResults,
            'Similarity to query track', columnInd=columnInd)
        core.line(res)
        core.divEnd()
        core.divEnd()
        core.end()
        return core
예제 #21
0
    def getToolDescription(cls):
        '''
        Specifies a help text in HTML that is displayed below the tool.
        '''
        from proto.hyperbrowser.HtmlCore import HtmlCore
        core = HtmlCore()
        core.paragraph('''
Visualizing track elements along a line, such as in the UCSC Genome Browser or
the tool "Visualize track elements relative to anchor region", can necessarily only offer a global
overview at a very limited resolution. This tool instead uses a fractal layout
of the genome line (similar to a Hilbert curve) to map genome locations to
individual pixels in a matrix instead of along a line, effectively increasing
the resolution quadratically. Although the interpretation requires a certain
effort, this form of visualization can potentially be very informative.''')
        cls._additionalToolDescription(core)
        return str(core)
예제 #22
0
 def getToolDescription(cls):
     core = HtmlCore()
     core.paragraph(
         "This is a simple tool for preprocessing track files in the HyperBrowser track repository. "
         "Please select a track directory from the standarized tracks file tree. "
     )
     core.divider()
     core.descriptionLine(
         "Recursion",
         "Directories can be selected at any level. The preprocessor will recursively visit all "
         "sub-directories of the selected directory")
     core.descriptionLine(
         "Track file merge",
         "All track files within a directory will be merged together as one track (under the "
         "assumption that all files are of the same track type).")
     return str(core)
예제 #23
0
    def getToolDescription():
        from proto.hyperbrowser.HtmlCore import HtmlCore
        core = HtmlCore()
        core.paragraph('''
Used to reveal trends of how track elements are distributed relative to a set of
anchor regions (bins). All anchor regions are divided into the same number of
sub-bins, and a summary statistic is calculated for each sub-bin and averaged
across all anchor regions. The tool returns a plot of the average values with
95% confidence intervals.''')
        core.paragraph('''
First, select a genome and a track of interest. Secondly, select a summary
statistic, and click "Execute". Then a full analysis specification page appears,
where one can directly start a basic analysis or specify further details on the
analysis of interest. Here, you can select the bins across which the aggregation
plot is created.''')
        return str(core)
def getAnalysisQuestionInfoHtml(bmQid):
    '''
    Builds the div element that contains the appropriate basic mode analysis question.
    '''
    from quick.toolguide import BasicModeQuestionCatalog
    from proto.hyperbrowser.HtmlCore import HtmlCore

    if bmQid:
        htmlCore = HtmlCore()
        htmlCore.divBegin(divClass='analysis-info')
        prgrph = '''
    <b>Your question of interest was: %s<b>
    ''' % BasicModeQuestionCatalog.Catalog[bmQid]
        htmlCore.paragraph(prgrph)
        htmlCore.divEnd()
        return htmlCore
    def getToolDescription():
        from proto.hyperbrowser.HtmlCore import HtmlCore
        core = HtmlCore()
        core.paragraph('Creates a function track based on a custom expression applied on a sliding windows across the genome.')
        core.divider()
        core.paragraph('''For each position in the selected genome, the supplied custom expression is evaluated for the DNA sequence of a window of selected size around the region. Details on the expression format:''')
        core.paragraph( str(HtmlCore().unorderedList(['The DNA sequence of this window is available in a variable "s". Thus s[0] will give the bp letter at position 0', '''A binary vector (list) named "a" is available, where the value of a[i] is 1 if the base pair at position i is A, if not, the value is 0. ("a[i]" is thus identical to the expression "1 if s[i]=='a' else 0". Similarly, there are vectors c,g,t,n. )''', 'The variable "winSize" gives the window size', 'The variable "winIndexes" gives a list of all index positions in the window (thus, winIndexes is equivalent to "range(len(s))").', 'All 1-letter variables are usable if defined in the expression.', 'The following words (2 or more letters) are allowed: sum, max, min, if, else, for, in, len, range', 'The expression must follow python/numpy syntax.'])) )
        core.divider()
        core.paragraph('One can choose whether index 0 should be the left-most position of sliding window (with n-1 being right-most), or whether index 0 should be midpoint, that is the same position that gets assigned the computed value (so that left-most is index "-n/2" and right-most is "n/2").')
        core.divider()
        core.paragraph('''Example of custom expression, computing GC content in a sliding window: <br>''')
        core.append(CreateDnaBasedCustomTrackTool._exampleText('sum([g[i]+c[i] for i in winIndexes])'))
        #core.paragraph('''A full example of how this tool can be used is given through a %s.''' % str(HtmlCore().link('Galaxy Page', 'http://hyperbrowser.uio.no/test/u/vegard/p/create-track-from-dna-sequence')))
        #core.paragraph('''<a href=http://hyperbrowser.uio.no/test/u/vegard/p/create-track-from-dna-sequence target=_top>See full example</a> of how to use this tool.''')

        return str(core)
    def getToolDescription(cls):
        '''
        Specifies a help text in HTML that is displayed below the tool.
        '''
        from proto.hyperbrowser.HtmlCore import HtmlCore

        core = HtmlCore()
        core.paragraph(
            'This tool contains various operations for manipulating textual '
            'track files referred to in a GSuite file.')
        core.divider()
        core.smallHeader('Instructions')
        core.orderedList([
            'Select a GSuite file referring to local textual track files',
            'The first track referred to in the GSuite is automatically selected '
            'as an example track, with the beginning of the file shown in a '
            'text box. The example file is later used to show the results of the '
            'selected operation. If you want to use another file as the example track '
            'please select it in the selection box. ',
            'Select the required operation from the list of operations '
            '(click the info box if you need further description of each operation '
            'and its parameters):' + str(HtmlCore().unorderedList(
                [key for key in cls.ALL_OPERATIONS.keys()])),
            'Each parameter for the selected operation is shown in a selection box, '
            'with the default value indicated. If another value than the default is '
            'needed, please select the parameter and change its value. '
            'the order in which the parameters is selected is unimportant.',
            'The output of the selected operation with the selected parameter values '
            'on the beginning of the selected example track is shown in a text box.',
            'If the file format (e.g. "bed") of the track is changed as a result of '
            'carrying out the operation, please indicate the new file suffix. '
            'It is important for the tracks to have the correct file suffix for further '
            'analysis.'
        ])

        cls._addGSuiteFileDescription(
            core,
            allowedLocations=cls.GSUITE_ALLOWED_LOCATIONS,
            allowedFileFormats=cls.GSUITE_ALLOWED_FILE_FORMATS,
            outputLocation=cls.GSUITE_OUTPUT_LOCATION,
            outputFileFormat=cls.GSUITE_OUTPUT_FILE_FORMAT,
            outputTrackType=cls.GSUITE_OUTPUT_TRACK_TYPE,
            errorFile=True)

        return str(core)
예제 #27
0
 def getToolDescription():
     from proto.hyperbrowser.HtmlCore import HtmlCore
     core = HtmlCore()
     core.paragraph('This tool expands the segments of a file in one or both directions. '+ \
                    'It can also flatten a segment to its start, middle or end point before expading. '+ \
                    'If a strand column is specified, upstream and downstream expansion are defined in relation '+ \
                    'to the strand direction.')
     core.unorderedList(['Select the genome',
                         'Select the file you to expand. ',
                         'Select whether you want to treat the track as segments, or as start, middle or end points. ' + \
                         'Such conversion is done before any expansion or contraction is carried out.',
                         'Type in the number of base pairs you want to expand the segments in upstream and downstream direction. ' + \
                         'Contraction is performed by specifying negative values. ' + \
                         'A shortened format, specifying mega- and kilobases with "k" and "m", respectively, is supported.',
                         'Select whether you would like to remove segments that, after expansion, crosses chromosome border, or just crop them.',
                         'Click execute.' ])
     return str(core)
     return ''
예제 #28
0
    def execute(choices, galaxyFn=None, username=''):

        gSuite = getGSuiteFromGalaxyTN(choices.gsuite)
        if gSuite.genome != choices.genome:
            gSuite.setGenomeOfAllTracks(choices.genome)
        regSpec, binSpec = UserBinMixin.getRegsAndBinsSpec(choices)
        paragraphs = generatePilotPageTwoParagraphs(gSuite,
                                                    galaxyFn,
                                                    regSpec=regSpec,
                                                    binSpec=binSpec)

        core = HtmlCore()
        core.begin()
        core.header('Overlap between tracks')
        for prg in paragraphs:
            core.paragraph(prg)
        core.end()

        print core
    def getToolDescription(cls):
        '''
        Specifies a help text in HTML that is displayed below the tool.
        '''
        from proto.hyperbrowser.HtmlCore import HtmlCore
        core = HtmlCore()
        core.paragraph('Loops through all the tracks in the selected GSuite file and intersects all '
                       'tracks with the specified single filtering track. Only the parts of the '
                       'segments that are intersecting with the filtering track are kept.')

        cls._addGSuiteFileDescription(core,
                                      allowedLocations=cls.GSUITE_ALLOWED_LOCATIONS,
                                      allowedFileFormats=cls.GSUITE_ALLOWED_FILE_FORMATS,
                                      allowedTrackTypes=cls.GSUITE_ALLOWED_TRACK_TYPES,
                                      disallowedGenomes=cls.GSUITE_DISALLOWED_GENOMES,
                                      outputLocation=cls.GSUITE_OUTPUT_LOCATION,
                                      outputFileFormat=cls.GSUITE_OUTPUT_FILE_FORMAT,
                                      outputTrackType=cls.GSUITE_OUTPUT_TRACK_TYPE)

        return str(core)
    def getToolDescription(cls):
        '''
        Specifies a help text in HTML that is displayed below the tool.
        '''
        from proto.hyperbrowser.HtmlCore import HtmlCore
        core = HtmlCore()
        core.paragraph(
            'Loops through all combinations of tracks from two GSuite files '
            'where the two tracks are from different GSuites. For all these '
            'combination, a discrete statistic is calculated, and the resulting '
            'table is clustered and shown both as a heatmap and a table.')

        cls._addGSuiteFileDescription(
            core,
            allowedLocations=cls.GSUITE_ALLOWED_LOCATIONS,
            allowedFileFormats=cls.GSUITE_ALLOWED_FILE_FORMATS,
            allowedTrackTypes=cls.GSUITE_ALLOWED_TRACK_TYPES,
            disallowedGenomes=cls.GSUITE_DISALLOWED_GENOMES)

        return str(core)