Seqanswers Leaderboard Ad

Collapse

Announcement

Collapse
No announcement yet.
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • 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!

  • #2
    how to merge fastq files

    Use 'cat' from the command line;

    In the directory containing your fastq files:

    $ cat *.fastq > merged.fastq

    Comment


    • #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


      • #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


        • #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


          • #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


            • #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


              • #8
                Worked like a dream ! thanks GenoMax.

                Comment

                Latest Articles

                Collapse

                • 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
                • seqadmin
                  Strategies for Sequencing Challenging Samples
                  by seqadmin


                  Despite advancements in sequencing platforms and related sample preparation technologies, certain sample types continue to present significant challenges that can compromise sequencing results. Pedro Echave, Senior Manager of the Global Business Segment at Revvity, explained that the success of a sequencing experiment ultimately depends on the amount and integrity of the nucleic acid template (RNA or DNA) obtained from a sample. “The better the quality of the nucleic acid isolated...
                  03-22-2024, 06:39 AM

                ad_right_rmr

                Collapse

                News

                Collapse

                Topics Statistics Last Post
                Started by seqadmin, 04-11-2024, 12:08 PM
                0 responses
                18 views
                0 likes
                Last Post seqadmin  
                Started by seqadmin, 04-10-2024, 10:19 PM
                0 responses
                22 views
                0 likes
                Last Post seqadmin  
                Started by seqadmin, 04-10-2024, 09:21 AM
                0 responses
                16 views
                0 likes
                Last Post seqadmin  
                Started by seqadmin, 04-04-2024, 09:00 AM
                0 responses
                47 views
                0 likes
                Last Post seqadmin  
                Working...
                X