def _determineHeaderLines(self, hbColumns, columns): self._setHeaderDict('track type', Gtrack.getTrackTypeFromColumnSpec(columns)) self._setHeaderDict('value type', self._getGtrackValueType()) self._setHeaderDict('value dimension', Gtrack.getGtrackValueDimension(self._geSource.getValDim())) self._setHeaderDict('undirected edges', self._geSource.hasUndirectedEdges()) self._setHeaderDict('edge weights', ('weights' in hbColumns)) self._setHeaderDict('edge weight type', self._getGtrackEdgeWeightType()) self._setHeaderDict('edge weight dimension', Gtrack.getGtrackValueDimension(self._geSource.getEdgeWeightDim())) self._setHeaderDict('uninterrupted data lines', not self._hasMoreThanOneBoundingRegion()) self._setHeaderDict('sorted elements', self._geSource.isSorted()) self._setHeaderDict('no overlapping elements', self._geSource.hasNoOverlappingElements()) self._setHeaderDict('circular elements', self._geSource.hasCircularElements()) compliesToSubtype = False if self._USE_EXTENDED_GTRACK: self._setHeaderDict('fixed length', self._geSource.getFixedLength()) self._setHeaderDict('fixed gap size', self._geSource.getFixedGapSize()) self._setHeaderDict('fixed-size data lines', self._determineIfFixedSizeDataLines(columns)) if self._headerDict['fixed-size data lines']: self._setHeaderDict('data line size', self._geSource.getValDim()) hbColumns, columns = self._adjustColumnsAccordingToHeaderLines(hbColumns, columns) hbColumns, columns, compliesToSubtype = self._determineIfFileCompliesToSubtypes(hbColumns, columns) if not compliesToSubtype: self._setHeaderDict('1-indexed', self._geSource.inputIsOneIndexed()) self._setHeaderDict('end inclusive', self._geSource.inputIsEndInclusive()) for header, val in self._forcedHeaderDict.iteritems(): if header not in self._headerDict: self._headerDict[header] = val return hbColumns, columns
def _createColumnSpec(self, cols, addAnyExtraFixedCols=True): GtrackGenomeElementSource._createColumnSpec(self, cols, addAnyExtraFixedCols) self._headerDict[ 'track type'] = GtrackGenomeElementSource.getTrackTypeFromColumnSpec( self._columnSpec)
def getOptionsBoxTrackType(prevChoices): if prevChoices.columnSelection == 'Base columns on existing GTrack file' and not prevChoices.colSpecFile: return if prevChoices.history or prevChoices.input: trackType = GtrackGenomeElementSource.getTrackTypeFromColumnSpec(TabularToGtrackTool._getHeaders(prevChoices)) if trackType is not None: words = [x.capitalize() for x in trackType.split()] abbrv = ''.join([x[0] for x in words]) fullTrackType = ' '.join(words) + ' (%s)' % abbrv return (fullTrackType, 1, True)
def _determineHeaderLines(self, hbColumns, columns): self._setHeaderDict('track type', Gtrack.getTrackTypeFromColumnSpec(columns)) self._setHeaderDict('value type', self._getGtrackValueType()) self._setHeaderDict( 'value dimension', Gtrack.getGtrackValueDimension(self._geSource.getValDim())) self._setHeaderDict('undirected edges', self._geSource.hasUndirectedEdges()) self._setHeaderDict('edge weights', ('weights' in hbColumns)) self._setHeaderDict('edge weight type', self._getGtrackEdgeWeightType()) self._setHeaderDict( 'edge weight dimension', Gtrack.getGtrackValueDimension(self._geSource.getEdgeWeightDim())) self._setHeaderDict('uninterrupted data lines', not self._hasMoreThanOneBoundingRegion()) self._setHeaderDict('sorted elements', self._geSource.isSorted()) self._setHeaderDict('no overlapping elements', self._geSource.hasNoOverlappingElements()) self._setHeaderDict('circular elements', self._geSource.hasCircularElements()) compliesToSubtype = False if self._USE_EXTENDED_GTRACK: self._setHeaderDict('fixed length', self._geSource.getFixedLength()) self._setHeaderDict('fixed gap size', self._geSource.getFixedGapSize()) self._setHeaderDict('fixed-size data lines', self._determineIfFixedSizeDataLines(columns)) if self._headerDict['fixed-size data lines']: self._setHeaderDict('data line size', self._geSource.getValDim()) hbColumns, columns = self._adjustColumnsAccordingToHeaderLines( hbColumns, columns) hbColumns, columns, compliesToSubtype = self._determineIfFileCompliesToSubtypes( hbColumns, columns) if not compliesToSubtype: self._setHeaderDict('1-indexed', self._geSource.inputIsOneIndexed()) self._setHeaderDict('end inclusive', self._geSource.inputIsEndInclusive()) for header, val in self._forcedHeaderDict.iteritems(): if header not in self._headerDict: self._headerDict[header] = val return hbColumns, columns
def getOptionsBoxTrackType(prevChoices): if prevChoices.columnSelection == 'Base columns on existing GTrack file' and not prevChoices.colSpecFile: return if prevChoices.history or prevChoices.input: headers = set(TabularToGtrackTool._getHeaders(prevChoices)) if prevChoices.createDense == 'Yes' and 'start' in headers: headers.remove('start') if not 'edges' in headers and TabularToGtrackTool._create3dData(prevChoices): headers.add('edges') trackType = GtrackGenomeElementSource.getTrackTypeFromColumnSpec(headers) if trackType is not None: words = [x.capitalize() for x in trackType.split()] abbrv = ''.join([x[0] for x in words]) fullTrackType = ' '.join(words) + ' (%s)' % abbrv return (fullTrackType, 1, True)
def _createColumnSpec(self, cols, addAnyExtraFixedCols=True): GtrackGenomeElementSource._createColumnSpec(self, cols, addAnyExtraFixedCols) self._headerDict['track type'] = GtrackGenomeElementSource.getTrackTypeFromColumnSpec(self._columnSpec)