Unconfigured Ad

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • joseph
    Member
    • Feb 2008
    • 39

    #1

    Conversion from ‘qseq.txt’ to ‘fastq’ format

    Hi
    Can anybody suggest a program or share a code to convert the illumina _qseq.txt files to fastq format used as input for Bowtie?
    Thanks,
    Joseph
  • kmcarr
    Senior Member
    • May 2008
    • 1181

    #2
    Here is some perl code which does the bare minimum to convert qseq to fastq

    (name the script qseq2fastq.pl)

    Code:
    #!/usr/bin/perl
    
    use warnings;
    use strict;
    
    while (<>) {
    	chomp;
    	my @parts = split /\t/;
    	print "@","$parts[0]:$parts[2]:$parts[3]:$parts[4]:$parts[5]#$parts[6]/$parts[7]\n";
    	print "$parts[8]\n";
    	print "+\n";
    	print "$parts[9]\n";
    }
    To use this code (assuming you are using pipline 1.3.2) cd to your GERALD directory and type the following:

    cat Temp/s_1_1_0???_ub_qseq.txt | qseq2fastq.pl > s_1_1.fastq

    This will collect all of the files for lane 1, read 1 in the GERALD/Temp directory and output a single fastq for lane1, read 1.

    I use the qseq files in the GERALD/Temp directory instead of the Bustard directory because of the difference in the way these files represent positions with no base call or an ambiguous base call. The files in the Bustard directory have a '.' in the sequence string while those in the Gerald/Temp directory have an 'N'. If you want to use the qseq files in the Bustard directory you will have to add some code to change any '.'s in the sequence line to 'N's.

    The quality scores are still represented as Illumina's phred64 so don't forget to either convert prior to running bowtie or pass the --phred64 option when running bowtie.

    Comment

    • joseph
      Member
      • Feb 2008
      • 39

      #3
      trying qseq2fastq.pl

      Hi
      Thank you for your help.
      To try your script, I copied 4 files to a dir along with qseq2fastq.pl.
      Here is the content of the dir:
      ls
      qseq2fastq.pl s_7_1_0001_ub_qseq.txt s_7_1_0002_ub_qseq.txt s_7_1_0003_ub_qseq.txt s_7_1_0004_ub_qseq.txt

      I got an error:
      cat s_7_1_0???_ub_qseq.txt | qseq2fastq.pl > s_7_1.fastq
      -bash: qseq2fastq.pl: command not found

      When I added perl to the command, I did not get the error but the output file s_7_1.fastq was empty:

      cat s_7_1_0???_ub_qseq.txt | perl qseq2fastq.pl > s_7_1.fastq

      any suggestions?
      Thanks,
      Joseph

      Comment

      • joseph
        Member
        • Feb 2008
        • 39

        #4
        please ignore

        Originally posted by joseph View Post
        Hi
        Thank you for your help.
        To try your script, I copied 4 files to a dir along with qseq2fastq.pl.
        Here is the content of the dir:
        ls
        qseq2fastq.pl s_7_1_0001_ub_qseq.txt s_7_1_0002_ub_qseq.txt s_7_1_0003_ub_qseq.txt s_7_1_0004_ub_qseq.txt

        I got an error:
        cat s_7_1_0???_ub_qseq.txt | qseq2fastq.pl > s_7_1.fastq
        -bash: qseq2fastq.pl: command not found

        When I added perl to the command, I did not get the error but the output file s_7_1.fastq was empty:

        cat s_7_1_0???_ub_qseq.txt | perl qseq2fastq.pl > s_7_1.fastq

        any suggestions?
        Thanks,
        Joseph

        please ignore the above message. I got it to work. Thanks

        Comment

        • Alvaro Hernandez
          Member
          • May 2009
          • 12

          #5
          Need help on this topic

          I need to get this script to work with the qseq.txt files in GERALD from pipeline 1.5 Could someone modify it so that it works?. There may be a difference with the qseq.txt files from previous pipelines because the script throws a lot of error messages like this:

          mymac:fasta programmer$ perl s_1_1_0???_ub_qseq.txt | qseq2fastq.pl > s_1_1.fastq
          -bash: qseq2fastq.pl: command not found
          Number found where operator expected at s_1_1_0001_ub_qseq.txt line 1, near "1 1"
          (Missing operator before 1?)
          Number found where operator expected at s_1_1_0001_ub_qseq.txt line 1, near "1 1"
          (Missing operator before 1?)
          Number found where operator expected at s_1_1_0001_ub_qseq.txt line 1, near "1 0"
          (Missing operator before 0?)
          Number found where operator expected at s_1_1_0001_ub_qseq.txt line 1, near "0 24"
          (Missing operator before 24?)
          Number found where operator expected at s_1_1_0001_ub_qseq.txt line 1, near "240"
          (Missing operator before 0?)
          Number found where operator expected at s_1_1_0001_ub_qseq.txt line 1, near "0 1"


          This will be highly appreciated!!

          Comment

          • Xi Wang
            Senior Member
            • Oct 2009
            • 317

            #6
            Originally posted by Alvaro Hernandez View Post
            mymac:fasta programmer$ perl s_1_1_0???_ub_qseq.txt | qseq2fastq.pl > s_1_1.fastq
            -bash: qseq2fastq.pl: command not found
            Number found where operator expected at s_1_1_0001_ub_qseq.txt line 1, near "1 1"
            (Missing operator before 1?)
            Number found where operator expected at s_1_1_0001_ub_qseq.txt line 1, near "1 1"
            (Missing operator before 1?)
            Number found where operator expected at s_1_1_0001_ub_qseq.txt line 1, near "1 0"
            (Missing operator before 0?)
            Number found where operator expected at s_1_1_0001_ub_qseq.txt line 1, near "0 24"
            (Missing operator before 24?)
            Number found where operator expected at s_1_1_0001_ub_qseq.txt line 1, near "240"
            (Missing operator before 0?)
            Number found where operator expected at s_1_1_0001_ub_qseq.txt line 1, near "0 1"


            This will be highly appreciated!!
            Your command should be written as:
            Code:
            cat s_1_1_0???_ub_qseq.txt | perl qseq2fastq.pl > s_1_1.fastq
            Xi Wang

            Comment

            • Alvaro Hernandez
              Member
              • May 2009
              • 12

              #7
              one more question

              Xi Wang,

              Thank you for your help, it now worked!

              One more question: The fastq file from GERALD has the following structure for each read:

              @HWI-EAS385_0042:7:1:54:1892#0/1
              TAGCTCTTGATCCGGCAAACAAACCAACGCTTGGAGCGGGGGGGGGACGGGAGAGGGGGTCAGCCGGAGGGCGGGGACCA
              +HWI-EAS385_0042:7:1:54:1892#0/1
              `baabaaaaa`][aaaa_a^^aaaa^`a``\[]`UXQVW^_\MFX^[ZMDT\\^WFX_^XXK[TH^YIS\XYONVYQY^[

              (this is: @read name, another line with the read sequence, another line with +read name and another line with quality scores)

              However, this script gives the following structure:

              @HWUSI-EAS594-R:1:3:1453:1350#0/1
              CCCAGTTCCGACGATCGATTTGCACGTCAGAATCGCTACGGACCTCCATCAGGGTTTCCCCTGACTTCGTCCTGACCAGG
              +
              eea^cdfdffgggggggggggeggggdggdffgdbdgddgggg`g^dfbfgdggcfbgfffcb]gffbfcfcefbbBBBB

              (does not give the read name after the +). Will it recognize that the quality scores belong to that read? How can I make the read name appear after the + to make it exactly similar to the GERALD file?

              Thanks again for your expert help!

              Alvaro

              Comment

              • Xi Wang
                Senior Member
                • Oct 2009
                • 317

                #8
                Originally posted by Alvaro Hernandez View Post
                How can I make the read name appear after the
                You can use the script below (name it qseq2fastq.pl and replace the former one):

                Code:
                #!/usr/bin/perl
                
                use warnings;
                use strict;
                
                while (<>) {
                	chomp;
                	my @parts = split /\t/;
                	print "@","$parts[0]:$parts[2]:$parts[3]:$parts[4]:$parts[5]#$parts[6]/$parts[7]\n";
                	print "$parts[8]\n";
                	print "+","$parts[0]:$parts[2]:$parts[3]:$parts[4]:$parts[5]#$parts[6]/$parts[7]\n";
                	print "$parts[9]\n";
                }
                Xi Wang

                Comment

                • Alvaro Hernandez
                  Member
                  • May 2009
                  • 12

                  #9
                  ***Thanks!!

                  Xi Wang,

                  Your modified script run perfectly. Thanks again for sharing your expertise and following up with this. You saved my day.

                  AH

                  Comment

                  • kmcarr
                    Senior Member
                    • May 2008
                    • 1181

                    #10
                    Originally posted by Alvaro Hernandez View Post
                    (does not give the read name after the +). Will it recognize that the quality scores belong to that read? How can I make the read name appear after the + to make it exactly similar to the GERALD file?
                    Alvaro
                    The official definition of the FASTQ format (see here and here) states that the name following the '+' is optional. Including exactly the same information twice is inefficient. Any software which reads FASTQ files should follow the standard and not require the name after the +.

                    Comment

                    • Alvaro Hernandez
                      Member
                      • May 2009
                      • 12

                      #11
                      Thanks

                      Thanks kmcarr, it is good to know that. I usually just deal with the standard pipeline but this time GERALD could not finish the alignment and had to merge these files, so I am learning all these things.

                      And the original script was yours so I appreciate you sharing it with everybody and Xi Wang for showing me how to use it.

                      Comment

                      • genbio64
                        Member
                        • Dec 2009
                        • 42

                        #12
                        A quick and easy way is to convert it using CLC Genomeworkbench.

                        Comment

                        • extrajos
                          Junior Member
                          • Mar 2010
                          • 1

                          #13
                          qseq vs. illumina-fastq

                          Hi All,

                          I am wondering if qseq format is the same thing as fastq-illumina (differing from fastq-sanger only in the calculation of the quality score) or if qseq and fastq-illumina are different formats.

                          Thanks!

                          Comment

                          • Thomas Doktor
                            Senior Member
                            • Apr 2009
                            • 105

                            #14
                            They are the same format, the qseq files are simply tile-divided sequence files. <- Not correct! See kmcarr's response below.

                            Following in the footsteps of perl - there is always more than one way to do it - did you (Alvaro) try configuring GERALD to just output the sequences instead of aligning them?
                            It can be done in the config file for the GERALD script by simply telling GERALD to output the sequence from the given lanes, e.g.:
                            123:ANALYSIS sequence

                            genbio64, only if you have the money for CLC
                            Last edited by Thomas Doktor; 03-25-2010, 04:23 AM.

                            Comment

                            • drio
                              Senior Member
                              • Oct 2008
                              • 323

                              #15
                              Originally posted by joseph View Post
                              Hi
                              Can anybody suggest a program or share a code to convert the illumina _qseq.txt files to fastq format used as input for Bowtie?
                              Thanks,
                              Joseph
                              Most aligners come with scripts to perform those conversions. bfast has (scripts/ill2fastq.pl).
                              -drd

                              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
                                ...
                                Yesterday, 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, Today, 10:52 AM
                              0 responses
                              8 views
                              0 reactions
                              Last Post SEQadmin2  
                              Started by SEQadmin2, Yesterday, 05:39 AM
                              0 responses
                              15 views
                              0 reactions
                              Last Post SEQadmin2  
                              Started by SEQadmin2, 10-13-2026, 09:56 AM
                              0 responses
                              15 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...