Beispiel #1
0
 def __init__(self, region, track, track2, markType='number', **kwArgs):
     self._markType = markType
     #r('sink(file("/dev/null", open="wt"), type="message")')
     if kwArgs.get('minimal') != True:
         silenceRWarnings()
     
     Statistic.__init__(self, region, track, track2, markType=markType, **kwArgs)
Beispiel #2
0
 def __init__(self, region, track, track2, rawStatistic, randTrackClass=None, assumptions=None, tails=None, numResamplings=2000, randomSeed=None, **kwArgs):
     if tails==None:
         if 'tail' in kwArgs:
             tailTranslator = {'more':'right-tail', 'less':'left-tail', 'different':'two-tail'}
             tails = tailTranslator[kwArgs['tail']]
             if DebugConfig.VERBOSE:
                 logMessage('Argument tail provided instead of tails to RandomizationManagerStatUnsplittable', level=logging.DEBUG)
         else:
             tails = 'right-tail' # or 'two-tail'?
             logMessage('No tails argument provided to RandomizationManagerStatUnsplittable', level=logging.DEBUG)
     
     if track2 is None:
         self._track2 = None #to allow track2 to be passed on as None to rawStatistics without error. For use by single-track MC-tests..
         
     from gold.util.RandomUtil import getManualSeed, setManualSeed
     if randomSeed is not None and randomSeed != 'Random' and getManualSeed() is None:
         setManualSeed(int(randomSeed))
     
     if 'mcSetupScheme' in kwArgs:
         kwArgs = copy(kwArgs) #to not edit original dict..
         if kwArgs['mcSetupScheme'] != 'custom':
             assert not 'maxSamples' in kwArgs #check that specific values are not redundantly set
         #
     Statistic.__init__(self, region, track, track2, rawStatistic=rawStatistic, randTrackClass=randTrackClass, assumptions=assumptions, tails=tails, numResamplings=numResamplings, randomSeed=randomSeed, **kwArgs)
     #if type(rawStatistic) is str:
     #    from gold.statistic.AllStatistics import STAT_CLASS_DICT
     #    rawStatistic = STAT_CLASS_DICT[rawStatistic]
     
     assert (randTrackClass is None) ^ (assumptions is None) # xor
     if assumptions is not None:
         assert assumptions.count('_') == 1, assumptions
         randTrackClass1, randTrackClass2 = assumptions.split('_')
     else:
         randTrackClass1 = None
         randTrackClass2 = randTrackClass
     
     self._randTrackClass1, self._randTrackClass2 = \
         [ ( globals()[clsDef] if clsDef not in ['None',''] else None ) \
             if isinstance(clsDef, basestring) else clsDef for clsDef in [randTrackClass1, randTrackClass2]]
     
     assert not (randTrackClass1 is None and randTrackClass2 is None)
     for cls in [self._randTrackClass1, self._randTrackClass2]:
         assert cls in [None, PermutedSegsAndSampledIntersegsTrack, \
                        PermutedSegsAndIntersegsTrack, RandomGenomeLocationTrack, SegsSampledByIntensityTrack, ShuffledMarksTrack, SegsSampledByDistanceToReferenceTrack, PointsSampledFromBinaryIntensityTrack]
         
     #print self._randTrackClass1, self._randTrackClass2
     self._rawStatistic = self.getRawStatisticClass(rawStatistic)
     
     #self._randTrackList = []
     self._tails = tails
     if kwArgs.get('minimal') == True:
         self._numResamplings = 1
         self._kwArgs['maxSamples'] = 1
     else:
         self._numResamplings = int(numResamplings)
     CompBinManager.ALLOW_COMP_BIN_SPLITTING = False
     self._randResults = []
     self._observation = None
     #to load r libraries for McFdr:
     McFdr._initMcFdr()
 def __init__(self, region, track, track2, rawStatistic=None, **kwArgs):        
     assert rawStatistic is not None
     assert type(rawStatistic) == str
     from gold.statistic.AllStatistics import STAT_CLASS_DICT
     self._rawStatistic = STAT_CLASS_DICT[rawStatistic] 
     
     Statistic.__init__(self, region, track, track2, rawStatistic=rawStatistic, **kwArgs)
