def _write_project_files(tmpdir, all_samples, sp_samples, sp_name):
<EOL>def sample_data(samples):<EOL><INDENT>return [(s.sample_name, getattr(s, "<STR_LIT>", "<STR_LIT>")) for s in samples]<EOL><DEDENT>def write_anns(fh, samples):<EOL><INDENT>fh.write("<STR_LIT:\n>".join(map(<EOL>lambda name_proto_pair: "<STR_LIT>".format(*name_proto_pair),<EOL>[(SAMPLE_NAME_COLNAME, "<STR_LIT>")] + sample_data(samples))))<EOL><DEDENT>metadir = tmpdir.mkdir(METADATA_KEY)<EOL>full_anns = metadir.join("<STR_LIT>")<EOL>write_anns(full_anns, all_samples)<EOL>sp_anns = metadir.join("<STR_LIT>")<EOL>write_anns(sp_anns, sp_samples)<EOL>pipe_path = os.path.join(tmpdir.strpath, "<STR_LIT>")<EOL>outdir = tmpdir.mkdir("<STR_LIT>")<EOL>conf_data = {<EOL>METADATA_KEY: {<EOL>NAME_TABLE_ATTR: full_anns.strpath, OUTDIR_KEY: outdir.strpath,<EOL>NEW_PIPES_KEY: pipe_path},<EOL>SUBPROJECTS_SECTION: {sp_name: {<EOL>METADATA_KEY: {NAME_TABLE_ATTR: sp_anns.strpath}}}<EOL>}<EOL>conf = metadir.join("<STR_LIT>")<EOL>with open(conf.strpath, '<STR_LIT:w>') as f:<EOL><INDENT>yaml.dump(conf_data, f)<EOL><DEDENT>return conf.strpath<EOL>
Write key project files.

:param py._path.local.LocalPath tmpdir: tmpdir fixture from test case
:param Iterable[Sample] all_samples: collection of samples for the
    main Project sample annotations
:param Iterable[Sample] sp_samples: collection of samples for the
    subproject
:return str: Project config file