Unconfigured Ad

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

    #1

    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
                      16S/ITS Profiling vs. Shotgun Metagenomics: What Changes in Your Workflow?
                      by SEQadmin2




                      NGS has revolutionized clinical microbiology by offering new ways to identify and surveil pathogens without prior knowledge of the target. One popular approach is 16S rRNA and ITS amplicon sequencing, which targets specific microbial markers. But studies are increasingly incorporating shotgun metagenomics, a technique that sequences all DNA from a sample without targeting specific microbial markers. This approach allows more detailed taxonomic classification, detection...
                      Today, 06:46 AM
                    • SEQadmin2
                      Multiomic Liquid Biopsy: What DNA/RNA Panels Reveal That DNA Alone Can’t
                      by SEQadmin2



                      Tumors contain complex mixtures of cell populations that evolve in response to treatment and host-specific factors. Tissue biopsies provide only static snapshots of a tumor’s state. But what if we could follow that evolution over time using a minimally invasive technique?

                      Liquid biopsies can detect tumor-derived material circulating in the bloodstream, providing a way to study treatment response, detect emerging resistance, and discover new biomarkers. Circulating
                      ...
                      10-14-2026, 09:55 AM

                    ad_right_rmr

                    Collapse

                    News

                    Collapse

                    Topics Statistics Last Post
                    Started by SEQadmin2, 10-28-2026, 09:57 AM
                    0 responses
                    22 views
                    0 reactions
                    Last Post SEQadmin2  
                    Started by SEQadmin2, 10-28-2026, 09:51 AM
                    0 responses
                    14 views
                    0 reactions
                    Last Post SEQadmin2  
                    Started by SEQadmin2, 10-22-2026, 11:13 AM
                    0 responses
                    67 views
                    0 reactions
                    Last Post SEQadmin2  
                    Started by SEQadmin2, 10-22-2026, 10:48 AM
                    0 responses
                    47 views
                    0 reactions
                    Last Post SEQadmin2  
                    Working...