Beispiel #4
0
 def __init__(self,
              region,
              track,
              track2=None,
              windowSize=21,
              windowBpSize=50000,
              sdOfGaussian=20000,
              guaranteeBpCoverByWindow='True',
              withOverlaps='no',
              **kwArgs):
     self._windowSize = int(windowSize)
     self._windowBpSize = int(windowBpSize)
     self._sdOfGaussian = int(sdOfGaussian)
     self._guaranteeBpCoverByWindow = ast.literal_eval(
         guaranteeBpCoverByWindow)
     assert (withOverlaps in ['no', 'yes'])
     self._withOverlaps = withOverlaps
     Statistic.__init__(self,
                        region,
                        track,
                        track2,
                        windowSize=windowSize,
                        windowBpSize=windowBpSize,
                        sdOfGaussian=sdOfGaussian,
                        guaranteeBpCoverByWindow=guaranteeBpCoverByWindow,
                        withOverlaps=withOverlaps,
                        **kwArgs)
    def __init__(self, region, track, track2=None, numDiscreteVals=None, marksStat='MarksListStat', **kwArgs):
        self._numDiscreteVals = numDiscreteVals
        self._marksStat = marksStat

        self._numHistBins = int(self._numDiscreteVals)

        Statistic.__init__(self, region, track, track2, numDiscreteVals=numDiscreteVals, marksStat=marksStat, **kwArgs)
 def __init__(self, region, track, track2, rawStatistic=None, **kwArgs):        
     assert rawStatistic is not None
     assert isinstance(rawStatistic, basestring)
     from gold.statistic.AllStatistics import STAT_CLASS_DICT
     self._rawStatistic = STAT_CLASS_DICT[rawStatistic] 
     
     Statistic.__init__(self, region, track, track2, rawStatistic=rawStatistic, **kwArgs)
 def __init__(self, region, track, track2, childClass, resultKey, **kwArgs):
     Statistic.__init__(self, region, track, track2, childClass=childClass, resultKey=resultKey, **kwArgs)
     if type(childClass) is str:
         childClass = self.getRawStatisticClass(childClass)
     self._childClass = childClass
     self._resultKey = resultKey
     self._kwArgs = kwArgs
    def __init__(self, region, track, track2=None, numDiscreteVals=None, marksStat='MarksListStat', **kwArgs):
        self._numDiscreteVals = numDiscreteVals
        self._marksStat = marksStat

        self._numHistBins = int(self._numDiscreteVals)

        Statistic.__init__(self, region, track, track2, numDiscreteVals=numDiscreteVals, marksStat=marksStat, **kwArgs)
 def __init__(self, region, track, track2=None, numDiscreteVals=None, reducedNumDiscreteVals=None, marksStat='MarksListStat', **kwArgs):
     self._numDiscreteVals = numDiscreteVals
     self._reducedNumDiscreteVals = reducedNumDiscreteVals
     assert numDiscreteVals is not None and numDiscreteVals==reducedNumDiscreteVals
     self._marksStat = marksStat
     Statistic.__init__(self, region, track, track2, numDiscreteVals=numDiscreteVals, \
                        reducedNumDiscreteVals=reducedNumDiscreteVals, marksStat=marksStat, **kwArgs)
Beispiel #10
0
    def __init__(self,
                 region,
                 track,
                 track2,
                 rawStatistic=None,
                 normalizationType='zeroToOne',
                 minimal=False,
                 **kwArgs):
        if minimal == True:
            self._globalSource = MinimalBinSource(region.genome)
        else:
            from gold.application.StatRunner import StatJob
            assert StatJob.USER_BIN_SOURCE is not None
            self._globalSource = StatJob.USER_BIN_SOURCE

        Statistic.__init__(self,
                           region,
                           track,
                           track2,
                           rawStatistic=rawStatistic,
                           normalizationType=normalizationType,
                           minimal=minimal,
                           **kwArgs)

        if type(rawStatistic) is str:
            from gold.statistic.AllStatistics import STAT_CLASS_DICT
            rawStatistic = STAT_CLASS_DICT[rawStatistic]

        self._rawStatistic = rawStatistic
        self._normalizationType = normalizationType
