Seqanswers Leaderboard Ad

Collapse

Announcement

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

  • how to randomly select 20m reads out of a FASTQ file

    Hi All,

    I have an RNASeq data from which I need to randomly select 20 million reads, around 5 times. The whole file is about 200m reads.

    What is a way to do this? Does anyone have a script to share? Thanks.

  • #2
    Googling/DuckDucking might have turned up the answer you are looking for.

    Regardless, check this thread : http://seqanswers.com/forums/showthread.php?t=16505

    Are your reads paired ?
    Last edited by Richard Finney; 08-15-2013, 08:09 AM.

    Comment


    • #3
      There are a few ways, some mentioned on this site and some over on biostars. One of those ought to work for you.

      Comment


      • #4
        Yes my data is paried end. Another complication is that the two pairs are of unequal size.

        du -s command gives:
        *_R1* = 64850642
        *_R2* = 48640554

        Originally posted by Richard Finney View Post
        Googling/DuckDucking might have turned up the answer you are looking for.

        Regardless, check this thread : http://seqanswers.com/forums/showthread.php?t=16505

        Are your reads paired ?

        Comment


        • #5
          You're going to want to resync them before you do anything else. Google "paired-end fastq sync" for a plethora of solutions.

          Comment


          • #6
            So I ran the following perl script:



            and it says: "passed full check" using "quick" which means the two files are in SYNC.

            "QUICK CHECK enabled
            Casava 1.8 read id style
            PASSED full check"

            But before I use random selection of reads from the two files, following your google links, shouldn't I make them equal size? As R1 is bigger than R2, even through they are in sync, I assume they are in SYNC only for the reads size that's common between them. Am I right?

            Originally posted by dpryan View Post
            You're going to want to resync them before you do anything else. Google "paired-end fastq sync" for a plethora of solutions.

            Comment


            • #7
              I've never seen that perl script, so I can't say that it works correctly. If you follow the instructions from this thread on biostars (Pierre's comment first, followed by Steffi's), you'll get two synchronized files of the same size.

              Comment


              • #8
                I'll add, this sort of different number of reads in paired-end files issue usually only crops up when mates from a pair are trimmed separately. If that's the case here and you're the one that did the trimming, you're life will be easier if you use a different trimmer next time (trimmomatic and trim_galore are common choices).

                Comment


                • #9
                  Ignore my previous msg. My files are same size when I used "du -b" command.

                  Comment


                  • #10
                    As long as they're also the same when you use "wc -l" as well then things are OK.

                    Comment

                    Latest Articles

                    Collapse

                    • seqadmin
                      Investigating the Gut Microbiome Through Diet and Spatial Biology
                      by seqadmin




                      The human gut contains trillions of microorganisms that impact digestion, immune functions, and overall health1. Despite major breakthroughs, we’re only beginning to understand the full extent of the microbiome’s influence on health and disease. Advances in next-generation sequencing and spatial biology have opened new windows into this complex environment, yet many questions remain. This article highlights two recent studies exploring how diet influences microbial...
                      02-24-2025, 06:31 AM
                    • seqadmin
                      Quality Control Essentials for Next-Generation Sequencing Workflows
                      by seqadmin




                      Like all molecular biology applications, next-generation sequencing (NGS) workflows require diligent quality control (QC) measures to ensure accurate and reproducible results. Proper QC begins at nucleic acid extraction and continues all the way through to data analysis. This article outlines the key QC steps in an NGS workflow, along with the commonly used tools and techniques.

                      Nucleic Acid Quality Control
                      Preparing for NGS starts with isolating the...
                      02-10-2025, 01:58 PM

                    ad_right_rmr

                    Collapse

                    News

                    Collapse

                    Topics Statistics Last Post
                    Started by seqadmin, 03-03-2025, 01:15 PM
                    0 responses
                    149 views
                    0 likes
                    Last Post seqadmin  
                    Started by seqadmin, 02-28-2025, 12:58 PM
                    0 responses
                    223 views
                    0 likes
                    Last Post seqadmin  
                    Started by seqadmin, 02-24-2025, 02:48 PM
                    0 responses
                    590 views
                    0 likes
                    Last Post seqadmin  
                    Started by seqadmin, 02-21-2025, 02:46 PM
                    0 responses
                    259 views
                    0 likes
                    Last Post seqadmin  
                    Working...
                    X