Seqanswers Leaderboard Ad

Collapse

Announcement

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

  • Merge two raw data files.fq.gz into one

    Hi,
    I am a new perl user. I would like to merge two raw data files.fq.gz into one file.fq.gz using perl script. I made this command line:

    ~/software/Test_perlscripts/mergeGZFastqFiles.pl lane1r2_subset.fq.gz lane1r1_subset.fq.gz 11.r2r1_subset.fq.gz

    After writing the above command and hit enter, it says Permission denied


    bash: /home/software/Test_perlscripts/mergeGZFastqFiles.pl: Permission denied

    Can anyone advice me why this error message came in and how I can fix it?

  • #2
    Code:
    chmod a+x ~/software/Test_perlscripts/mergeGZFastqFiles.pl
    Also, make sure you have the appropriate shebang at the beginning of the perl file (i.e., something like "#!/usr/bin/env perl").

    Comment


    • #3
      @shis: Unless you are trying to interleave the reads with the perl script, you could also just "cat" them together to make a single file.

      Comment


      • #4
        I have changed according file permission: chmod a+x and execute the command again. Now it says:

        Can't open gzip file lane1r2_subset.fq.gz

        Comment


        • #5
          Originally posted by shis View Post
          I have changed according file permission: chmod a+x and execute the command again. Now it says:

          Can't open gzip file lane1r2_subset.fq.gz
          That sounds like a read permission error (as long as the file is in the local directory).

          What exactly are you trying to do with the perl script?

          Post output for
          Code:
          $ ls -l *.fq.gz

          Comment


          • #6
            @GenoMax: Actually I would like to merge two reads, read1 (Forward) and read2 (reverse) of lane 1 and lane 2 using perl script. For the begining I am trying to test the perl script I have with a subset of lane1 read2 and lane1 read1.

            Comment


            • #7
              If you want to merge them based on an overlap (as opposed to just appending one sequence to the other) then you might want to just use Flash.

              Comment


              • #8
                How is perl reading in the files? You might use a construct like:

                Code:
                open(IN, "gunzip -c $ARGV[0] |");
                while(<IN>){
                ...
                }
                It pipes the gunzip call into perl. You can also do same for BAM files eg:

                Code:
                open(IN, "samtools view $bam |");
                while(<IN>){
                ...
                }

                Comment


                • #9
                  Originally posted by shis View Post
                  @GenoMax: Actually I would like to merge two reads, read1 (Forward) and read2 (reverse) of lane 1 and lane 2 using perl script. For the begining I am trying to test the perl script I have with a subset of lane1 read2 and lane1 read1.
                  Perhaps there is something simple that is wrong with your perl script. If you want someone to help you debug the script then you can post it here.

                  We are assuming that file permissions on the two subset files allow reading by user account that is running the perl script.

                  It may just be simple to use the program Devon suggested.

                  Comment


                  • #10
                    @GenoMax:

                    $ ls -l lane1r2_subset.fq.gz

                    -rw-r--r-- 1 me me 2888777 Apr 14 14:14 lane1r2_subset.fq.gz

                    Comment


                    • #11
                      Originally posted by shis View Post
                      @GenoMax:

                      $ ls -l lane1r2_subset.fq.gz

                      -rw-r--r-- 1 me me 2888777 Apr 14 14:14 lane1r2_subset.fq.gz
                      Read permission is not the problem. It must be something in your code.

                      Comment


                      • #12
                        zcat *fq.gz | gzip > merged.fq.gz

                        Comment


                        • #13
                          You don't have to gunzip/gzip. You can just concatenate gz files ( http://stackoverflow.com/questions/8005114 )

                          Code:
                          cat f1.gz f2.gz > merged.gz

                          Comment


                          • #14
                            Originally posted by crazyhottommy View Post
                            zcat *fq.gz | gzip > merged.fq.gz
                            @shis (post # 6) does not want to merge the files but the R1/R2 reads (overlap them).

                            Comment

                            Latest Articles

                            Collapse

                            • seqadmin
                              Recent Advances in Sequencing Analysis Tools
                              by seqadmin


                              The sequencing world is rapidly changing due to declining costs, enhanced accuracies, and the advent of newer, cutting-edge instruments. Equally important to these developments are improvements in sequencing analysis, a process that converts vast amounts of raw data into a comprehensible and meaningful form. This complex task requires expertise and the right analysis tools. In this article, we highlight the progress and innovation in sequencing analysis by reviewing several of the...
                              05-06-2024, 07:48 AM
                            • seqadmin
                              Essential Discoveries and Tools in Epitranscriptomics
                              by seqadmin




                              The field of epigenetics has traditionally concentrated more on DNA and how changes like methylation and phosphorylation of histones impact gene expression and regulation. However, our increased understanding of RNA modifications and their importance in cellular processes has led to a rise in epitranscriptomics research. “Epitranscriptomics brings together the concepts of epigenetics and gene expression,” explained Adrien Leger, PhD, Principal Research Scientist...
                              04-22-2024, 07:01 AM

                            ad_right_rmr

                            Collapse

                            News

                            Collapse

                            Topics Statistics Last Post
                            Started by seqadmin, Yesterday, 06:57 AM
                            0 responses
                            12 views
                            0 likes
                            Last Post seqadmin  
                            Started by seqadmin, 05-06-2024, 07:17 AM
                            0 responses
                            16 views
                            0 likes
                            Last Post seqadmin  
                            Started by seqadmin, 05-02-2024, 08:06 AM
                            0 responses
                            19 views
                            0 likes
                            Last Post seqadmin  
                            Started by seqadmin, 04-30-2024, 12:17 PM
                            0 responses
                            24 views
                            0 likes
                            Last Post seqadmin  
                            Working...
                            X