Beispiel #11
0
    def __init__(self,
                 region,
                 track,
                 track2,
                 rawStatisticTrack1=None,
                 rawStatisticTrack2=None,
                 combineOperation=None,
                 **kwArgs):
        #Note: Could take parameter track1kwArgs which could be a dict to be sent further as kwArgs to rawStatisticTrack1, and correspondingly for track2

        #assert combineOperation in ['product']
        self._combineOperation = combineOperation

        Statistic.__init__(self,
                           region,
                           track,
                           track2,
                           rawStatisticTrack1=rawStatisticTrack1,
                           rawStatisticTrack2=rawStatisticTrack2,
                           combineOperation=combineOperation,
                           **kwArgs)

        from gold.statistic.AllStatistics import STAT_CLASS_DICT
        if type(rawStatisticTrack1) is str:
            rawStatisticTrack1 = STAT_CLASS_DICT[rawStatisticTrack1]
        if type(rawStatisticTrack2) is str:
            rawStatisticTrack2 = STAT_CLASS_DICT[rawStatisticTrack2]

        self._rawStatisticTrack1 = rawStatisticTrack1
        self._rawStatisticTrack2 = rawStatisticTrack2
Beispiel #12
0
    def __init__(self,
                 region,
                 track,
                 track2,
                 numSubBins=10,
                 method='pearson',
                 tail='different',
                 **kwArgs):
        assert method in ['pearson', 'spearman', 'kendall']
        assert tail in ['more', 'less', 'different']
        tailMapping = {
            'more': "greater",
            'less': "less",
            'different': "two.sided"
        }

        if kwArgs.get('minimal') != True:
            silenceRWarnings()

        self._numSubBins = numSubBins
        self._method = method
        self._rTail = tailMapping[tail]
        Statistic.__init__(self,
                           region,
                           track,
                           track2,
                           method=method,
                           tail=tail,
                           **kwArgs)
Beispiel #13
0
 def __init__(self, region, track, track2, rawStatistic, **kwArgs):
     self._rawStatistic = rawStatistic
     Statistic.__init__(self,
                        region,
                        track,
                        track2,
                        rawStatistic=rawStatistic,
                        **kwArgs)
 def __init__(self, region, track, track2, numDiscreteVals=None, **kwArgs):
     self._numDiscreteVals = numDiscreteVals
     Statistic.__init__(self,
                        region,
                        track,
                        track2,
                        numDiscreteVals=numDiscreteVals,
                        **kwArgs)
 def __init__(self, region, track, track2, rawStatistic=None, **kwArgs):        
     assert rawStatistic is not None
     assert type(rawStatistic) == str
     CompBinManager.ALLOW_COMP_BIN_SPLITTING = False
     from gold.statistic.AllStatistics import STAT_CLASS_DICT
     self._rawStatistic = STAT_CLASS_DICT[rawStatistic] 
     
     Statistic.__init__(self, region, track, track2, rawStatistic=rawStatistic, **kwArgs)
 def __init__(self, region, track, track2, markReq=None, **kwArgs):
     self._markReq = markReq
     Statistic.__init__(self,
                        region,
                        track,
                        track2,
                        markReq=markReq,
                        **kwArgs)
    def __init__(self, region, track, track2, rawStatistic=None, **kwArgs):
        Statistic.__init__(self, region, track, track2, rawStatistic=rawStatistic, **kwArgs)        

        if type(rawStatistic) is str:
            from gold.statistic.AllStatistics import STAT_CLASS_DICT
            rawStatistic = STAT_CLASS_DICT[rawStatistic]
     
        self._rawStatistic = rawStatistic
 def __init__(self, region, track, track2, track1SummarizerName, track2SummarizerName, *args, **kwArgs):
     Statistic.__init__(self, region, track, track2, track1SummarizerName=track1SummarizerName, \
                        track2SummarizerName=track2SummarizerName, allowIdenticalTracks=True, **kwArgs)
     from gold.statistic.AllStatistics import STAT_CLASS_DICT
     assert( track1SummarizerName in STAT_CLASS_DICT and track2SummarizerName in STAT_CLASS_DICT)
     
     self._track1Summarizer = STAT_CLASS_DICT[track1SummarizerName]
     self._track2Summarizer = STAT_CLASS_DICT[track2SummarizerName]
 def __init__(self, region, track, track2=None, withOverlaps='no', markType='number', enforcePoints=True, **kwArgs):
     assert( withOverlaps in ['no','yes'] )
     self._withOverlaps = withOverlaps
     self._markType = markType
     if type(enforcePoints) == str:
         enforcePoints = eval(enforcePoints)
     self._enforcePoints = enforcePoints
     Statistic.__init__(self, region, track, track2, withOverlaps=withOverlaps, markType=markType, enforcePoints=enforcePoints, **kwArgs)
