def parse_config_file(self, subproject=None):
_LOGGER.debug("<STR_LIT>",<EOL>self.__class__.__name__, self.config_file)<EOL>with open(self.config_file, '<STR_LIT:r>') as conf_file:<EOL><INDENT>config = yaml.safe_load(conf_file)<EOL><DEDENT>assert isinstance(config, Mapping),"<STR_LIT>".format(config, type(config))<EOL>for msg in suggest_implied_attributes(config):<EOL><INDENT>warnings.warn(msg, DeprecationWarning)<EOL><DEDENT>_LOGGER.debug("<STR_LIT>".format(<EOL>self.__class__.__name__, config))<EOL>_LOGGER.debug("<STR_LIT>".format(<EOL>self.__class__.__name__, config.keys()))<EOL>_LOGGER.debug("<STR_LIT>".format(config[METADATA_KEY]))<EOL>self.add_entries(config)<EOL>_LOGGER.debug("<STR_LIT>".format(<EOL>self.__class__.__name__, len(self.keys()), self.keys()))<EOL>if subproject:<EOL><INDENT>if non_null_value(SUBPROJECTS_SECTION, config):<EOL><INDENT>_LOGGER.debug("<STR_LIT>".<EOL>format(subproject))<EOL>try:<EOL><INDENT>subproj_updates = config[SUBPROJECTS_SECTION][subproject]<EOL><DEDENT>except KeyError:<EOL><INDENT>raise MissingSubprojectError(subproject, config[SUBPROJECTS_SECTION])<EOL><DEDENT>_LOGGER.debug("<STR_LIT>".format(subproj_updates))<EOL>self.add_entries(subproj_updates)<EOL>self._subproject = subproject<EOL>_LOGGER.info("<STR_LIT>".format(subproject))<EOL><DEDENT>else:<EOL><INDENT>raise MissingSubprojectError(subproject)<EOL><DEDENT><DEDENT>else:<EOL><INDENT>_LOGGER.debug("<STR_LIT>")<EOL><DEDENT>if "<STR_LIT>" in config:<EOL><INDENT>_LOGGER.warning(<EOL>"<STR_LIT>"<EOL>"<STR_LIT>"<EOL>"<STR_LIT>")<EOL>self.metadata.add_entries(self.paths)<EOL>_LOGGER.debug("<STR_LIT>", str(self.metadata))<EOL>delattr(self, "<STR_LIT>")<EOL><DEDENT>self._constants = config.get("<STR_LIT>", dict())<EOL>for var in self.required_metadata:<EOL><INDENT>if var not in self.metadata:<EOL><INDENT>raise ValueError("<STR_LIT>".format(var))<EOL><DEDENT>self[METADATA_KEY][var] = os.path.expandvars(self.metadata.get(var))<EOL><DEDENT>_LOGGER.debug("<STR_LIT>".format(self.__class__.__name__,<EOL>self.metadata))<EOL>config_vars = {<EOL>"<STR_LIT>": "<STR_LIT>",<EOL>"<STR_LIT>": "<STR_LIT>"<EOL>}<EOL>for key, value in config_vars.items():<EOL><INDENT>if key in self.metadata:<EOL><INDENT>if not os.path.isabs(self.metadata[key]):<EOL><INDENT>self.metadata[key] =os.path.join(self.output_dir, self.metadata[key])<EOL><DEDENT><DEDENT>else:<EOL><INDENT>self.metadata[key] = os.path.join(self.output_dir, value)<EOL><DEDENT><DEDENT>relative_sections = [METADATA_KEY, "<STR_LIT>"]<EOL>_LOGGER.debug("<STR_LIT>")<EOL>for sect in relative_sections:<EOL><INDENT>if not hasattr(self, sect):<EOL><INDENT>_LOGGER.log(<NUM_LIT:5>, "<STR_LIT>",<EOL>self.__class__.__name__, sect)<EOL>continue<EOL><DEDENT>relative_vars = getattr(self, sect)<EOL>if not relative_vars:<EOL><INDENT>_LOGGER.log(<NUM_LIT:5>, "<STR_LIT>")<EOL>continue<EOL><DEDENT>for var in relative_vars.keys():<EOL><INDENT>if not hasattr(relative_vars, var) orgetattr(relative_vars, var) is None:<EOL><INDENT>continue<EOL><DEDENT>relpath = getattr(relative_vars, var)<EOL>_LOGGER.debug("<STR_LIT>", var)<EOL>if isinstance(relpath, list):<EOL><INDENT>absolute = [self._ensure_absolute(maybe_relpath)<EOL>for maybe_relpath in relpath]<EOL><DEDENT>else:<EOL><INDENT>absolute = self._ensure_absolute(relpath)<EOL><DEDENT>_LOGGER.debug("<STR_LIT>", var, absolute)<EOL>setattr(relative_vars, var, absolute)<EOL><DEDENT><DEDENT>if self.dcc.compute is None:<EOL><INDENT>_LOGGER.log(<NUM_LIT:5>, "<STR_LIT>")<EOL><DEDENT>old_table_keys = [OLD_ANNS_META_KEY, OLD_SUBS_META_KEY]<EOL>new_table_keys = [SAMPLE_ANNOTATIONS_KEY, SAMPLE_SUBANNOTATIONS_KEY]<EOL>metadata = self[METADATA_KEY]<EOL>for k_old, k_new in zip(old_table_keys, new_table_keys):<EOL><INDENT>try:<EOL><INDENT>v = metadata[k_old]<EOL><DEDENT>except KeyError:<EOL><INDENT>continue<EOL><DEDENT>metadata[k_new] = v<EOL>del metadata[k_old]<EOL><DEDENT>self[METADATA_KEY] = metadata<EOL>if NAME_TABLE_ATTR not in self[METADATA_KEY]:<EOL><INDENT>self[METADATA_KEY][NAME_TABLE_ATTR] = None<EOL><DEDENT>
Parse provided yaml config file and check required fields exist.

:param str subproject: Name of subproject to activate, optional
:raises KeyError: if config file lacks required section(s)