Unconfigured Ad

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • sazz
    Member
    • Oct 2012
    • 28

    #1

    how to merge fastq files

    Hello all,

    I got my fastq files after sequencing, but they sent them in 5 pieces for 1 sample. Do you know a way to merge them?

    Thanks!
  • mastal
    Senior Member
    • Mar 2009
    • 666

    #2
    how to merge fastq files

    Use 'cat' from the command line;

    In the directory containing your fastq files:

    $ cat *.fastq > merged.fastq

    Comment

    • sazz
      Member
      • Oct 2012
      • 28

      #3
      I keep getting "-bash: *.fastq: Permission denied" even though I have read - write and execute permissions (-rwxrwxrwx) :/ But thanks for the command, I will try to make it work.

      Comment

      • GenoMax
        Senior Member
        • Feb 2008
        • 7142

        #4
        Are your files are in the *.fastq.gz format? Is so, you need to amend mastal's command as follows:

        Code:
        $ cat *.fastq.gz > merged_file.fastq.gz
        It is probably not required but you could keep the sequence of the pieces intact like this:

        Code:
        cat Sample_ATCACG_L002_R1_001.fastq.gz Sample_ATCACG_L002_R1_002.fastq.gz > Sample_ATCACG_L002_R1_combined.fastq.gz
        Last edited by GenoMax; 07-03-2013, 03:32 AM.

        Comment

        • mastal
          Senior Member
          • Mar 2009
          • 666

          #5
          how to merge fastq files

          Maybe your system has a problem with using the wildcard * ?

          Since you just have 5 files, try listing the individual file names,

          $ cat file1.fastq file2.fastq file3.fastq file4.fastq file5.fastq > merged.fastq

          Comment

          • sazz
            Member
            • Oct 2012
            • 28

            #6
            I have unpacked them before and they are all in .fastq format. I tried like you wrote, in the long form as:

            sudo cat I-1_ATCACG_L002_R1_001.fastq I-1_ATCACG_L002_R1_002.fastq I-1_ATCACG_L002_R1_003.fastq I-1_ATCACG_L002_R1_004.fastq I-1_ATCACG_L002_R1_005.fastq > I-1.fastq
            Still give the same error:

            -bash: I-1.fastq: Permission denied
            But what I have realized is that; I have other fastq files (from a previous sequencing but in 1 piece for each sample), they are colored in "white" in the bash screen and before, I used split option on those and it worked fine; but this time, those new fastq files are colored green. This means anything?

            Comment

            • GenoMax
              Senior Member
              • Feb 2008
              • 7142

              #7
              Hmm. You should not have to "sudo" to "cat" files. It looks to me like you do not have write permissions on the directory where these files are residing.

              See if this works. This will put the merged file in your $HOME where you should have write permissions.

              Code:
              cat I-1_ATCACG_L002_R1_001.fastq I-1_ATCACG_L002_R1_002.fastq I-1_ATCACG_L002_R1_003.fastq I-1_ATCACG_L002_R1_004.fastq I-1_ATCACG_L002_R1_005.fastq > ~/I-1.fastq

              Comment

              • sazz
                Member
                • Oct 2012
                • 28

                #8
                Worked like a dream ! thanks GenoMax.

                Comment

                Latest Articles

                Collapse

                • 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
                • 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
                  ...
                  09-28-2026, 10:25 AM

                ad_right_rmr

                Collapse

                News

                Collapse

                Topics Statistics Last Post
                Started by SEQadmin2, Yesterday, 10:52 AM
                0 responses
                11 views
                0 reactions
                Last Post SEQadmin2  
                Started by SEQadmin2, 10-14-2026, 05:39 AM
                0 responses
                19 views
                0 reactions
                Last Post SEQadmin2  
                Started by SEQadmin2, 10-13-2026, 09:56 AM
                0 responses
                18 views
                0 reactions
                Last Post SEQadmin2  
                Started by SEQadmin2, 10-09-2026, 11:14 AM
                0 responses
                27 views
                0 reactions
                Last Post SEQadmin2  
                Working...