From ad386c3b91acccea208cb727e6096857153a726b Mon Sep 17 00:00:00 2001 From: Bertrand Neron <bneron@pasteur.fr> Date: Thu, 8 Sep 2022 13:05:52 +0200 Subject: [PATCH] add example to count nb of seq in fastq with grep --- source/Unix/search_filter.rst | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/source/Unix/search_filter.rst b/source/Unix/search_filter.rst index a4d4d11..a850615 100644 --- a/source/Unix/search_filter.rst +++ b/source/Unix/search_filter.rst @@ -57,6 +57,20 @@ Exercises * count the number of sequences in the file 'abcd.fa' (a multiple fasta file) * can we have the same approach with a fastq file? +.. note:: + + We can count the number of + but be careful *+* may appear in quality line even in first position. + So we have to count the *+* which are alone on the line. + + | The line **start** (anchor ^) and finish (anchor $) by *+* + | so our pattern is :code:`^+$` + | do not forget to protect your pattern by surrounding it by quotes 'pattern' + | The complete command line is: + + .. code-block:: + + grep -c '^+$' my_super_fichier.fastq + grep with Regular Expressions ============================= -- GitLab