rule star_index:
    """
    Genome indexation for RNA-STAR mapper

    Required input:
        __star_index__fasta: the reference genome to indexed in FASTA format

    Required output:
        __star_index__output_done: done file for STAR mapping rule

    params:

        __star_index__output_dir: the directory where write the index

    """


    input:
       fasta =  __star_index__fasta
    output:
        __star_index__output_done
    params:
        wkdir = __star_index__output_dir
    log:
        __star_index__log
    shell:
        """
        STAR --runMode genomeGenerate --genomeFastaFiles {input.fasta} --genomeDir {params.wkdir}
        samtools faidx {input.fasta}
        """
