def genomeToBlock(chrom, start, end, L=1000000000, blockSize=5000000, delimiter='.'):
    """Transform genomic to block coordinates.
    
    @param chrom: Chromosome
    @param start: Start coordinate
    @param end: End coorinate
    @param L: Chromosome length
    @param blockSize: Block size (Default: 5000000)
    @returns: (block, relStart, relEnd)
    """
    strand = '+'
    if start>end:
        strand = '-'
        start,end = end,start
    
    blockStart = 1 + blockSize*int(start/blockSize)
    blockEnd = min(L, blockStart+blockSize-1)
    block = '%s%s%i-%i' % (chrom, delimiter, blockStart, blockEnd)
    
    relStart = start % blockSize
    relEnd = end % blockSize
    if strand=='-':
        relStart,relEnd = relEnd,relStart
    
    return block,relStart,relEnd