rule custom__prepare_description_file:
    """
    Extract ID and description from input reference sequences in FASTA format.
    Assuming that id is the first word after '>'.
    :input reference: Genomic sequences in FASTA format
    :output desc: Description TSV file - 1st column is id of sequence, 2nd is description
    """
    input:
        reference = 'reference/{reference}/{sequences}.fa'
    output:
        dict = protected('reference/{reference}/{sequences}.desc')
    log:
        out = 'reference/{reference}/log/{sequences}.desc.log',
        err = 'reference/{reference}/log/{sequences}.desc.err'
    params:
        script_path = srcdir('scripts/prepare_description.py')
#    conda:
#        config['snakelines_dir'] + '/environments/description_preparation.yaml'
    shell:
        """
        python3 {params.script_path}\
            {input.reference}\
            {output.dict}\
        1> {log.out}\
        2> {log.err}
        """