Beispiel #20
0
 def __init__(self, region, track, track2=None, numDiscreteVals=None, reducedNumDiscreteVals=None, \
              controlTrackNameList=None, **kwArgs):
     assert controlTrackNameList is not None
     self._numDiscreteVals = numDiscreteVals
     self._reducedNumDiscreteVals = reducedNumDiscreteVals
     self._controlTrackNameList = controlTrackNameList
     Statistic.__init__(self, region, track, track2, numDiscreteVals=numDiscreteVals, \
                        reducedNumDiscreteVals=reducedNumDiscreteVals, controlTrackNameList=controlTrackNameList, **kwArgs)
 def __init__(self, region, track, track2=None, windowSize=21, windowBpSize=50000, sdOfGaussian=20000, guaranteeBpCoverByWindow='True', withOverlaps='no', **kwArgs):
     self._windowSize = int(windowSize)
     self._windowBpSize = int(windowBpSize)
     self._sdOfGaussian = int(sdOfGaussian)
     self._guaranteeBpCoverByWindow = eval(guaranteeBpCoverByWindow)
     assert( withOverlaps in ['no','yes'])
     self._withOverlaps = withOverlaps
     Statistic.__init__(self,region,track,track2,windowSize=windowSize, windowBpSize=windowBpSize, sdOfGaussian=sdOfGaussian, guaranteeBpCoverByWindow=guaranteeBpCoverByWindow, withOverlaps=withOverlaps, **kwArgs)
 def __init__(self, region, track, track2, maxRelDifference=0, maxAbsDifference=0, **kwArgs):
     self._maxRelDifference = float(maxRelDifference)
     self._maxAbsDifference = int(maxAbsDifference)
     assert( 0 <= self._maxRelDifference <= 1 )
     assert( 0 <= self._maxAbsDifference )
     
     Statistic.__init__(self, region, track, track2, maxRelDifference=maxRelDifference, \
                        maxAbsDifference=maxAbsDifference, **kwArgs)
 def __init__(self, region, track, track2=None, numDiscreteVals=None, reducedNumDiscreteVals=None, \
              controlTrackNameList=None, **kwArgs):
         assert controlTrackNameList is not None
         self._numDiscreteVals = numDiscreteVals
         self._reducedNumDiscreteVals = reducedNumDiscreteVals
         self._controlTrackNameList = controlTrackNameList
         Statistic.__init__(self, region, track, track2, numDiscreteVals=numDiscreteVals, \
                            reducedNumDiscreteVals=reducedNumDiscreteVals, controlTrackNameList=controlTrackNameList, **kwArgs)
 def __init__(self, region, track, track2, method='pearson', tail='different', **kwArgs):
     assert method in ['pearson','spearman','kendall']
     assert tail in ['more', 'less', 'different']
     tailMapping = {'more': "greater", 'less': "less", 'different': "two.sided"}
     
     self._method = method
     self._rTail = tailMapping[tail]
     Statistic.__init__(self, region, track, track2, method=method, tail=tail, **kwArgs)
 def __init__(self, region, track, track2, rawStatistic, randTrackClass=None, assumptions=None, tails=None, numResamplings=2000, randomSeed=None, **kwArgs):
     #print 'TEMP RM:',kwArgs
     if tails==None:
         if 'tail' in kwArgs:
             tailTranslator = {'more':'right-tail', 'less':'left-tail', 'different':'two-tail'}
             tails = tailTranslator[kwArgs['tail']]
             if DebugConfig.VERBOSE:
                 logMessage('Argument tail provided instead of tails to RandomizationManagerStatUnsplittable', level=logging.DEBUG)
         else:
             tails = 'right-tail' # or 'two-tail'?
             logMessage('No tails argument provided to RandomizationManagerStatUnsplittable', level=logging.DEBUG)
     
     if track2 is None:
         self._track2 = None #to allow track2 to be passed on as None to rawStatistics without error. For use by single-track MC-tests..
         
     from gold.util.RandomUtil import getManualSeed, setManualSeed
     if randomSeed is not None and randomSeed != 'Random' and getManualSeed() is None:
         setManualSeed(int(randomSeed))
         
     Statistic.__init__(self, region, track, track2, rawStatistic=rawStatistic, randTrackClass=randTrackClass, assumptions=assumptions, tails=tails, numResamplings=numResamplings, randomSeed=randomSeed, **kwArgs)
     #if type(rawStatistic) is str:
     #    from gold.statistic.AllStatistics import STAT_CLASS_DICT
     #    rawStatistic = STAT_CLASS_DICT[rawStatistic]
     
     assert (randTrackClass is None) ^ (assumptions is None) # xor
     if assumptions is not None:
         assert assumptions.count('_') == 1, assumptions
         randTrackClass1, randTrackClass2 = assumptions.split('_')
     else:
         randTrackClass1 = None
         randTrackClass2 = randTrackClass
     
     self._randTrackClass1, self._randTrackClass2 = \
         [ ( globals()[clsDef] if clsDef not in ['None',''] else None ) \
             if type(clsDef) is str else clsDef for clsDef in [randTrackClass1, randTrackClass2] ]
     
     assert not (randTrackClass1 is None and randTrackClass2 is None)
     for cls in [self._randTrackClass1, self._randTrackClass2]:
         assert cls in [None, PermutedSegsAndSampledIntersegsTrack, \
                        PermutedSegsAndIntersegsTrack, RandomGenomeLocationTrack, SegsSampledByIntensityTrack, ShuffledMarksTrack]
         
     #print self._randTrackClass1, self._randTrackClass2
     self._rawStatistic = self.getRawStatisticClass(rawStatistic)
     
     #self._randTrackList = []
     self._tails = tails
     if kwArgs.get('minimal') == True:
         self._numResamplings = 1
         self._kwArgs['maxSamples'] = 1
     else:
         self._numResamplings = int(numResamplings)
     CompBinManager.ALLOW_COMP_BIN_SPLITTING = False
     self._randResults = []
     self._observation = None
     #to load r libraries for McFdr:
     McFdr._initMcFdr()
    def __init__(self, region, track, track2, track1SummarizerName,
                 track2SummarizerName, *args, **kwArgs):
        Statistic.__init__(self, region, track, track2, track1SummarizerName=track1SummarizerName, \
                           track2SummarizerName=track2SummarizerName, allowIdenticalTracks=True, **kwArgs)
        from gold.statistic.AllStatistics import STAT_CLASS_DICT
        assert (track1SummarizerName in STAT_CLASS_DICT
                and track2SummarizerName in STAT_CLASS_DICT)

        self._track1Summarizer = STAT_CLASS_DICT[track1SummarizerName]
        self._track2Summarizer = STAT_CLASS_DICT[track2SummarizerName]
