@MainWrapper<EOL>def main(fastq_pair, adapter_file, cpus):
logger.info("<STR_LIT>")<EOL>if os.path.exists(adapter_file):<EOL><INDENT>logger.info("<STR_LIT>".format(adapter_file))<EOL>adapters = convert_adatpers(adapter_file)<EOL><DEDENT>else:<EOL><INDENT>logger.info("<STR_LIT>"<EOL>"<STR_LIT>".format(adapter_file))<EOL>adapters = None<EOL><DEDENT>cli = [<EOL>"<STR_LIT>",<EOL>"<STR_LIT>",<EOL>"<STR_LIT>",<EOL>"<STR_LIT>",<EOL>"<STR_LIT>",<EOL>"<STR_LIT>",<EOL>str(cpus)<EOL>]<EOL>if adapters:<EOL><INDENT>cli += ["<STR_LIT>", "<STR_LIT:{}>".format(adapters)]<EOL><DEDENT>cli += fastq_pair<EOL>logger.debug("<STR_LIT>".format(cli))<EOL>p = subprocess.Popen(cli, stdout=PIPE, stderr=PIPE, shell=False)<EOL>stdout, stderr = p.communicate()<EOL>try:<EOL><INDENT>stderr = stderr.decode("<STR_LIT:utf8>")<EOL><DEDENT>except (UnicodeDecodeError, AttributeError):<EOL><INDENT>stderr = str(stderr)<EOL><DEDENT>logger.info("<STR_LIT>"<EOL>"<STR_LIT>".format(stdout))<EOL>logger.info("<STR_LIT>"<EOL>"<STR_LIT>".format(stderr))<EOL>logger.info("<STR_LIT>".format(<EOL>p.returncode))<EOL>logger.info("<STR_LIT>")<EOL>with open("<STR_LIT>", "<STR_LIT:w>") as status_fh:<EOL><INDENT>for fastq in fastq_pair:<EOL><INDENT>fpath = join(fastq.rsplit("<STR_LIT:.>", <NUM_LIT:2>)[<NUM_LIT:0>] + "<STR_LIT>",<EOL>"<STR_LIT>")<EOL>logger.debug("<STR_LIT>".format(fpath))<EOL>if not exists(fpath):<EOL><INDENT>logger.warning("<STR_LIT>".format(fpath))<EOL>status_fh.write("<STR_LIT>")<EOL>return<EOL><DEDENT>logger.debug("<STR_LIT>".format(fpath))<EOL>status_fh.write("<STR_LIT>")<EOL><DEDENT><DEDENT>logger.info("<STR_LIT>")<EOL>for i, fastq in enumerate(fastq_pair):<EOL><INDENT>fastqc_dir = fastq.rsplit("<STR_LIT:.>", <NUM_LIT:2>)[<NUM_LIT:0>] + "<STR_LIT>"<EOL>summary_file = join(fastqc_dir, "<STR_LIT>")<EOL>logger.debug("<STR_LIT>".format(summary_file))<EOL>fastqc_data_file = join(fastqc_dir, "<STR_LIT>")<EOL>logger.debug("<STR_LIT>".format(fastqc_data_file))<EOL>os.rename(fastqc_data_file, "<STR_LIT>".format(i + <NUM_LIT:1>))<EOL>os.rename(summary_file, "<STR_LIT>".format(i + <NUM_LIT:1>))<EOL><DEDENT>
Main executor of the fastq template.

    Parameters
    ----------
    fastq_pair : list
        Two element list containing the paired FastQ files.
    adapter_file : str
        Path to adapters file.
    cpus : int or str
        Number of cpu's that will be by FastQC.