def _getGenomeRegion(seqid, start, end): if seqid in [None, '', '.'] or start in [None, '', '.']: return None curReg = GenomeRegion(chr=seqid, start=int(start)) if end is not None: curReg.end = int(end) else: curReg.end = int(end) + 1 return curReg
def splitUserBin(region): 'Splits a region into several compBins, based on borders as defined by getCompBinSize' #assert( len(region) > 0 ) start = (int(region.start) / CompBinManager.getCompBinSize() ) * CompBinManager.getCompBinSize( ) #round off to nearest whole compBin border compBins = [] while start < region.end: part = GenomeRegion(region.genome, region.chr) end = start + CompBinManager.getCompBinSize() part.start = max(start, region.start) part.end = min(end, region.end) compBins.append(part) start += CompBinManager.getCompBinSize() return compBins