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
                      Advancing Precision Medicine for Rare Diseases in Children
                      by seqadmin




                      Many organizations study rare diseases, but few have a mission as impactful as Rady Children’s Institute for Genomic Medicine (RCIGM). “We are all about changing outcomes for children,” explained Dr. Stephen Kingsmore, President and CEO of the group. The institute’s initial goal was to provide rapid diagnoses for critically ill children and shorten their diagnostic odyssey, a term used to describe the long and arduous process it takes patients to obtain an accurate...
                      12-16-2024, 07:57 AM
                    • seqadmin
                      Recent Advances in Sequencing Technologies
                      by seqadmin



                      Innovations in next-generation sequencing technologies and techniques are driving more precise and comprehensive exploration of complex biological systems. Current advancements include improved accessibility for long-read sequencing and significant progress in single-cell and 3D genomics. This article explores some of the most impactful developments in the field over the past year.

                      Long-Read Sequencing
                      Long-read sequencing has seen remarkable advancements,...
                      12-02-2024, 01:49 PM

                    ad_right_rmr

                    Collapse

                    News

                    Collapse

                    Topics Statistics Last Post
                    Started by seqadmin, 12-17-2024, 10:28 AM
                    0 responses
                    33 views
                    0 likes
                    Last Post seqadmin  
                    Started by seqadmin, 12-13-2024, 08:24 AM
                    0 responses
                    48 views
                    0 likes
                    Last Post seqadmin  
                    Started by seqadmin, 12-12-2024, 07:41 AM
                    0 responses
                    34 views
                    0 likes
                    Last Post seqadmin  
                    Started by seqadmin, 12-11-2024, 07:45 AM
                    0 responses
                    46 views
                    0 likes
                    Last Post seqadmin  
                    Working...
                    X