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
                      Recent Advances in Sequencing Analysis Tools
                      by seqadmin


                      The sequencing world is rapidly changing due to declining costs, enhanced accuracies, and the advent of newer, cutting-edge instruments. Equally important to these developments are improvements in sequencing analysis, a process that converts vast amounts of raw data into a comprehensible and meaningful form. This complex task requires expertise and the right analysis tools. In this article, we highlight the progress and innovation in sequencing analysis by reviewing several of the...
                      05-06-2024, 07:48 AM
                    • seqadmin
                      Essential Discoveries and Tools in Epitranscriptomics
                      by seqadmin




                      The field of epigenetics has traditionally concentrated more on DNA and how changes like methylation and phosphorylation of histones impact gene expression and regulation. However, our increased understanding of RNA modifications and their importance in cellular processes has led to a rise in epitranscriptomics research. “Epitranscriptomics brings together the concepts of epigenetics and gene expression,” explained Adrien Leger, PhD, Principal Research Scientist...
                      04-22-2024, 07:01 AM

                    ad_right_rmr

                    Collapse

                    News

                    Collapse

                    Topics Statistics Last Post
                    Started by seqadmin, 05-07-2024, 06:57 AM
                    0 responses
                    12 views
                    0 likes
                    Last Post seqadmin  
                    Started by seqadmin, 05-06-2024, 07:17 AM
                    0 responses
                    16 views
                    0 likes
                    Last Post seqadmin  
                    Started by seqadmin, 05-02-2024, 08:06 AM
                    0 responses
                    21 views
                    0 likes
                    Last Post seqadmin  
                    Started by seqadmin, 04-30-2024, 12:17 PM
                    0 responses
                    24 views
                    0 likes
                    Last Post seqadmin  
                    Working...
                    X