def __find_index(alig_file_pth, idx_extensions):
if idx_extensions is None:<EOL><INDENT>return None<EOL><DEDENT>base, _ = os.path.splitext(alig_file_pth)<EOL>for idx_ext in idx_extensions:<EOL><INDENT>candidate = base + os.extsep + idx_ext<EOL>if os.path.isfile(candidate):<EOL><INDENT>return candidate<EOL><DEDENT><DEDENT>return None<EOL>
Find an index file for a genome alignment file in the same directory.

:param alig_file_path: path to the alignment file.
:param idx_extensions: check for index files with these extensions
:return: path to first index file that matches the name of the alignment file
         and has one of the specified extensions.