def write_sample_sheet(path, accessions, names, celfile_urls, sel=None):
with open(path, '<STR_LIT:wb>') as ofh:<EOL><INDENT>writer = csv.writer(ofh, dialect='<STR_LIT>',<EOL>lineterminator=os.linesep,<EOL>quoting=csv.QUOTE_NONE)<EOL>writer.writerow(['<STR_LIT>', '<STR_LIT:Name>', '<STR_LIT>', '<STR_LIT>'])<EOL>n = len(names)<EOL>if sel is None:<EOL><INDENT>sel = range(n)<EOL><DEDENT>for i in sel:<EOL><INDENT>cf = celfile_urls[i].split('<STR_LIT:/>')[-<NUM_LIT:1>]<EOL>writer.writerow([accessions[i], names[i], cf, celfile_urls[i]])<EOL><DEDENT><DEDENT>
Write the sample sheet.