Beispiel #27
0
    def __init__(self, region, track, track2, distDirection='both', **kwArgs):
        assert (distDirection in ['left', 'right', 'both'])

        self._distDirection = distDirection
        Statistic.__init__(self,
                           region,
                           track,
                           track2,
                           distDirection=distDirection,
                           **kwArgs)
Beispiel #28
0
    def __init__(self, region, track, track2, minRelSimilarity=1, **kwArgs):
        self._minRelSimilarity = float(minRelSimilarity)
        assert (0 <= self._minRelSimilarity <= 1)

        Statistic.__init__(self,
                           region,
                           track,
                           track2,
                           minRelSimilarity=minRelSimilarity,
                           **kwArgs)
Beispiel #29
0
 def __init__(self, region, track, track2, statClassList=None, **kwArgs):
     Statistic.__init__(self, region, track, track2, statClassList=statClassList, **kwArgs)
     #self._kwArgs = kwArgs
     if type(statClassList) == list:
         self._statClassList = statClassList
     elif type(statClassList) == str:
         from gold.statistic.AllStatistics import STAT_CLASS_DICT
         self._statClassList = [STAT_CLASS_DICT[x] for x in \
             statClassList.replace(' ','').replace('^','|').split('|')]
     else:
         raise ShouldNotOccurError
