Ejemplo n.º 1
0
    def process(self):
        geSource = self._geSourceManager.getGESource()
        genome = geSource.genome
        
        collector = PreProcMetaDataCollector(genome, self._trackName)

        from gold.origdata.PreProcessTracksJob import PreProcessTracksJob
        collector.updateMetaDataForFinalization(geSource.getFileSuffix(), geSource.getPrefixList(),
                                                geSource.getValDataType(), geSource.getValDim(),
                                                geSource.getEdgeWeightDataType(), geSource.getEdgeWeightDim(),
                                                geSource.hasUndirectedEdges(), geSource.getVersion(),
                                                PreProcessTracksJob.VERSION, PreProcessUtils.constructId(geSource),
                                                self._geSourceManager.getNumElements(),
                                                self._geSourceManager.getBoundingRegionTuples(),
                                                self._geSourceManager.getValCategories(),
                                                self._geSourceManager.getEdgeWeightCategories(),
                                                self._allowOverlaps)

        if self._geSourceManager.getNumElements() > 0:
            if self._mode == 'Real':
                output = OutputManager(genome, self._trackName, self._allowOverlaps, self._geSourceManager)
                writeFunc = output.writeRawSlice if geSource.isSliceSource() else output.writeElement
                for ge in geSource:
                    writeFunc(ge)
                output.close()
            else:
                for ge in geSource:
                    pass

        if self._mode in ['UpdateMeta', 'Real']:
            self._dirty = True
            collector.flagChrsAsPreProcessed(self._allowOverlaps, self._geSourceManager.getAllChrs())
Ejemplo n.º 2
0
    def _createPreProcFiles(self):
        geSource = self._geSourceManager.getGESource()
        genome = geSource.genome

        collector = PreProcMetaDataCollector(genome, self._trackName)

        collector.updateMetaDataForFinalization(geSource.getFileSuffix(), geSource.getPrefixList(), \
                                                geSource.getValDataType(), geSource.getValDim(), \
                                                geSource.getEdgeWeightDataType(), geSource.getEdgeWeightDim(), \
                                                geSource.hasUndirectedEdges(),
                                                geSource.getVersion(), PreProcessUtils.constructId(geSource), \
                                                self._geSourceManager.getNumElements(), \
                                                self._geSourceManager.getBoundingRegionTuples(), \
                                                self._geSourceManager.getValCategories(), \
                                                self._geSourceManager.getEdgeWeightCategories(), \
                                                self._allowOverlaps)

        if self._geSourceManager.getNumElements() == 0:
            return

        if self._mode != 'Real':
            for ge in geSource:
                pass
            return

        output = OutputManager(genome, self._trackName, self._allowOverlaps,
                               self._geSourceManager)

        writeFunc = output.writeRawSlice if geSource.isSliceSource(
        ) else output.writeElement

        for ge in geSource:
            writeFunc(ge)

        collector.flagChrsAsPreProcessed(self._allowOverlaps,
                                         self._geSourceManager.getAllChrs())

        output.close()