예제 #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_memmap.input.core.GenomeElementSource import GenomeElementSource
         if regSpec == 'file':
             geSource = GenomeElementSource(binSpec, genome=genome)
         elif regSpec == 'track':
             from gtrackcore_memmap.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_memmap.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_memmap.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_memmap.util.CommonFunctions import isIter
     #from gtrackcore_memmap.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)
예제 #3
0
파일: Api.py 프로젝트: henrikgs/gtrackcore
def _convertTrackName(trackName):
    from gtrackcore_memmap.util.CommonFunctions import convertTNstrToTNListFormat

    return convertTNstrToTNListFormat(trackName, doUnquoting=True)