rule DupRadar:
    """
    DupRadar (bioconductor package) allows to control duplication rate for RNA-Seq datasets.

    Required input:
        __DupRadar__input: a output DupRadar directory

    Required output:
        __DupRadar__outdir: DupRadar directory results

    Config:

        .. code-block:: yaml

            dupradar:
                stranded: yes #may be no|yes|reverse
                paired: no #may be no|yes


    """


    input:
        __DupRadar__input_bam
    log:
        __DupRadar__logs
    output:
        touch(__DupRadar__output),
        outdir = __DupRadar__outdir
    threads: 4
    params:
        gtf = __DupRadar__gtf,
        strand = config['dupradar']['stranded'],
        paired = config['dupradar']['paired']
    shell:
        """
        Rscript --vanilla /pasteur/projets/specific/PF2_ngs/protected/scripts/dupRadar.R \
	    {input} {params.gtf} {params.strand} {params.paired} {output.outdir} {threads}
        """
