Unconfigured Ad

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

    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
          Advanced Sequencing Platforms Tackle Neuroscience’s Toughest Genomics Problems
          by SEQadmin2



          Genomics studies in neuroscience face a special challenge due to the brain’s complexity and scarcity of samples. Mapping changes in cell type and state using conventional next-generation sequencing methods remains challenging. Advances in technologies like single-cell sequencing, spatial transcriptomics, and long-read sequencing have opened the door to deeper studies of the brain and diseases like Alzheimer’s, amyotrophic lateral sclerosis (ALS), and schizophrenia.
          ...
          07-09-2026, 11:10 AM
        • SEQadmin2
          Cancer Drug Resistance: The Lingering Barrier to Rising Survival
          by SEQadmin2



          Cancer survival rates have significantly increased in the last few decades in the United States, reaching a combined 70% 5-year survival rate by 2021. Behind this number, there are years of research to find new therapies, drug targets, and early detection methods. But there is one core challenge that keeps slowing down these advances, and it’s about drug resistance.

          There is no single reason why many patients don’t respond to treatment as expected. Cancer is...
          07-08-2026, 05:17 AM
        • GATTACAT
          Reply to Nine Things a Sample Prep Scientist Thinks About Before Sequencing
          by GATTACAT
          Love this - good data definitely starts from good input, and poor input can only give relatively poor data. I particularly like the mention of Nanodrop/absorbance based methods for quantification. It's such a toss up if you'll get an accurate reading or what amounts to a randomly generated number, and a lot of library/sequencing related issues can be traced back to poor quant.
          07-01-2026, 11:43 AM

        ad_right_rmr

        Collapse

        News

        Collapse

        Topics Statistics Last Post
        Started by SEQadmin2, 07-13-2026, 10:26 AM
        0 responses
        28 views
        0 reactions
        Last Post SEQadmin2  
        Started by SEQadmin2, 07-09-2026, 10:04 AM
        0 responses
        37 views
        0 reactions
        Last Post SEQadmin2  
        Started by SEQadmin2, 07-08-2026, 10:08 AM
        0 responses
        25 views
        0 reactions
        Last Post SEQadmin2  
        Started by SEQadmin2, 07-07-2026, 11:05 AM
        0 responses
        35 views
        0 reactions
        Last Post SEQadmin2  
        Working...