

rule index_ref:
    """DEPRECATED

    bwa_mem_dynamic does the index step automatically


    """
    input:
        config["ref"]
    output:
        config["ref"] + ".bwt"
    log:
        config["output"] + "_logs/bwa_index.logs"
    params:
        bwa_params = " ".join(['%s %s' % (key, value) for (key, value) in \
            config["bwa_index"].items()])
    shell:
        """
        bwa index {params.bwa_params} {input} 2> {log}
        samtools faidx {input} 2>> {log}
        """
