def intervalTreesFromList(inElements, verbose=False, openEnded=False):
elements = {}<EOL>if verbose:<EOL><INDENT>totalLines = len(inElements)<EOL>pind = ProgressIndicator(totalToDo=totalLines,<EOL>messagePrefix="<STR_LIT>",<EOL>messageSuffix="<STR_LIT>")<EOL><DEDENT>for element in inElements:<EOL><INDENT>if element.chrom not in elements:<EOL><INDENT>elements[element.chrom] = []<EOL><DEDENT>elements[element.chrom].append(element)<EOL>if verbose:<EOL><INDENT>pind.done += <NUM_LIT:1><EOL>pind.showProgress()<EOL><DEDENT><DEDENT>trees = {}<EOL>if verbose:<EOL><INDENT>totalLines = len(elements)<EOL>pind = ProgressIndicator(totalToDo=totalLines,<EOL>messagePrefix="<STR_LIT>",<EOL>messageSuffix="<STR_LIT>")<EOL><DEDENT>for chrom in elements:<EOL><INDENT>trees[chrom] = IntervalTree(elements[chrom], openEnded)<EOL>if verbose:<EOL><INDENT>pind.done += <NUM_LIT:1><EOL>pind.showProgress()<EOL><DEDENT><DEDENT>return trees<EOL>
build a dictionary, indexed by chrom name, of interval trees for each chrom.

:param inElements: list of genomic intervals. Members of the list must have
                   chrom, start and end fields; no other restrictions.
:param verbose: output progress messages to sys.stderr if True