"""fastq to fastq.gz codec

.. author:: Thomas Cokelaer, 2016
"""


rule fastq_to_gz:
    """Convert fastq files to fastq.gz
    Description:
        Takes a fastq file as input (wildcard dataset) an zip the file
        with pigz executable. pigz/unpigz by default uses the number
        of available threads.

    :param input: fastq files
    :return: fastq.gz files
    :third-party executables: unpigz (conda install pigz)

    """
    input: "{dataset}"
    output: "{dataset}.gz"
    threads: config['compressor']['threads']
    run:
        shell("pigz {input} -p {threads}")