Beispiel #30
0
 def __init__(self, region, track, track2=None, randTrackClass=None, randomSeed=None, **kwArgs):
     #print 'HEI'
     from gold.util.RandomUtil import getManualSeed, setManualSeed
     if randomSeed is not None and randomSeed != 'Random' and getManualSeed() is None:
         setManualSeed(int(randomSeed))
     
     Statistic.__init__(self, region, track, randTrackClass=randTrackClass, randomSeed=randomSeed, **kwArgs)
             
     self._randTrackClass = self.getRandTrackClass(randTrackClass)
                 
     CompBinManager.ALLOW_COMP_BIN_SPLITTING = False
    def __init__(self, region, track, track2, rawStatistic=None, **kwArgs):
        assert rawStatistic is not None
        assert isinstance(rawStatistic, basestring)
        CompBinManager.ALLOW_COMP_BIN_SPLITTING = False
        from gold.statistic.AllStatistics import STAT_CLASS_DICT
        self._rawStatistic = STAT_CLASS_DICT[rawStatistic]

        Statistic.__init__(self,
                           region,
                           track,
                           track2,
                           rawStatistic=rawStatistic,
                           **kwArgs)
    def __init__(self, region, track, track2, rawStatistic=None, **kwArgs):
        Statistic.__init__(self,
                           region,
                           track,
                           track2,
                           rawStatistic=rawStatistic,
                           **kwArgs)

        if type(rawStatistic) is str:
            from gold.statistic.AllStatistics import STAT_CLASS_DICT
            rawStatistic = STAT_CLASS_DICT[rawStatistic]

        self._rawStatistic = rawStatistic
 def __init__(self,
              region,
              track,
              track2=None,
              numDiscreteVals=None,
              reducedNumDiscreteVals=None,
              marksStat='MarksListStat',
              **kwArgs):
     self._numDiscreteVals = numDiscreteVals
     self._reducedNumDiscreteVals = reducedNumDiscreteVals
     assert numDiscreteVals is not None and numDiscreteVals == reducedNumDiscreteVals
     self._marksStat = marksStat
     Statistic.__init__(self, region, track, track2, numDiscreteVals=numDiscreteVals, \
                        reducedNumDiscreteVals=reducedNumDiscreteVals, marksStat=marksStat, **kwArgs)
    def __init__(self, region, track, track2=None, numDiscreteVals=None, reducedNumDiscreteVals=None, \
                 marksStat='MarksListStat', controlTrackNameList=None, **kwArgs):

        self._numDiscreteVals = int(numDiscreteVals)
        self._reducedNumDiscreteVals = int(reducedNumDiscreteVals)
        self._marksStat = marksStat

        assert controlTrackNameList is not None
        self._controlTrackNameList = [x.split('^') for x in controlTrackNameList.split('^^')] \
            if type(controlTrackNameList) == str else controlTrackNameList
        assert len(controlTrackNameList) > 0

        Statistic.__init__(self, region, track, track2, numDiscreteVals=numDiscreteVals, \
                           reducedNumDiscreteVals=reducedNumDiscreteVals, marksStat=marksStat, **kwArgs)
Beispiel #35
0
    def __init__(self,
                 region,
                 track,
                 track2,
                 maxRelDifference=0,
                 maxAbsDifference=0,
                 **kwArgs):
        self._maxRelDifference = float(maxRelDifference)
        self._maxAbsDifference = int(maxAbsDifference)
        assert (0 <= self._maxRelDifference <= 1)
        assert (0 <= self._maxAbsDifference)

        Statistic.__init__(self, region, track, track2, maxRelDifference=maxRelDifference, \
                           maxAbsDifference=maxAbsDifference, **kwArgs)
Beispiel #36
0
 def __init__(self, region, track, track2, countMethod='count', normalizePointsBy='rowSum', \
              pValueAdjustment='unadjusted', threshold='0.05', **kwArgs):
     assert countMethod in ['count', 'binary', 'logOfCount']
     self._countMethod = countMethod
     assert normalizePointsBy in [
         'nothing', 'rowSum', 'rowSumBalanced', 'rowCount',
         'rowCountBalanced'
     ]
     self._normalizePointsBy = normalizePointsBy
     assert pValueAdjustment in ['unadjusted', 'fdr']
     self._pValueAdjustment = pValueAdjustment
     self._threshold = float(threshold)
     assert 0.0 <= self._threshold <= 1.0
     Statistic.__init__(self, region, track, track2, countMethod=countMethod, normalizePointsBy=normalizePointsBy, \
                        pValueAdjustment=pValueAdjustment, threshold=threshold, **kwArgs)
    def __init__(self,
                 region,
                 track,
                 track2=None,
                 randTrackClass=None,
                 **kwArgs):
        Statistic.__init__(self,
                           region,
                           track,
                           randTrackClass=randTrackClass,
                           **kwArgs)

        self._randTrackClass = self.getRandTrackClass(randTrackClass)

        CompBinManager.ALLOW_COMP_BIN_SPLITTING = False
 def __init__(self,
              region,
              track,
              track2,
              statClass1=None,
              statClass2=None,
              **kwArgs):
     self._statClass1 = statClass1
     self._statClass2 = statClass2
     Statistic.__init__(self,
                        region,
                        track,
                        track2,
                        statClass1=statClass1,
                        statClass2=statClass2,
                        **kwArgs)
