Unconfigured Ad

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts
  • angerusso
    Member
    • Oct 2011
    • 47

    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.
  • Richard Finney
    Senior Member
    • Feb 2009
    • 701

    #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

    • dpryan
      Devon Ryan
      • Jul 2011
      • 3478

      #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

      • angerusso
        Member
        • Oct 2011
        • 47

        #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

        • dpryan
          Devon Ryan
          • Jul 2011
          • 3478

          #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

          • angerusso
            Member
            • Oct 2011
            • 47

            #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

            • dpryan
              Devon Ryan
              • Jul 2011
              • 3478

              #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

              • dpryan
                Devon Ryan
                • Jul 2011
                • 3478

                #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

                • angerusso
                  Member
                  • Oct 2011
                  • 47

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

                  Comment

                  • dpryan
                    Devon Ryan
                    • Jul 2011
                    • 3478

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

                    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
                    20 views
                    0 reactions
                    Last Post SEQadmin2  
                    Started by SEQadmin2, 07-09-2026, 10:04 AM
                    0 responses
                    32 views
                    0 reactions
                    Last Post SEQadmin2  
                    Started by SEQadmin2, 07-08-2026, 10:08 AM
                    0 responses
                    20 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...