Unconfigured Ad

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts
  • ashiq.hussain
    Junior Member
    • Jun 2011
    • 6

    number of read in RNA-seq?

    another biologist here.

    I got RNA sequence (in .txt format) back from sequencing facility. Each file of 2 lanes high throughput sequencing is nearly 25GB.

    I want to know the number of read in each file. Which programmer or code I should use.

    thanks you.
  • kwatts59
    Member
    • Apr 2011
    • 46

    #2
    Try the LINUX command "wc -l <filename>". This will count the number of lines in the file. If the file is in fastq format, you will have to divide the number of lines by 4. This will give you the number of reads.

    Comment

    • ashiq.hussain
      Junior Member
      • Jun 2011
      • 6

      #3
      why we use -l in the command?
      Last edited by ashiq.hussain; 07-12-2011, 12:17 PM.

      Comment

      • upendra_35
        Senior Member
        • Apr 2010
        • 102

        #4
        its not -1 it is -l and the command wc -l counts the number of lines in the file. The easiest way to find out the number of reads in a fastq file with one command is grep "@" -c <filename>. Hope this helps

        Comment

        • kmcarr
          Senior Member
          • May 2008
          • 1181

          #5
          Originally posted by upendra_35 View Post
          its not -1 it is -l and the command wc -l counts the number of lines in the file. The easiest way to find out the number of reads in a fastq file with one command is grep "@" -c <filename>. Hope this helps
          This will not work! The '@' character may appear in fastq quality lines as well as the seq-id line. See this thread for a discussion on the problems of using grep to count reads in fastq files.

          Comment

          • ashiq.hussain
            Junior Member
            • Jun 2011
            • 6

            #6
            thank you all.

            Comment

            • upendra_35
              Senior Member
              • Apr 2010
              • 102

              #7
              Sorry I missed "^" with @. It should be grep "^@" -c <filename>. However I agree with kmcarr that '@' is a character that may appear in fastq quality lines as well (sometimes at the start of the line) and so even that may not work. So the best way to do it is in two lines: wc -l <filename> followed by expr <no.of.lines> / 4

              Comment

              • JahnDavik
                Junior Member
                • Aug 2012
                • 8

                #8
                compressed files

                Does it work with .gz files, or do I have to unpack them?

                Comment

                • NicoBxl
                  not just another member
                  • Aug 2010
                  • 264

                  #9
                  no use the power of piping

                  gzip -d -c input.fastq.gz | wc -l

                  Comment

                  • CGarde
                    Junior Member
                    • Aug 2013
                    • 1

                    #10
                    I don't mean to revive a closed thread, just in case someone needs to know the number of lines in multiple compressed fastq files...

                    for file in *.bz2; do echo $file; b=$(bzcat $file | wc -l); echo $(($b/4)); done;

                    Comment

                    • JahnDavik
                      Junior Member
                      • Aug 2012
                      • 8

                      #11
                      Great. Thanks. Very useful for me.

                      Comment

                      • anais.barray
                        Junior Member
                        • Apr 2016
                        • 1

                        #12
                        I didn't intend to revive this thread, but as I was searching for a solution to automatize the fastq read counting process, this solution may come in handy to some :

                        for i in `find . -name "*.fastq"`; do echo "$i" >> project_nbread.txt; egrep -c "`head -n 1 $i | awk -F '[@:]' '{ print $2 } '`" $i >> project_nbread.txt ; done
                        In the case of only one file, you can use this :
                        egrep -c "`head -n 1 file.fastq | awk -F '[@:]' '{ print $2 } '`" file.fastq
                        This solution will count the number of lines where the id is found in the header of a fastq seq, i.e the number of fastq reads.

                        Comment

                        Latest Articles

                        Collapse

                        • SEQadmin2
                          Advanced Sequencing Platforms Tackle Neuroscience’s Toughest Genomics Problems
                          by SEQadmin2



                          Genomics studies in neuroscience face a special challenge due to the brain’s complexity and scarcity of samples. Mapping changes in cell type and state using conventional next-generation sequencing methods remains challenging. Advances in technologies like single-cell sequencing, spatial transcriptomics, and long-read sequencing have opened the door to deeper studies of the brain and diseases like Alzheimer’s, amyotrophic lateral sclerosis (ALS), and schizophrenia.
                          ...
                          07-09-2026, 11:10 AM
                        • SEQadmin2
                          Cancer Drug Resistance: The Lingering Barrier to Rising Survival
                          by SEQadmin2



                          Cancer survival rates have significantly increased in the last few decades in the United States, reaching a combined 70% 5-year survival rate by 2021. Behind this number, there are years of research to find new therapies, drug targets, and early detection methods. But there is one core challenge that keeps slowing down these advances, and it’s about drug resistance.

                          There is no single reason why many patients don’t respond to treatment as expected. Cancer is...
                          07-08-2026, 05:17 AM
                        • GATTACAT
                          Reply to Nine Things a Sample Prep Scientist Thinks About Before Sequencing
                          by GATTACAT
                          Love this - good data definitely starts from good input, and poor input can only give relatively poor data. I particularly like the mention of Nanodrop/absorbance based methods for quantification. It's such a toss up if you'll get an accurate reading or what amounts to a randomly generated number, and a lot of library/sequencing related issues can be traced back to poor quant.
                          07-01-2026, 11:43 AM

                        ad_right_rmr

                        Collapse

                        News

                        Collapse

                        Topics Statistics Last Post
                        Started by SEQadmin2, 07-13-2026, 10:26 AM
                        0 responses
                        18 views
                        0 reactions
                        Last Post SEQadmin2  
                        Started by SEQadmin2, 07-09-2026, 10:04 AM
                        0 responses
                        30 views
                        0 reactions
                        Last Post SEQadmin2  
                        Started by SEQadmin2, 07-08-2026, 10:08 AM
                        0 responses
                        16 views
                        0 reactions
                        Last Post SEQadmin2  
                        Started by SEQadmin2, 07-07-2026, 11:05 AM
                        0 responses
                        34 views
                        0 reactions
                        Last Post SEQadmin2  
                        Working...