Ejemplo n.º 1
0
    def getOptionsBoxGsuite(prevChoices):  # Alternatively: getOptionsBox2()
        '''
        See getOptionsBoxFirstKey().

        prevChoices is a namedtuple of selections made by the user in the
        previous input boxes (that is, a namedtuple containing only one element
        in this case). The elements can accessed either by index, e.g.
        prevChoices[0] for the result of input box 1, or by key, e.g.
        prevChoices.key (case 2).
        '''
        return GeneralGuiTool.getHistorySelectionElement('gsuite')
Ejemplo n.º 2
0
    def getOptionsBoxQueryTrack(prevChoices):
        """
        Defines the type and contents of the input box. User selections are
        returned to the tools in the prevChoices and choices attributes to other
        methods. These are lists of results, one for each input box (in the
        order specified by getInputBoxOrder()).

        The input box is defined according to the following syntax:

        Selection box:          ['choice1','choice2']
        - Returns: string

        Text area:              'textbox' | ('textbox',1) | ('textbox',1,False)
        - Tuple syntax: (contents, height (#lines) = 1, read only flag = False)
        - The contents is the default value shown inside the text area
        - Returns: string

        Raw HTML code:          '__rawstr__', 'HTML code'
        - This is mainly intended for read only usage. Even though more advanced
          hacks are possible, it is discouraged.

        Password field:         '__password__'
        - Returns: string

        Genome selection box:   '__genome__'
        - Returns: string

        Track selection box:    '__track__'
        - Requires genome selection box.
        - Returns: colon-separated string denoting track name

        History selection box:  ('__history__',) | ('__history__', 'bed', 'wig')
        - Only history items of specified types are shown.
        - Returns: colon-separated string denoting galaxy track name, as
                   specified in ExternalTrackManager.py.

        History check box list: ('__multihistory__', ) | ('__multihistory__', 'bed', 'wig')
        - Only history items of specified types are shown.
        - Returns: OrderedDict with galaxy id as key and galaxy track name
                   as value if checked, else None.

        Hidden field:           ('__hidden__', 'Hidden value')
        - Returns: string

        Table:                  [['header1','header2'], ['cell1_1','cell1_2'], ['cell2_1','cell2_2']]
        - Returns: None

        Check box list:         OrderedDict([('key1', True), ('key2', False), ('key3', False)])
        - Returns: OrderedDict from key to selection status (bool).
        :param prevChoices:
        """
        return GeneralGuiTool.getHistorySelectionElement(
            *getSupportedFileSuffixesForPointsAndSegments()
        )
Ejemplo n.º 3
0
    def getOptionsBoxRefTrack(prevChoices): # Alternatively: getOptionsBox2()
        '''
        See getOptionsBoxFirstKey().

        prevChoices is a namedtuple of selections made by the user in the
        previous input boxes (that is, a namedtuple containing only one element
        in this case). The elements can accessed either by index, e.g.
        prevChoices[0] for the result of input box 1, or by key, e.g.
        prevChoices.key (case 2).
        '''
        if prevChoices.gSuite and prevChoices.normStrat and prevChoices.normStrat in [NormalizeTracksInGSuiteTool.NORM_STRAT_TMM]:
            return GeneralGuiTool.getHistorySelectionElement('gtrack', 'bed')
    def getOptionsBoxHistElement(
            prevChoices):  # Alternatively: getOptionsBox1()
        '''
        Defines the type and contents of the input box. User selections are
        returned to the tools in the prevChoices and choices attributes to other
        methods. These are lists of results, one for each input box (in the
        order specified by getInputBoxOrder()).

        The input box is defined according to the following syntax:

        Selection box:          ['choice1','choice2']
        - Returns: string

        Text area:              'textbox' | ('textbox',1) | ('textbox',1,False)
        - Tuple syntax: (contents, height (#lines) = 1, read only flag = False)
        - The contents is the default value shown inside the text area
        - Returns: string

        Password field:         '__password__'
        - Returns: string

        Genome selection box:   '__genome__'
        - Returns: string

        Track selection box:    '__track__'
        - Requires genome selection box.
        - Returns: colon-separated string denoting track name

        History selection box:  ('__history__',) | ('__history__', 'bed', 'wig')
        - Only history items of specified types are shown.
        - Returns: colon-separated string denoting galaxy track name, as
                   specified in ExternalTrackManager.py.

        History check box list: ('__multihistory__', ) | ('__multihistory__', 'bed', 'wig')
        - Only history items of specified types are shown.
        - Returns: OrderedDict with galaxy id as key and galaxy track name
                   as value if checked, else None.

        Hidden field:           ('__hidden__', 'Hidden value')
        - Returns: string

        Table:                  [['header1','header2'], ['cell1_1','cell1_2'], ['cell2_1','cell2_2']]
        - Returns: None

        Check box list:         OrderedDict([('key1', True), ('key2', False), ('key3', False)])
        - Returns: OrderedDict from key to selection status (bool).
        '''
        #should accept only gtrack suite (but user may not be aware of the types, a file uploaded with Upload file galaxy tool will upload a gsuite as txt by default)
        return GeneralGuiTool.getHistorySelectionElement('gsuite')
