@@ -274,7 +274,7 @@ of your kid's first birthday party, you also want to avoid overwriting your data
274
274
```
275
275
276
276
```output
277
- 802 bad_reads.txt
277
+ 537 bad_reads.txt
278
278
```
279
279
!!! terminal "code"
280
280
@@ -300,7 +300,7 @@ search sequence. So our file was overwritten and is now empty.
300
300
```
301
301
302
302
```output
303
- 802 bad_reads.txt
303
+ 537 bad_reads.txt
304
304
```
305
305
306
306
```bash
@@ -309,7 +309,7 @@ search sequence. So our file was overwritten and is now empty.
309
309
```
310
310
311
311
```output
312
- 802 bad_reads.txt
312
+ 537 bad_reads.txt
313
313
```
314
314
315
315
The output of our second call to ` wc ` shows that we have not overwritten our original data.
@@ -322,7 +322,7 @@ The output of our second call to `wc` shows that we have not overwritten our ori
322
322
```
323
323
324
324
```output
325
- 802 bad_reads.txt
325
+ 537 bad_reads.txt
326
326
```
327
327
328
328
@@ -412,15 +412,15 @@ number of lines. Luckily, this issue happens by the end of the file so we can al
412
412
#!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
413
413
```
414
414
415
- The fifth and six lines in the output display "--" which is the default action for ` grep ` to separate groups of
415
+ The sixth line in the output display "--" which is the default action for ` grep ` to separate groups of
416
416
lines matching the pattern, and indicate groups of lines which did not match the pattern so are not displayed.
417
417
To fix this issue, we can redirect the output of grep to a second instance of ` grep ` as follows.
418
418
419
419
!!! terminal "code"
420
420
421
421
```bash
422
- $ grep -B1 -A2 NNNNNNNNNN SRR098026.fastq | grep -v '^--' > bad_reads.fastq
423
- $ tail bad_reads.fastq
422
+ $ grep -B1 -A2 NNNNNNNNNN SRR098026.fastq | grep -v '^--' > bad_reads.txt
423
+ $ tail bad_reads.txt
424
424
```
425
425
426
426
```output
@@ -436,10 +436,10 @@ To fix this issue, we can redirect the output of grep to a second instance of `g
436
436
#!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
437
437
```
438
438
439
- The ` -v ` option in the second ` grep ` search stands for ` --invert-match ` meaning ` grep ` will now only display the
440
- lines which do not match the searched pattern, in this case ` '^--' ` . The caret (` ^ ` ) is an ** anchoring**
441
- character matching the beginning of the line, and the pattern has to be enclose by single quotes so ` grep ` does
442
- not interpret the pattern as an extended option (starting with --).
439
+ The `-v` option in the second `grep` search stands for `--invert-match` meaning `grep` will now only display the
440
+ lines which do not match the searched pattern, in this case `'^--'`. The caret (`^`) is an **anchoring**
441
+ character matching the beginning of the line, and the pattern has to be enclose by single quotes so `grep` does
442
+ not interpret the pattern as an extended option (starting with --).
443
443
444
444
445
445
0 commit comments