snakemake-novice-bioinformatics icon indicating copy to clipboard operation
snakemake-novice-bioinformatics copied to clipboard

Another option for formatting multi-line shell commands

Open tbooth opened this issue 1 year ago • 2 comments

From @jdblischak

I know you recommend using r""" to make the quoting more robust, but personally I find this more readable:

 shell:
        """
        fastqc -o . {input}
        mv {wildcards.sample}_fastqc.html {output.html}
        mv {wildcards.sample}_fastqc.zip  {output.zip}
        """

compared to your recommendation:

shell:
       r"""fastqc -o . {input}
           mv {wildcards.sample}_fastqc.html {output.html}
           mv {wildcards.sample}_fastqc.zip  {output.zip}
        """

Especially since this example doesn't require robust quoting.

tbooth avatar Sep 21 '23 10:09 tbooth