Seqanswers Leaderboard Ad

Collapse

Announcement

Collapse
No announcement yet.
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Number of Reads

    Hi there,
    I have Illumina HiSeq fastq output files. I want to know how I can find out the number of reads per sample before and after processing using unix.
    Any commands that you might know of?
    I'd greatly appreciate it
    Thanks!

  • #2
    Code:
     wc -l
    gives you the number of lines. Divide that by 4 to get the number of reads.

    Comment


    • #3
      If the file is not compressed:
      Code:
      grep -c '^@' yourfile.fastq
      If the file is gz compressed:
      Code:
      zcat yourfile.fastq.gz | grep -c '^@'
      If the file is depressed:
      Code:
      talk to it about feelings and give chocolate

      Comment


      • #4
        You can also run it through FastQC before and after processing. This will give you number of reads and a lot of other useful information.

        Josh Kinman

        Comment


        • #5
          The quality scores may sometimes have a value '@', so you may have some of the base quality lines also beginning with '@'.

          Comment


          • #6
            Originally posted by mastal View Post
            The quality scores may sometimes have a value '@', so you may have some of the base quality lines also beginning with '@'.
            Right, good catch

            Comment


            • #7
              samtools flagstat

              Comment


              • #8
                thanks everyone!
                how about to find the number of bases?

                Comment


                • #9
                  It should be something like
                  Code:
                  awk 'NR%4==2{print}' in.fastq | wc
                  With the awk command, you print the nucleotides, with wc you count the output's characters.

                  Comment


                  • #10
                    I like to use BBMap's Reformat:
                    Code:
                    reformat.sh in=100x.fq
                    
                    No output stream specified.  To write to stdout, please specify 'out=stdout.fq' or similar.
                    Input is being processed as paired
                    Input:                  	3072634 reads          	463967734 bases
                    Output:                 	3072634 reads (100.00%) 	463967734 bases (100.00%)
                    
                    Time:                         	3.317 seconds.
                    Reads Processed:       3072k 	926.30k reads/sec
                    Bases Processed:        463m 	139.87m bases/sec
                    That has the advantage of working on fasta, fastq, or sam; compressed or raw. And various other formats.

                    Comment

                    Latest Articles

                    Collapse

                    • seqadmin
                      Strategies for Sequencing Challenging Samples
                      by seqadmin


                      Despite advancements in sequencing platforms and related sample preparation technologies, certain sample types continue to present significant challenges that can compromise sequencing results. Pedro Echave, Senior Manager of the Global Business Segment at Revvity, explained that the success of a sequencing experiment ultimately depends on the amount and integrity of the nucleic acid template (RNA or DNA) obtained from a sample. “The better the quality of the nucleic acid isolated...
                      03-22-2024, 06:39 AM
                    • seqadmin
                      Techniques and Challenges in Conservation Genomics
                      by seqadmin



                      The field of conservation genomics centers on applying genomics technologies in support of conservation efforts and the preservation of biodiversity. This article features interviews with two researchers who showcase their innovative work and highlight the current state and future of conservation genomics.

                      Avian Conservation
                      Matthew DeSaix, a recent doctoral graduate from Kristen Ruegg’s lab at The University of Colorado, shared that most of his research...
                      03-08-2024, 10:41 AM

                    ad_right_rmr

                    Collapse

                    News

                    Collapse

                    Topics Statistics Last Post
                    Started by seqadmin, Yesterday, 06:37 PM
                    0 responses
                    10 views
                    0 likes
                    Last Post seqadmin  
                    Started by seqadmin, Yesterday, 06:07 PM
                    0 responses
                    9 views
                    0 likes
                    Last Post seqadmin  
                    Started by seqadmin, 03-22-2024, 10:03 AM
                    0 responses
                    51 views
                    0 likes
                    Last Post seqadmin  
                    Started by seqadmin, 03-21-2024, 07:32 AM
                    0 responses
                    67 views
                    0 likes
                    Last Post seqadmin  
                    Working...
                    X