Beispiel #39
0
 def __init__(self,
              region,
              track,
              track2,
              maxCountRegionSize='None',
              **kwArgs):
     if maxCountRegionSize == 'None':
         self._maxCountRegionSize = None
     else:
         self._maxCountRegionSize = int(maxCountRegionSize)
     Statistic.__init__(self,
                        region,
                        track,
                        track2,
                        maxCountRegionSize=maxCountRegionSize,
                        **kwArgs)
Beispiel #40
0
 def __init__(self, region, track, track2, statClassList=None, **kwArgs):
     Statistic.__init__(self,
                        region,
                        track,
                        track2,
                        statClassList=statClassList,
                        **kwArgs)
     #self._kwArgs = kwArgs
     if type(statClassList) == list:
         self._statClassList = statClassList
     elif isinstance(statClassList, basestring):
         from gold.statistic.AllStatistics import STAT_CLASS_DICT
         self._statClassList = [STAT_CLASS_DICT[x] for x in \
             statClassList.replace(' ','').replace('^','|').split('|')]
     else:
         raise ShouldNotOccurError
 def __init__(self, region, track, track2, rawStatistic=None, normalizationType='zeroToOne', minimal=False, **kwArgs):
     if minimal == True:
         self._globalSource = MinimalBinSource(region.genome)
     else:
         from gold.application.StatRunner import StatJob
         assert StatJob.USER_BIN_SOURCE is not None
         self._globalSource = StatJob.USER_BIN_SOURCE
     
     Statistic.__init__(self, region, track, track2, rawStatistic=rawStatistic, normalizationType=normalizationType, minimal=minimal, **kwArgs)
     
     if type(rawStatistic) is str:
         from gold.statistic.AllStatistics import STAT_CLASS_DICT
         rawStatistic = STAT_CLASS_DICT[rawStatistic]
  
     self._rawStatistic = rawStatistic
     self._normalizationType = normalizationType
    def __init__(self,
                 region,
                 track,
                 track2,
                 assumptions='poissonPoints',
                 tail='different',
                 **kwArgs):
        assert (tail in ['less', 'more', 'different'])
        assert assumptions == 'poissonPoints'

        self._tail = tail
        Statistic.__init__(self,
                           region,
                           track,
                           track2,
                           assumptions=assumptions,
                           tail=tail,
                           **kwArgs)
Beispiel #43
0
 def __init__(self,
              region,
              track,
              track2=None,
              numDiscreteVals=None,
              marksStat='MarksListStat',
              printIntervals=False,
              **kwArgs):
     self._numDiscreteVals = int(numDiscreteVals)
     self._marksStat = marksStat
     assert numDiscreteVals is not None
     self._printIntervals = printIntervals
     Statistic.__init__(self,
                        region,
                        track,
                        track2,
                        numDiscreteVals=numDiscreteVals,
                        marksStat=marksStat,
                        **kwArgs)
