def _build_trees_by_chrom(blocks, verbose=False):
if verbose:<EOL><INDENT>sys.stderr.write("<STR_LIT>")<EOL><DEDENT>by_chrom = {}<EOL>for b in blocks:<EOL><INDENT>if b.chrom not in by_chrom:<EOL><INDENT>by_chrom[b.chrom] = []<EOL><DEDENT>by_chrom[b.chrom].append(b)<EOL><DEDENT>if verbose:<EOL><INDENT>sys.stderr.write("<STR_LIT>")<EOL><DEDENT>if verbose:<EOL><INDENT>sys.stderr.write("<STR_LIT>")<EOL><DEDENT>res = {}<EOL>for c in by_chrom:<EOL><INDENT>res[c] = IntervalTree(by_chrom[c], openEnded=True)<EOL><DEDENT>if verbose:<EOL><INDENT>sys.stderr.write("<STR_LIT>")<EOL><DEDENT>return res<EOL>
Construct set of interval trees from an iterable of genome alignment blocks.

:return: a dictionary indexed by chromosome name where each entry is an
         interval tree for that chromosome.