Unconfigured Ad

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • JayM
    Junior Member
    • Nov 2010
    • 4

    #1

    Splitting concatenated PE fastq to two files for respect reads

    I have a fastq file that is read1 and read2 split, concatenated and shuffled to form 1 file. However, I need it as read1 and read2 files separate for bwa alignment, does anyone know how to do this?
    I don't have the GERALD file, this processed fastq file came from a core facility so I'm stuck at this point. Can anyone help?
    Last edited by JayM; 11-04-2010, 04:24 AM.
  • swbarnes2
    Senior Member
    • May 2008
    • 910

    #2
    You might be able to grep it out. Something like:

    grep -A 3 pattern_that_is_only_in_read_1_sample_name combined_file.fq > read1.fq

    Comment

    • drio
      Senior Member
      • Oct 2008
      • 323

      #3
      Assuming single.

      Code:
      $ cat ./single.fq | ruby -ne 'BEGIN{@i=0} ; @i+=1; puts $_  if @i.to_s =~ /[1234]/; @i = 0 if @i == 8' > one.fq && cat single.fq | ruby -ne 'BEGIN{@i=0} ; @i+=1; puts $_  if @i.to_s =~ /[5678]/; @i = 0 if @i == 8' > two.fq
      Also, you may want to check the fastx package. It should include that feature.
      -drd

      Comment

      • JayM
        Junior Member
        • Nov 2010
        • 4

        #4
        Originally posted by drio View Post
        Assuming single.

        Code:
        $ cat ./single.fq | ruby -ne 'BEGIN{@i=0} ; @i+=1; puts $_  if @i.to_s =~ /[1234]/; @i = 0 if @i == 8' > one.fq && cat single.fq | ruby -ne 'BEGIN{@i=0} ; @i+=1; puts $_  if @i.to_s =~ /[5678]/; @i = 0 if @i == 8' > two.fq
        Also, you may want to check the fastx package. It should include that feature.
        I take it 'assume single' here refers to assume single [input] file with read1 and read2.

        Comment

        • JayM
          Junior Member
          • Nov 2010
          • 4

          #5
          Originally posted by swbarnes2 View Post
          You might be able to grep it out. Something like:

          grep -A 3 pattern_that_is_only_in_read_1_sample_name combined_file.fq > read1.fq
          But how do you grep for read1 and not read2 from a paired end fastq given that essentially the whole name is identical except one character at the end and there are millions of such scenarios in the file...?
          I'm just thinking about which pattern that could be.

          Comment

          • JayM
            Junior Member
            • Nov 2010
            • 4

            #6
            Originally posted by drio View Post
            Assuming single.

            Code:
            $ cat ./single.fq | ruby -ne 'BEGIN{@i=0} ; @i+=1; puts $_  if @i.to_s =~ /[1234]/; @i = 0 if @i == 8' > one.fq && cat single.fq | ruby -ne 'BEGIN{@i=0} ; @i+=1; puts $_  if @i.to_s =~ /[5678]/; @i = 0 if @i == 8' > two.fq
            Also, you may want to check the fastx package. It should include that feature.
            Wow! Thanks, it worked and an arbitrary inspection of the respective reads seems to confirm a perfect split into read1 and read2.

            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...
              Yesterday, 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
            29 views
            0 reactions
            Last Post SEQadmin2  
            Started by SEQadmin2, 10-28-2026, 09:51 AM
            0 responses
            18 views
            0 reactions
            Last Post SEQadmin2  
            Started by SEQadmin2, 10-22-2026, 11:13 AM
            0 responses
            71 views
            0 reactions
            Last Post SEQadmin2  
            Started by SEQadmin2, 10-22-2026, 10:48 AM
            0 responses
            48 views
            0 reactions
            Last Post SEQadmin2  
            Working...