File tree Expand file tree Collapse file tree 1 file changed +23
-3
lines changed Expand file tree Collapse file tree 1 file changed +23
-3
lines changed Original file line number Diff line number Diff line change @@ -74,15 +74,19 @@ \subsection{The Configuration File}
74
74
75
75
76
76
% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
77
- \begin {frame }
77
+ \begin {frame }[fragile]
78
78
\frametitle {The Configuration File}
79
- If observed closely you have seen this file:\newline
79
+ Please copy a sample configuration:
80
+ \ begin{lstlisting} [language=Bash, style=Shell]
81
+ cp -r /projects/p_nhr_snakemake/solutions/config .
82
+ \end {lstlisting }
83
+ We now have:\newline
80
84
{\tiny \DTsetlength {0.2em}{1em}{0.2em}{0.4pt}{.6pt}
81
85
\texttt {\$ tree }
82
86
\dirtree {%
83
87
.1 /.
84
88
.2 config.
85
- .3 samples .yaml .
89
+ .3 config .yaml .
86
90
.2 {other stuff}.
87
91
}}
88
92
\pause
@@ -412,6 +416,22 @@ \subsection{The Configuration File}
412
416
\only <1->{A working solution is in \altverb {12_Snakemake_logs} in your solutions folder.}
413
417
\end {frame }
414
418
419
+ % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
420
+ \begin {frame }[fragile]
421
+ \frametitle {Using Logging Functionality in Python Scripts}
422
+ We know how to use the \altverb {log} directive in a rule, yet our scripts?
423
+ \pause
424
+ \ begin{lstlisting} [language=Python,style=Python]
425
+ import sys
426
+
427
+ #somewhere before the actual code starts
428
+ sys.stderr = sys.stdout = open(snakemake.log[0], "wt")
429
+ \end {lstlisting }
430
+ \begin {hint }
431
+ Small scripts do not require \altverb {print()} or logging functionality. It would only clutter the terminal. Yet errors can be catched this way, even in job context.
432
+ \end {hint }
433
+ \end {frame }
434
+
415
435
% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
416
436
\begin {frame }[fragile]
417
437
\frametitle {Temporary Files}
You can’t perform that action at this time.
0 commit comments