import re


def blockToGenome(block, startInBlock, endInBlock):
    """Transform block to genomic coordinates.
    
    @param block: Block (chrom.blockStart-blockEnd)
    @param startInBlock: Start coordinate in block
    @param endInBlock: End coorinate in block
    @returns: (chrom, gStart, gEnd)
    """
    prog = re.compile('[\.|:]|-')
    chrom,blockStart,blockEnd = prog.split(block)
    gStart = int(blockStart)+startInBlock-1
    gEnd = int(blockStart)+endInBlock-1
    return chrom,gStart,gEnd