|
152 | 152 | snakemake -s exo5.smk -R all fastqc
|
153 | 153 | </code></pre><p><em><strong><span>Observe the results</span></strong></em><br>
|
154 | 154 | <span>Does Snakemake do the job?</span></p><p><em><strong><span>Fastqc: job or jobs?</span></strong></em><br>
|
155 |
| -<span>Look at more precisely the fastqc job. We have many input files but snakemake launched only one fastqc job:</span></p><p><img src="https://github.com/chernan/FAIR_bioinfo_docs/blob/master/03_workflow/images/FAIR_ex1_o5_smk.png" alt="image"></p><p><span>It is because thefastqcrule is defined with a list of files and not for one unique file and because thefastqc tool accepts both a unique file as wellas a list of files.</span></p><h3 id="Objective-6-Running-n-individual-jobs" data-id="Objective-6-Running-n-individual-jobs"><a class="anchor hidden-xs" href="#Objective-6-Running-n-individual-jobs" title="Objective-6-Running-n-individual-jobs"><span class="octicon octicon-link"></span></a><span>Objective 6: Running n individual jobs</span></h3><p><span>Create snakemake file </span><em><span>exo6.smk</span></em><span>. Improve previous code: Thank to the all rule, all expected files are designated. So we don’t need to give the fastqc rule a list anymore and we can replace it to manage only one file and all files one by one. We will gain in power in system shaving more than one core.</span></p><hr><p><em><strong><span>HINT</span></strong></em><br> |
| 155 | +<span>Look at more precisely the fastqc job. We have many input files but snakemake launched only one fastqc job:</span></p><p><img src="https://github.com/chernan/FAIR_bioinfo_docs/raw/master/03_workflow/images/FAIR_ex1_o5_smk.png" alt="image"></p><p><span>It is because thefastqcrule is defined with a list of files and not for one unique file and because thefastqc tool accepts both a unique file as wellas a list of files.</span></p><h3 id="Objective-6-Running-n-individual-jobs" data-id="Objective-6-Running-n-individual-jobs"><a class="anchor hidden-xs" href="#Objective-6-Running-n-individual-jobs" title="Objective-6-Running-n-individual-jobs"><span class="octicon octicon-link"></span></a><span>Objective 6: Running n individual jobs</span></h3><p><span>Create snakemake file </span><em><span>exo6.smk</span></em><span>. Improve previous code: Thank to the all rule, all expected files are designated. So we don’t need to give the fastqc rule a list anymore and we can replace it to manage only one file and all files one by one. We will gain in power in system shaving more than one core.</span></p><hr><p><em><strong><span>HINT</span></strong></em><br> |
156 | 156 | <span>Replace the expand()function with a wildcard for one filename in the fastqc rule.</span></p><hr><p><strong><span>Solution</span></strong></p><pre><code>SAMPLES = ["SRR3099585_chr18","SRR3099586_chr18","SRR3099587_chr18"]
|
157 | 157 | BIDX = ["1","2","3","4","rev.1","rev.2"]
|
158 | 158 |
|
|
178 | 178 | </code></pre><p><strong><span>Snakemake run</span></strong></p><pre><code>rm -Rf FastQC/
|
179 | 179 | snakemake -s exo6.smk -R all fastqc
|
180 | 180 | </code></pre><p><em><strong><span>Observe the results</span></strong></em><br>
|
181 |
| -<span>Now Snakemake did many fastqc jobs:</span></p><p><img src="https://github.com/chernan/FAIR_bioinfo_docs/blob/master/03_workflow/images/FAIR_ex1_o6_smk.png" alt="image"></p><p><span>But what happens to the runtime displays on the screen? To correct this, we will move the displays to a log file specific for each rule and each input file.</span></p><h3 id="Objective-7-Adding-log-file" data-id="Objective-7-Adding-log-file"><a class="anchor hidden-xs" href="#Objective-7-Adding-log-file" title="Objective-7-Adding-log-file"><span class="octicon octicon-link"></span></a><span>Objective 7: Adding log file</span></h3><p><span>Create snakemake file </span><em><span>exo7.smk</span></em><span>. Improve previous code:</span><br> |
| 181 | +<span>Now Snakemake did many fastqc jobs:</span></p><p><img src="https://github.com/chernan/FAIR_bioinfo_docs/raw/master/03_workflow/images/FAIR_ex1_o6_smk.png" alt="image"></p><p><span>But what happens to the runtime displays on the screen? To correct this, we will move the displays to a log file specific for each rule and each input file.</span></p><h3 id="Objective-7-Adding-log-file" data-id="Objective-7-Adding-log-file"><a class="anchor hidden-xs" href="#Objective-7-Adding-log-file" title="Objective-7-Adding-log-file"><span class="octicon octicon-link"></span></a><span>Objective 7: Adding log file</span></h3><p><span>Create snakemake file </span><em><span>exo7.smk</span></em><span>. Improve previous code:</span><br> |
182 | 182 | <span>In Unix systems, the output of a command is usually sent to two separate streams: the normal output: to Standard Out (stdout also “>” in shell),and error messages: to Standard Error (stderr, or “2>” in shell). To integrate stderr into the same log file as the stdout can be use “&>” instead of “>”:</span><br>
|
183 | 183 | <span>shell: … &> {log}, but use with care when output files are printed tostdout (as often in shell comands). Redirect the stdout and stderr streams of the fastqc and bowtie2-build commands.</span></p><hr><p><em><strong><span>HINT</span></strong></em><br>
|
184 | 184 | <span>For the bowtie2-build and fastqc rules, add the log: directive with two variables (log1 and log2) to redirect each streams.</span></p><hr><p><strong><span>Solution</span></strong></p><pre><code>SAMPLES = ["SRR3099585_chr18","SRR3099586_chr18","SRR3099587_chr18"]
|
|
0 commit comments