def build_genome_alignment_from_file(ga_path, ref_spec, idx_path=None,<EOL>verbose=False):
blocks = []<EOL>if (idx_path is not None):<EOL><INDENT>bound_iter = functools.partial(genome_alignment_iterator,<EOL>reference_species=ref_spec)<EOL>hash_func = JustInTimeGenomeAlignmentBlock.build_hash<EOL>factory = IndexedFile(None, bound_iter, hash_func)<EOL>factory.read_index(idx_path, ga_path, verbose=verbose)<EOL>pind = None<EOL>for k in factory:<EOL><INDENT>if verbose:<EOL><INDENT>if pind is None:<EOL><INDENT>total = len(factory)<EOL>pind = ProgressIndicator(totalToDo=total, messagePrefix="<STR_LIT>",<EOL>messageSuffix="<STR_LIT>")<EOL><DEDENT>pind.done += <NUM_LIT:1><EOL>pind.showProgress()<EOL><DEDENT>blocks.append(JustInTimeGenomeAlignmentBlock(factory, k))<EOL><DEDENT><DEDENT>else:<EOL><INDENT>for b in genome_alignment_iterator(ga_path, ref_spec, verbose=verbose):<EOL><INDENT>blocks.append(b)<EOL><DEDENT><DEDENT>return GenomeAlignment(blocks, verbose)<EOL>
build a genome alignment by loading from a single MAF file.

:param ga_path:  the path to the file to load.
:param ref_spec: which species in the MAF file is the reference?
:param idx_path: if provided, use this index to generate a just-in-time
                 genome alignment, instead of loading the file immediately.