コード例 #1
0
 def _calcAndStoreSubTrackCount(self, trackName):
     ti = TrackInfo(self._genome, trackName)
     trackCount = 0
     for subTrackName in ProcTrackOptions.getSubtypes(self._genome, trackName, True):
         subTrackCount = TrackInfo(self._genome, trackName + [subTrackName]).subTrackCount
         if subTrackCount:
             trackCount += subTrackCount
     if ti.isValid():
         trackCount += 1
     ti.subTrackCount = trackCount
     ti.store()
コード例 #2
0
 def _calcAndStoreSubTrackCount(self, trackName):
     ti = TrackInfo(self._genome, trackName)
     trackCount = 0
     for subTrackName in ProcTrackOptions.getSubtypes(
             self._genome, trackName, True):
         subTrackCount = TrackInfo(self._genome,
                                   trackName + [subTrackName]).subTrackCount
         if subTrackCount:
             trackCount += subTrackCount
     if ti.isValid():
         trackCount += 1
     ti.subTrackCount = trackCount
     ti.store()
コード例 #3
0
ファイル: RenameTrack.py プロジェクト: brynjagr/gtrackcore
def modifyTnRecord(genome, oldTn, newTn, verbose):
    trackInfo = TrackInfo(genome, oldTn)
    assert trackInfo.trackName == oldTn
    assert trackInfo.timeOfPreProcessing is not None, 'ERROR: trackInfo-object not complete for TN (is this track preprocessed?): ' + str(oldTn)
    #if trackInfo.timeOfPreProcessing is None:
        #print 'WARNING: timeOfPreProcessing is None for: ',oldTn
        
    trackInfo.trackName = newTn
    if not ONLY_SIMULATION:
        trackInfo.store()
        if verbose:
            print '(Storing track-info with new tn: %s)' % str(newTn)
    else:
        if verbose:
            print 'Would now store track-info with new tn: %s' % str(newTn)
コード例 #4
0
ファイル: RenameTrack.py プロジェクト: gtrack/gtrackcore
def modifyTnRecord(genome, oldTn, newTn, verbose):
    trackInfo = TrackInfo(genome, oldTn)
    assert trackInfo.trackName == oldTn
    assert trackInfo.timeOfPreProcessing is not None, 'ERROR: trackInfo-object not complete for TN (is this track preprocessed?): ' + str(
        oldTn)
    #if trackInfo.timeOfPreProcessing is None:
    #print 'WARNING: timeOfPreProcessing is None for: ',oldTn

    trackInfo.trackName = newTn
    if not ONLY_SIMULATION:
        trackInfo.store()
        if verbose:
            print '(Storing track-info with new tn: %s)' % str(newTn)
    else:
        if verbose:
            print 'Would now store track-info with new tn: %s' % str(newTn)
コード例 #5
0
    def finalize(self, username, printMsg):
        ti = TrackInfo(self._genome, self._trackName)

        ti.fileType = self._fileSuffix
        trackFormat = self.getTrackFormat()
        ti.trackFormatName = trackFormat.getFormatName()
        ti.markType = trackFormat.getValTypeName()
        ti.weightType = trackFormat.getWeightTypeName()
        ti.undirectedEdges = self._undirectedEdges
        ti.preProcVersion = self._preProcVersion

        ti.origElCount = self._numElements[True]
        ti.clusteredElCount = self._numElements[False]

        if trackFormat.isDense() and trackFormat.isInterval():
            ti.origElCount -= len(self._boundingRegionTuples[True])
            ti.clusteredElCount -= len(self._boundingRegionTuples[False])

        if True in self._valCategories:
            ti.numValCategories = len(self._valCategories[True])

        if False in self._valCategories:
            ti.numClusteredValCategories = len(self._valCategories[False])

        if True in self._edgeWeightCategories:
            ti.numEdgeWeightCategories = len(self._edgeWeightCategories[True])

        ti.id = self._id
        ti.timeOfPreProcessing = datetime.datetime.now()

        ti.lastUpdatedBy = username
        if ti.hbContact == '':
            ti.hbContact = username

        ti.store()

        if printMsg:
            print "Finished preprocessing track '%s'." % ':'.join(
                self._trackName)
            print

        self.removeEntry()
コード例 #6
0
    def finalize(self, username, printMsg):
        ti = TrackInfo(self._genome, self._trackName)
        
        ti.fileType = self._fileSuffix
        trackFormat = self.getTrackFormat()
        ti.trackFormatName = trackFormat.getFormatName()
        ti.markType = trackFormat.getValTypeName()
        ti.weightType = trackFormat.getWeightTypeName()
        ti.undirectedEdges = self._undirectedEdges
        ti.preProcVersion = self._preProcVersion

        ti.origElCount = self._numElements[True]
        ti.clusteredElCount = self._numElements[False]
        
        if trackFormat.isDense() and trackFormat.isInterval():
            ti.origElCount -= len(self._boundingRegionTuples[True])
            ti.clusteredElCount -= len(self._boundingRegionTuples[False])

        if True in self._valCategories:
            ti.numValCategories = len(self._valCategories[True])
        
        if False in self._valCategories:
            ti.numClusteredValCategories = len(self._valCategories[False])

        if True in self._edgeWeightCategories:
            ti.numEdgeWeightCategories = len(self._edgeWeightCategories[True])
        
        ti.id = self._id
        ti.timeOfPreProcessing = datetime.datetime.now()
    
        ti.lastUpdatedBy = username
        if ti.hbContact == '':
            ti.hbContact = username
        
        ti.store()
        
        if printMsg:
            print "Finished preprocessing track '%s'." % ':'.join(self._trackName)
            print
        
        self.removeEntry()
コード例 #7
0
 def _calcAndStoreSubTrackCount(self, trackName):
     ti = TrackInfo(self._genome, trackName)
     if ti.isValid():
         ti.subTrackCount = 1
         ti.store()
コード例 #8
0
 def _calcAndStoreSubTrackCount(self, trackName):
     ti = TrackInfo(self._genome, trackName)
     if ti.isValid():
         ti.subTrackCount = 1
         ti.store()