def getOptionsBox6(prevChoices):
     if prevChoices[3]:
         extraDbColumnsDict = OrderedDict()
         fnSource = ExternalTrackManager.extractFnFromGalaxyTN(prevChoices[2].split(':'))
         fnDB = ExternalTrackManager.extractFnFromGalaxyTN(prevChoices[3].split(':'))
         
         gtrackDB = GtrackGenomeElementSource(fnDB)
         gtrackSource = GtrackGenomeElementSource(fnSource)
         
         extraDbColumns = [v for v in gtrackDB.getColumns() if not v in gtrackSource.getColumns()] #list(set(gtrackDBColumnSpec) - set(gtrackSourceColumnSpec))
         for column in extraDbColumns:
             extraDbColumnsDict[column] = False
         return extraDbColumnsDict
예제 #2
0
 def _getHeaders(prevChoices):
     numCols = TabularToGtrackTool._getFileContentsInfo(prevChoices).numCols
     if prevChoices.columnSelection != 'Base columns on existing GTrack file':
         header = []
         for i in xrange(numCols):
             if hasattr(prevChoices, 'column%s' % i):
                 colHeader = getattr(prevChoices, 'column%s' % i)
                 if colHeader is None or colHeader == '-- ignore --':
                     header.append('')
                 elif colHeader == '-- custom --':
                     header.append(getattr(prevChoices, 'customColumn%s' % i).strip())
                 else:
                     header.append(colHeader)
             else:
                 header.append('')
         return header
     else:
         genome = prevChoices.genome if prevChoices.selectGenome == 'Yes' else None
         try:
             inFn = ExternalTrackManager.extractFnFromGalaxyTN(prevChoices.colSpecFile.split(':'))
             geSource = GtrackGenomeElementSource(inFn, genome=genome)
             geSource.parseFirstDataLine()
             return geSource.getColumns()[:numCols]
         except Exception, e:
             return []
 def _getHeaders(prevChoices):
     numCols = TabularToGtrackTool._getFileContentsInfo(prevChoices).numCols
     if prevChoices.columnSelection == 'Select individual columns':
         header = []
         for i in xrange(numCols):
             if hasattr(prevChoices, 'column%s' % i):
                 colHeader = getattr(prevChoices, 'column%s' % i)
                 if colHeader is None or colHeader == '-- ignore --':
                     header.append('')
                 elif colHeader == '-- custom --':
                     header.append(getattr(prevChoices, 'customColumn%s' % i).strip())
                 else:
                     header.append(colHeader)
             else:
                 header.append('')
         return header
     else:
         genome = prevChoices.genome if prevChoices.selectGenome == 'Yes' else None
         inFn = ExternalTrackManager.extractFnFromGalaxyTN(prevChoices.colSpecFile.split(':'))
         try:
             geSource = GtrackGenomeElementSource(inFn, genome=genome)
             geSource.parseFirstDataLine()
             return geSource.getColumns()[:numCols]
         except Exception, e:
             return []
예제 #4
0
    def getOptionsBox6(prevChoices):
        if prevChoices[3]:
            extraDbColumnsDict = OrderedDict()
            fnSource = ExternalTrackManager.extractFnFromGalaxyTN(
                prevChoices[2].split(':'))
            fnDB = ExternalTrackManager.extractFnFromGalaxyTN(
                prevChoices[3].split(':'))

            gtrackDB = GtrackGenomeElementSource(fnDB)
            gtrackSource = GtrackGenomeElementSource(fnSource)

            extraDbColumns = [
                v for v in gtrackDB.getColumns()
                if not v in gtrackSource.getColumns()
            ]  #list(set(gtrackDBColumnSpec) - set(gtrackSourceColumnSpec))
            for column in extraDbColumns:
                extraDbColumnsDict[column] = False
            return extraDbColumnsDict