Ejemplo n.º 5
0
    def getOptionsBoxGSuiteRef(cls, prevChoices):
        '''
        See getOptionsBoxFirstKey().

        prevChoices is a namedtuple of selections made by the user in the
        previous input boxes (that is, a namedtuple containing only one element
        in this case). The elements can accessed either by index, e.g.
        prevChoices[0] for the result of input box 1, or by key, e.g.
        prevChoices.key (case 2).
        '''
        #TODO: boris 20141102, return reference track gsuite element if
        #appropriate feature extraction strategy is selected
        if prevChoices.similarityTech == cls.SIMILARITY_RELATIONS_TO_OTHER \
        or prevChoices.similarityTech == cls.REGIONS_CLUSTERING:
            return GeneralGuiTool.getHistorySelectionElement('gsuite')
        else:
            return None
Ejemplo n.º 6
0
 def getOptionsBoxGenomicRegionsTracks(cls, prevChoices):
     if prevChoices.genome != cls.SELECT:
         if prevChoices.genomicRegions == cls.REGIONS_FROM_HISTORY:
             return GeneralGuiTool.getHistorySelectionElement(
                 'bed', 'gsuite')
             #return ('__history__','bed','category.bed','gtrack', 'gsuite')
         #elif prevChoices.genomicRegions == 'Input Genomic Region':
         #    return #('', 1, False) # Function to extract this region from a track and send it to history? Or do it before using this function?
         elif prevChoices.genomicRegions == cls.SELECT:
             return
         elif prevChoices.genomicRegions == 'Hyperbrowser repository':
             return [cls.SELECT
                     ] + TfbsTrackNameMappings.getTfbsTrackNameMappings(
                         prevChoices.genome).keys()
         else:
             selectedTrackNames = []
             genElementGSuiteName = TfbsGSuiteNameMappings.getTfbsGSuiteNameMappings(
                 prevChoices.genome).values()
             for gSuite in genElementGSuiteName:
                 thisGSuite = getGSuiteFromGSuiteFile(gSuite)
                 for track in thisGSuite.allTracks():
                     selectedTrackNames.append(':'.join(
                         track.trackName[2:]))
             return [cls.SELECT] + selectedTrackNames
 def getOptionsBoxFile():
     return GeneralGuiTool.getHistorySelectionElement('txt', 'tabular')
Ejemplo n.º 8
0
 def getOptionsBoxDataset(cls, prevChoices):  # Alt: getOptionsBox1()
     return GeneralGuiTool.getHistorySelectionElement('bed', 'gsuite')
 def getOptionsBoxRefTrackCollection(prevChoices): # history
     #return '__history__', 'gsuite'
     return GeneralGuiTool.getHistorySelectionElement('gsuite')
Ejemplo n.º 10
0
 def getOptionsBoxParameters(prevChoices):
     return GeneralGuiTool.getHistorySelectionElement('gtrack')
Ejemplo n.º 11
0
 def getOptionsBoxTargetTrack(prevChoices): # refTrack
     return GeneralGuiTool.getHistorySelectionElement('bed', 'gtrack')
 def getOptionsBoxGSuite():
     return GeneralGuiTool.getHistorySelectionElement('gsuite')
Ejemplo n.º 13
0
 def getOptionsBoxIntensityTrack(cls, prevChoices):
     if not prevChoices.isBasic and prevChoices.analysisQName in [cls.Q2, cls.Q3] and \
             prevChoices.randStrat in [RAND_BY_UNIVERSE_TEXT]:
         return GeneralGuiTool.getHistorySelectionElement(
             *getSupportedFileSuffixesForPointsAndSegments()
         )
Ejemplo n.º 14
0
 def getOptionsBoxQueryTrack(prevChoices):
     return GeneralGuiTool.getHistorySelectionElement()
Ejemplo n.º 15
0
 def getOptionsBoxGsuite(prevChoices):
     return GeneralGuiTool.getHistorySelectionElement('gsuite')
Ejemplo n.º 16
0
 def getOptionsBoxGSuiteSecond(
         prevChoices):  # Alternatively: getOptionsBox2()
     return GeneralGuiTool.getHistorySelectionElement('gsuite')
 def getOptionsBoxGSuite():
     #return GeneralGuiTool.getHistorySelectionElement('gsuite', 'txt', 'tabular')
     return GeneralGuiTool.getHistorySelectionElement('gsuite')
 def getOptionsBoxSecondGSuite(prevChoices):
     return GeneralGuiTool.getHistorySelectionElement('gsuite', 'txt', 'tabular')
 def getOptionsBoxFile():
     return GeneralGuiTool.getHistorySelectionElement()
 def getOptionsBoxBedRegions(prevChoices):
     return GeneralGuiTool.getHistorySelectionElement('bed')
Ejemplo n.º 21
0
 def getOptionsBoxChooseTrackFiles(cls, prevChoices):
     if prevChoices.numberOfTracks in [cls.SINGLE_TRACK,cls.MULTIPLE_TRACKS]:
         #return ('__history__', 'bed','gsuite')
         return GeneralGuiTool.getHistorySelectionElement('gsuite')
Ejemplo n.º 22
0
 def getOptionsBoxNewdataset(cls, prevChoices):
     if prevChoices[-2] == 'Yes':
         return GeneralGuiTool.getHistorySelectionElement('bed')
     else:
         pass
Ejemplo n.º 23
0
 def getOptionsBoxLdGraphTrack():
     return GeneralGuiTool.getHistorySelectionElement('gtrack')
 def getOptionsBoxLdTrack(choices):
     return GeneralGuiTool.getHistorySelectionElement('gtrack')
Ejemplo n.º 25
0
 def getOptionsBox2(prevChoices):  # Alternatively: getOptionsBoxKey()
     if prevChoices[0] == 'From GSuite':
         return GeneralGuiTool.getHistorySelectionElement('gsuite')