Esempio n. 1
0
 def __new__(cls, regSpec, binSpec, genome=None, categoryFilterList=None, strictMatch=True, includeExtraChrs = False): #,fileType):
     if regSpec in ['file', 'track'] + getSupportedFileSuffixesForBinning():
         #if fileType != 'bed':
         #    raise NotImplementedError
         
         assert genome is not None
         
         from gtrackcore.input.core.GenomeElementSource import GenomeElementSource
         if regSpec == 'file':
             geSource = GenomeElementSource(binSpec, genome=genome)
         elif regSpec == 'track':
             from gtrackcore.input.adapters.TrackGenomeElementSource import FullTrackGenomeElementSource
             trackName = convertTNstrToTNListFormat(binSpec)
             geSource = FullTrackGenomeElementSource(genome, trackName, allowOverlaps=False)
         else:
             geSource = GenomeElementSource(binSpec, genome=genome, suffix=regSpec)
         
         if categoryFilterList is not None:
             from gtrackcore.input.wrappers.GECategoryFilter import GECategoryFilter
             geSource = GECategoryFilter(geSource, categoryFilterList, strict=strictMatch)
         return cls._applyEnvelope(geSource)
     else:
         if binSpec == '*':
             binSize = None
         else:
             binSize = parseShortenedSizeSpec(binSpec)
         
         from gtrackcore.input.userbins.AutoBinner import AutoBinner
         return AutoBinner(parseRegSpec(regSpec, genome, includeExtraChrs=includeExtraChrs), binSize)
 def __init__(self, origTrack, origRegion, randIndex, trackNameIntensity="", **kwArgs):
     #print 'INTENSITY TRACK IS USED: ',trackNameIntensity
     self._minimal = ('minimal' in kwArgs and kwArgs['minimal'] == True)
     #from gtrackcore.util.CommonFunctions import isIter
     #from gtrackcore.util.CustomExceptions import SplittableStatNotAvailableError
     #if isIter(origRegion):
     #    raise SplittableStatNotAvailableError
     RandomizedTrack.__init__(self, origTrack, origRegion, randIndex, trackNameIntensity=trackNameIntensity, **kwArgs)
     #self._trackNameIntensity = [unquote(x) for x in convertTNstrToTNListFormat(trackNameIntensity)]
     self._trackNameIntensity = convertTNstrToTNListFormat(trackNameIntensity)
Esempio n. 3
0
    def __new__(cls,
                regSpec,
                binSpec,
                genome=None,
                categoryFilterList=None,
                strictMatch=True,
                includeExtraChrs=False):  #,fileType):
        if regSpec in ['file', 'track'] + getSupportedFileSuffixesForBinning():
            #if fileType != 'bed':
            #    raise NotImplementedError

            assert genome is not None

            from gtrackcore.input.core.GenomeElementSource import GenomeElementSource
            if regSpec == 'file':
                geSource = GenomeElementSource(binSpec, genome=genome)
            elif regSpec == 'track':
                from gtrackcore.input.adapters.TrackGenomeElementSource import FullTrackGenomeElementSource
                trackName = convertTNstrToTNListFormat(binSpec)
                geSource = FullTrackGenomeElementSource(genome,
                                                        trackName,
                                                        allowOverlaps=False)
            else:
                geSource = GenomeElementSource(binSpec,
                                               genome=genome,
                                               suffix=regSpec)

            if categoryFilterList is not None:
                from gtrackcore.input.wrappers.GECategoryFilter import GECategoryFilter
                geSource = GECategoryFilter(geSource,
                                            categoryFilterList,
                                            strict=strictMatch)
            return cls._applyEnvelope(geSource)
        else:
            if binSpec == '*':
                binSize = None
            else:
                binSize = parseShortenedSizeSpec(binSpec)

            from gtrackcore.input.userbins.AutoBinner import AutoBinner
            return AutoBinner(
                parseRegSpec(regSpec,
                             genome,
                             includeExtraChrs=includeExtraChrs), binSize)
Esempio n. 4
0
 def __init__(self,
              origTrack,
              origRegion,
              randIndex,
              trackNameIntensity="",
              **kwArgs):
     #print 'INTENSITY TRACK IS USED: ',trackNameIntensity
     self._minimal = ('minimal' in kwArgs and kwArgs['minimal'] == True)
     #from gtrackcore.util.CommonFunctions import isIter
     #from gtrackcore.util.CustomExceptions import SplittableStatNotAvailableError
     #if isIter(origRegion):
     #    raise SplittableStatNotAvailableError
     RandomizedTrack.__init__(self,
                              origTrack,
                              origRegion,
                              randIndex,
                              trackNameIntensity=trackNameIntensity,
                              **kwArgs)
     #self._trackNameIntensity = [unquote(x) for x in convertTNstrToTNListFormat(trackNameIntensity)]
     self._trackNameIntensity = convertTNstrToTNListFormat(
         trackNameIntensity)
Esempio n. 5
0
def _convertTrackName(trackName):
    from gtrackcore.util.CommonFunctions import convertTNstrToTNListFormat
    return convertTNstrToTNListFormat(trackName, doUnquoting=True)
Esempio n. 6
0
def _convertTrackName(trackName):
    from gtrackcore.util.CommonFunctions import convertTNstrToTNListFormat
    return convertTNstrToTNListFormat(trackName, doUnquoting=True)