Unconfigured Ad

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • jmpi
    Junior Member
    • Jul 2011
    • 3

    #1

    Merging Paired-End FastQ Files

    Hi,

    I want to merge the two corresponding FastQ files to get longer reads (with FLASh or COPE).

    It seems like I have to sort the FastQ files before.

    Does anyone have an idea how I can sort FastQ files by their identifier?

    Thank you.
  • yangliao
    Member
    • May 2013
    • 13

    #2
    If you want to sort the reads in every FastQ file by the read ids, I would like to use awk:

    # cat my_input.fastq | awk 'BEGIN{line_no=0;} line_no<=3{line_str = line_str $_ "\t"; line_no ++;} line_no == 4{print line_str; line_str="";line_no = 0}'| cut -f 1-4|sort -k 1,1 | sed 's/\t/\n/g' > my_output.fastq

    I tested this command on a short FastQ file; it should be OK for longer ones.
    Last edited by yangliao; 05-22-2013, 04:20 AM.

    Comment

    • kmcarr
      Senior Member
      • May 2008
      • 1181

      #3
      Originally posted by jmpi View Post
      Hi,

      I want to merge the two corresponding FastQ files to get longer reads (with FLASh or COPE).

      It seems like I have to sort the FastQ files before.

      Does anyone have an idea how I can sort FastQ files by their identifier?

      Thank you.
      First, what do you mean by "sorted" and are you sure you need to do any kind of sorting? All current sequencers output paired end read data in ordered files. By ordered I mean that the first read in the R1 file matches the first read in the R2 file, second R1 == second R2 and so on. This is what almost all tools which take paired input files expect. The reads do not have to "sorted" in any conventional sense (e.g. alphabetically, numerically) they just have to be in matched order.

      Unless something was done to your read files after they were output by the sequencer they will be in matched order and you shouldn't have to do anything with them to input them to FLASH or COPE.

      Comment

      • jmpi
        Junior Member
        • Jul 2011
        • 3

        #4
        I just found out that I did not get the original sequence. So, my problem is solved. Thank you both for your help.

        Comment

        Latest Articles

        Collapse

        • SEQadmin2
          New Genomics Technologies Take Aim at Long-Standing Limits
          by SEQadmin2


          Researchers using sequencing and genomics tools often have to make trade-offs. They can choose between speed or scale, short reads or long-range information, or targeted panels or a view of the whole transcriptome. New technologies that have been released this year are built to address those tough choices.

          We asked six companies the same four questions to learn about their latest products. The new technologies bring a lot to the table, including rethinking sequencing
          ...
          Yesterday, 10:25 AM
        • SEQadmin2
          How Immunogenomics Decodes Immunity’s Genetic Blueprint
          by SEQadmin2




          The immune system’s power comes from its genetic diversity, allowing myriad threats to be neutralized through first recognizing foreign antigens. That diversity is also what makes the immune system so difficult to study. Recent advances in sequencing technology and computational biology, however, are giving researchers new tools to understand immune responses and immune-related diseases in greater detail.

          This convergence of genetics, immunology, and computation...
          09-01-2026, 05:41 AM

        ad_right_rmr

        Collapse

        News

        Collapse

        Topics Statistics Last Post
        Started by SEQadmin2, Today, 09:51 AM
        0 responses
        8 views
        0 reactions
        Last Post SEQadmin2  
        Started by SEQadmin2, 09-25-2026, 09:06 AM
        0 responses
        31 views
        0 reactions
        Last Post SEQadmin2  
        Started by SEQadmin2, 09-23-2026, 11:05 AM
        0 responses
        27 views
        0 reactions
        Last Post SEQadmin2  
        Started by SEQadmin2, 09-18-2026, 11:37 AM
        1 response
        47 views
        0 reactions
        Last Post pekgio
        by pekgio
         
        Working...