rule all:
    input:
        "output2.txt"

rule basic:
    """
    This is a basic Snakemake rule.

    .. note::
       Note that we are using the documentation here to provide extra context
       to the rule properties (input, output, etc.). We are not simply
       reproducing the rule. To see the code we can just use the ``source``
       link on the right.

    .. note::
       In the ``smk:autodoc`` directive, we specified a default config file.
       Any ``config`` entries in the docstring will now automatically have the
       default values appended.

    :input:
        A text file. Could be empty for this dummy rule.
    :output:
        Will contain a copy of the input. Also included in the Snakemake report.
    :config galaxy.mass:
        The galaxy mass.
    :param a:
        Sets the the expansion factor of the Universe.
    :param b:
        A luminous blue star.
    :param mass:
        The galaxy mass, set by the ``galaxy.mass`` config value
    """

    input:
        "input.txt"
    output:
        report("output.txt")
    conda:
        "envs/test1.yaml"
    params:
        a=1.0,
        b=20,
        mass=config["galaxy"]["mass"]
    resources:
        mem_mb=2
    shell:
        "cat {input} > {output} && echo {params.a} >> {output}"

rule follows_basic:
    """
    This rule is super simple. Maybe one day it will not be so...
    """

    input:
        "output.txt"
    output:
        "output2.txt"
    shell:
        "echo 'output.txt content = ' > {output} && cat {input} >> {output}"

rule basic_google_style:
    """
    This is a basic Snakemake rule with Google style docstrings.

    Note:
        Note that we are using the documentation here to provide extra context
        to the rule properties (input, output, etc.). We are not simply
        reproducing the rule. To see the code we can just use the ``source``
        link on the right.

    Note:
        In the ``smk:autodoc`` directive, we specified a default config file.
        Any ``config`` entries in the docstring will now automatically have the
        default values appended.

    Input:
        : A text file. Could be empty for this dummy rule.

          Notice the use of a ``:`` at the start of this sourcecode for this
          description which is required to document an unnamed parameter.

    Output:
        : Will contain a copy of the input. Also included in the Snakemake report.

    Config:
        galaxy.mass: The galaxy mass.

    Params:
        a: Sets the the expansion factor of the Universe.
        b: A luminous blue star.
        mass: The galaxy mass, set by the ``galaxy.mass`` config value
    """

    input:
        "input.txt"
    output:
        report("output.txt")
    conda:
        "envs/test1.yaml"
    params:
        a=1.0,
        b=20,
        mass=config["galaxy"]["mass"]
    resources:
        mem_mb=2
    shell:
        "cat {input} > {output} && echo {params.a} >> {output}"
