def write_sample_sheet(output_file, accessions, names, celfile_urls, sel=None):
assert isinstance(output_file, str)<EOL>assert isinstance(accessions, (list, tuple))<EOL>for acc in accessions:<EOL><INDENT>assert isinstance(acc, str)<EOL><DEDENT>assert isinstance(names, (list, tuple))<EOL>for n in names:<EOL><INDENT>assert isinstance(n, str)<EOL><DEDENT>assert isinstance(celfile_urls, (list, tuple))<EOL>for u in celfile_urls:<EOL><INDENT>assert isinstance(u, str)<EOL><DEDENT>if sel is not None:<EOL><INDENT>assert isinstance(sel, Iterable)<EOL>for i in sel:<EOL><INDENT>assert isinstance(i, (int, np.integer))<EOL><DEDENT><DEDENT>with open(output_file, '<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(list(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>
Generate a sample sheet in tab-separated text format.

    The columns contain the following sample attributes:
    1) accession
    2) name
    3) CEL file name
    4) CEL file URL

    Parameters
    ----------
    output_file: str
        The path of the output file.
    accessions: list or tuple of str
        The sample accessions.
    names: list or tuple of str
        The sample names.
    celfile_urls: list or tuple of str
        The sample CEL file URLs.
    sel: Iterable, optional
        A list of sample indices to include. If None, all samples are included.
        [None]

    Returns
    -------
    None