Skip to content

Commit 7b855df

Browse files
committed
fix: SAMPLES -> samples
1 parent 01c031d commit 7b855df

File tree

1 file changed

+12
-9
lines changed

1 file changed

+12
-9
lines changed

slides/creators/A_First_Workflow.tex

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -634,12 +634,15 @@ \subsection{A first Step or ``Rule''}
634634
The next step in our workflow will aggregate the mapped reads from all samples and jointly call genomic variants on them. We need two tools: \lhref{https://www.htslib.org/}{samtools} and \lhref{https://www.htslib.org/}{bcftools}. \newline \pause
635635
\Snakemake{} provides a helper function for collecting input files that helps us to describe the aggregation in this step. With
636636
\begin{lstlisting}[language=Python,style=Python]
637-
expand("sorted_reads/{sample}.bam", sample=SAMPLES)
637+
expand("sorted_reads/{sample}.bam", sample=samples)
638638
\end{lstlisting}
639-
we obtain a list where the given pattern \altverb{sorted_reads/\{sample\}.bam} was formatted with the values in a given list of samples \altverb{SAMPLES}, i.\,e.
639+
we obtain a list where the given pattern \altverb{sorted_reads/\{sample\}.bam} was formatted with the values in a given list of samples \altverb{samples}, i.\,e.
640640
\begin{lstlisting}[language=Python,style=Python]
641-
SAMPLES = ["sorted_reads/A.bam",
642-
"sorted_reads/B.bam"]
641+
samples = ["A", "B"]
642+
sorted_reads = expand("sorted_reads/{sample}.bam", sample=samples)
643+
print(sorted_reads)
644+
# will print
645+
# ["sorted_reads/A.bam", "sorted_reads/B.bam"]
643646
\end{lstlisting}
644647
\end{frame}
645648

@@ -649,9 +652,9 @@ \subsection{A first Step or ``Rule''}
649652
This is particularly useful when dealing with \emph{multiple} wildcards, e.\,g.:
650653
\begin{lstlisting}[language=Python,style=Python]
651654
expand("sorted_reads/{sample}.{replicate}.bam",
652-
sample=SAMPLES, replicate=[0, 1])
655+
sample=samples, replicate=[0, 1])
653656
\end{lstlisting}
654-
With all elements of \altverb{SAMPLES} and the list \altverb{[0, 1]}, we get:
657+
With all elements of \altverb{samples} and the list \altverb{[0, 1]}, we get:
655658
\begin{lstlisting}[language=Python,style=Python]
656659
["sorted_reads/A.0.bam", "sorted_reads/A.1.bam",
657660
"sorted_reads/B.0.bam", "sorted_reads/B.1.bam"]
@@ -664,15 +667,15 @@ \subsection{A first Step or ``Rule''}
664667
Later, we will learn how to provide input more sophistically \ldots\newline
665668
For now, we will define a list on top of our \altverb{Snakefile}:
666669
\begin{lstlisting}[language=Python,style=Python]
667-
SAMPLES = ["A", "B"]
670+
samples = ["A", "B"]
668671
\end{lstlisting}
669672
Now, we can add the following rule to our \altverb{Snakefile}:
670673
\begin{lstlisting}[language=Python,style=Python,basicstyle=\footnotesize]
671674
rule bcftools_call:
672675
input:
673676
fa="data/genome.fa",
674-
bam=@expand("sorted_reads/{sample}.bam", sample=SAMPLES),@
675-
ai=@expand("sorted_reads/{sample}.bam.bai", sample=SAMPLES)@
677+
bam=@expand("sorted_reads/{sample}.bam", sample=samples),@
678+
ai=@expand("sorted_reads/{sample}.bam.bai", sample=samples)@
676679
output:
677680
"calls/all.vcf"
678681
shell:

0 commit comments

Comments
 (0)