Beispiel #44
0
 def __init__(self,
              region,
              track,
              track2=None,
              withOverlaps='no',
              markType='number',
              enforcePoints=True,
              **kwArgs):
     assert (withOverlaps in ['no', 'yes'])
     self._withOverlaps = withOverlaps
     self._markType = markType
     if isinstance(enforcePoints, basestring):
         enforcePoints = ast.literal_eval(enforcePoints)
     self._enforcePoints = enforcePoints
     Statistic.__init__(self,
                        region,
                        track,
                        track2,
                        withOverlaps=withOverlaps,
                        markType=markType,
                        enforcePoints=enforcePoints,
                        **kwArgs)
    def __init__(self,
                 region,
                 track,
                 track2,
                 method='pearson',
                 tail='different',
                 **kwArgs):
        assert method in ['pearson', 'spearman', 'kendall']
        assert tail in ['more', 'less', 'different']
        tailMapping = {
            'more': "greater",
            'less': "less",
            'different': "two.sided"
        }

        self._method = method
        self._rTail = tailMapping[tail]
        Statistic.__init__(self,
                           region,
                           track,
                           track2,
                           method=method,
                           tail=tail,
                           **kwArgs)
 def __init__(self, region, track, track2=None, numDiscreteVals=None, marksStat='MarksListStat', **kwArgs):
     self._numDiscreteVals = int(numDiscreteVals)
     self._marksStat = marksStat
     assert numDiscreteVals is not None
     Statistic.__init__(self, region, track, track2, numDiscreteVals=numDiscreteVals, marksStat=marksStat, **kwArgs)
 def __init__(self, region, track, track2, tail='more', **kwArgs):
     assert( tail in ['less','more','different'])
     self._tail = tail
     Statistic.__init__(self, region, track, track2, tail=tail, **kwArgs)
 def __init__(self, region, track, track2, rawStatistic, **kwArgs):
     self._rawStatistic = rawStatistic
     Statistic.__init__(self, region, track, track2, rawStatistic=rawStatistic, **kwArgs)
 def __init__(self, region, track, track2, aggregateOperation=None, **kwArgs):
     self._aggregateOperation = aggregateOperation
     Statistic.__init__(self, region, track, track2, aggregateOperation=aggregateOperation, **kwArgs)
 def __init__(self, region, track, track2, **kwArgs):
     Statistic.__init__(self, region, track, track2, **kwArgs)
 def __init__(self, region, track, track2, numDiscreteVals=None, **kwArgs):
     self._numDiscreteVals = numDiscreteVals            
     Statistic.__init__(self, region, track, track2, numDiscreteVals=numDiscreteVals, **kwArgs)
 def __init__(self, region, track, track2, tail='more', **kwArgs):
     assert (tail in ['less', 'more', 'different'])
     self._tail = tail
     Statistic.__init__(self, region, track, track2, tail=tail, **kwArgs)
 def __init__(self, region, track, track2, calcPointTotals=False, **kwArgs):
     if type(calcPointTotals) == str:
         calcPointTotals = eval(calcPointTotals)
     self._calcPointTotals = calcPointTotals
     Statistic.__init__(self, region, track, track2, calcPointTotals=calcPointTotals, **kwArgs)
 def __init__(self, region, track, track2, markReq=None, **kwArgs):        
     self._markReq = markReq
     Statistic.__init__(self, region, track, track2, markReq=markReq, **kwArgs)
 def __init__(self, region, track, track2, tail='', **kwArgs):
     self._altHyp = tail
     if not self._altHyp in ['ha1','ha2','ha3','ha4']:
         raise NotSupportedError(self._altHyp)
     Statistic.__init__(self, region, track, track2, tail=tail, **kwArgs)
 def __init__(self, region, track, track2=None, numDiscreteVals=None, reducedNumDiscreteVals=None, **kwArgs):
     self._numDiscreteVals = int(numDiscreteVals)
     self._reducedNumDiscreteVals = int(reducedNumDiscreteVals)
     assert numDiscreteVals is not None and numDiscreteVals==reducedNumDiscreteVals
     Statistic.__init__(self, region, track, track2, numDiscreteVals=numDiscreteVals, reducedNumDiscreteVals=reducedNumDiscreteVals, **kwArgs)
 def __init__(self, region, track, track2=None, numSubBins=10, **kwArgs):
     #track2 is ignored..
     self._numSubBins = int(numSubBins)
     Statistic.__init__(self, region, track, track2, numSubBins=numSubBins, **kwArgs)
 def __init__(self, region, track, track2, markType='number', **kwArgs):
     self._markType = markType
     #r('sink(file("/dev/null", open="wt"), type="message")')
     silenceRWarnings()
     
     Statistic.__init__(self, region, track, track2, markType=markType, **kwArgs)
 def __init__(self, region, track, track2, scriptFn='', **kwArgs):
     self._scriptFn = scriptFn
     if self._scriptFn != '':
         self._useMC = any(["#Use in Monte Carlo" in line for line in open(scriptFn.decode('hex_codec'))])
             
     Statistic.__init__(self, region, track, track2, scriptFn=scriptFn, **kwArgs)
 def __init__(self, region, track, track2, distDirection='both', **kwArgs):
     assert( distDirection in ['both']) #only supported now..
     
     self._distDirection = distDirection
     Statistic.__init__(self, region, track, track2, distDirection=distDirection, **kwArgs)