rule create_sequence_dictionary:
    """
    In the last version of GATK, sequence dictionnary of the reference is no 
    longer automatically generated. It's necessary to run GATK tools. This rule
    creates the necessary dictionnary with picard-tools. The output must have
    ".dict" extension.

    Required input:
        __create_sequence_dictionary__input: reference fasta file

    Required output:
        __create_sequence_dictionary__output: dict file with ".dict" extension.
    """
    input:
        ref = __create_sequence_dictionary__reference
    output:
        __create_sequence_dictionary__output
    log:
        __create_sequence_dictionary__log
    shell:
        """
	    if [[ -a {output} ]];
        then
            rm {output}
        fi
        picard CreateSequenceDictionary R={input.ref} O={output} > {log} 2>&1
        """
