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
                      Strategies for Sequencing Challenging Samples
                      by seqadmin


                      Despite advancements in sequencing platforms and related sample preparation technologies, certain sample types continue to present significant challenges that can compromise sequencing results. Pedro Echave, Senior Manager of the Global Business Segment at Revvity, explained that the success of a sequencing experiment ultimately depends on the amount and integrity of the nucleic acid template (RNA or DNA) obtained from a sample. “The better the quality of the nucleic acid isolated...
                      03-22-2024, 06:39 AM
                    • seqadmin
                      Techniques and Challenges in Conservation Genomics
                      by seqadmin



                      The field of conservation genomics centers on applying genomics technologies in support of conservation efforts and the preservation of biodiversity. This article features interviews with two researchers who showcase their innovative work and highlight the current state and future of conservation genomics.

                      Avian Conservation
                      Matthew DeSaix, a recent doctoral graduate from Kristen Ruegg’s lab at The University of Colorado, shared that most of his research...
                      03-08-2024, 10:41 AM

                    ad_right_rmr

                    Collapse

                    News

                    Collapse

                    Topics Statistics Last Post
                    Started by seqadmin, Yesterday, 06:37 PM
                    0 responses
                    12 views
                    0 likes
                    Last Post seqadmin  
                    Started by seqadmin, Yesterday, 06:07 PM
                    0 responses
                    10 views
                    0 likes
                    Last Post seqadmin  
                    Started by seqadmin, 03-22-2024, 10:03 AM
                    0 responses
                    52 views
                    0 likes
                    Last Post seqadmin  
                    Started by seqadmin, 03-21-2024, 07:32 AM
                    0 responses
                    68 views
                    0 likes
                    Last Post seqadmin  
                    Working...
                    X