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
                      Essential Discoveries and Tools in Epitranscriptomics
                      by seqadmin




                      The field of epigenetics has traditionally concentrated more on DNA and how changes like methylation and phosphorylation of histones impact gene expression and regulation. However, our increased understanding of RNA modifications and their importance in cellular processes has led to a rise in epitranscriptomics research. “Epitranscriptomics brings together the concepts of epigenetics and gene expression,” explained Adrien Leger, PhD, Principal Research Scientist...
                      04-22-2024, 07:01 AM
                    • seqadmin
                      Current Approaches to Protein Sequencing
                      by seqadmin


                      Proteins are often described as the workhorses of the cell, and identifying their sequences is key to understanding their role in biological processes and disease. Currently, the most common technique used to determine protein sequences is mass spectrometry. While still a valuable tool, mass spectrometry faces several limitations and requires a highly experienced scientist familiar with the equipment to operate it. Additionally, other proteomic methods, like affinity assays, are constrained...
                      04-04-2024, 04:25 PM

                    ad_right_rmr

                    Collapse

                    News

                    Collapse

                    Topics Statistics Last Post
                    Started by seqadmin, Yesterday, 08:47 AM
                    0 responses
                    12 views
                    0 likes
                    Last Post seqadmin  
                    Started by seqadmin, 04-11-2024, 12:08 PM
                    0 responses
                    60 views
                    0 likes
                    Last Post seqadmin  
                    Started by seqadmin, 04-10-2024, 10:19 PM
                    0 responses
                    59 views
                    0 likes
                    Last Post seqadmin  
                    Started by seqadmin, 04-10-2024, 09:21 AM
                    0 responses
                    54 views
                    0 likes
                    Last Post seqadmin  
                    Working...
                    X