Unconfigured Ad

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • oiiio
    Senior Member
    • Jan 2011
    • 105

    #1

    Converting FASTA/qual file pair from 454 to FASTQ

    Hi all,

    Is there anything out there that can convert FASTA/qual file pairs from 454 to a single FASTQ file? I have seen plenty of tools that do the opposite already in my search...
  • maubp
    Peter (Biopython etc)
    • Jul 2009
    • 1544

    #2
    Biopython can a few lines, see "Converting FASTA and QUAL files into FASTQ files" in the tutorial,
    Code:
    from Bio import SeqIO
    from Bio.SeqIO.QualityIO import PairedFastaQualIterator
    handle = open("temp.fastq", "w") #w=write
    records = PairedFastaQualIterator(open("example.fasta"), open("example.qual"))
    count = SeqIO.write(records, handle, "fastq")
    handle.close()
    print "Converted %i records" % count

    Comment

    • maasha
      Senior Member
      • Apr 2009
      • 153

      #3
      With Biopieces you can do:

      Code:
      read_454 -i test.fna -q test.fna.qual | write_fastq -o test.fq -x

      Comment

      • TonyBrooks
        Senior Member
        • Jun 2009
        • 303

        #4
        This has already been covered in a previous post

        Discussion of next-gen sequencing related bioinformatics: resources, algorithms, open source efforts, etc

        Comment

        • maubp
          Peter (Biopython etc)
          • Jul 2009
          • 1544

          #5
          Originally posted by TonyBrooks View Post
          This has already been covered in a previous post

          http://seqanswers.com/forums/showthr...ight=454+FASTQ
          Relevant, but not quite the same - that thread was about SFF to FASTQ or FASTA+QUAL.

          This thread is about FASTA+QUAL to FASTQ.
          Last edited by maubp; 01-18-2012, 05:13 AM. Reason: typo

          Comment

          • TonyBrooks
            Senior Member
            • Jun 2009
            • 303

            #6
            Originally posted by maubp View Post
            Relevant, but note quite the same - that thread was about SFF to FASTQ or FASTA+QUAL.

            This thread is about FASTA+QUAL to FASTQ.
            Sorry. There is definitely a thread on FASTA+QUAL to FASTQ though. Someone ended up posting a perl script that did it without the need for any specific software. I just posted the wrong link.

            Here it is:

            Discussion of next-gen sequencing related bioinformatics: resources, algorithms, open source efforts, etc


            Check out post #17

            Comment

            • essvee
              Member
              • Apr 2011
              • 11

              #7
              You can also use galaxy... under NGS: QC and Manipulation there is a tool called 'Combine FASTA and QUAL into FASTQ'

              Comment

              • oiiio
                Senior Member
                • Jan 2011
                • 105

                #8
                Thanks everyone. I ended up using the maubp's biopython suggestion and it is working great. Sorry I didn't see the other thread earlier, it is titled 'fastq sequence converter' and I must have skipped over it.

                Comment

                • xApple
                  Member
                  • Feb 2012
                  • 12

                  #9
                  Taking on maubp's suggestion and making a better script to place in your ~/bin folder:

                  Code:
                  #!/usr/bin/env python
                  
                  """
                  Convert FASTA + QUAL file pairs to a single FASTQ file
                  http://seqanswers.com/forums/showthread.php?t=16925
                  
                  You can use this script from the shell like this::
                  $ ./fasta_to_fastaq reads.fna reads.qual reads.fastq
                  """
                  
                  # The libraries we need #
                  import sys, os
                  from Bio import SeqIO
                  from Bio.SeqIO.QualityIO import PairedFastaQualIterator
                  # Get the shell arguments #
                  fa_path = sys.argv[1]
                  qa_path = sys.argv[2]
                  fq_path = sys.argv[3]
                  # Check that the paths are valid #
                  if not os.path.exists(fa_path): raise Exception("No file at %s." % fa_path)
                  if not os.path.exists(qa_path): raise Exception("No file at %s." % qa_path)
                  # Do it #
                  with open(fq_path, "w") as handle:
                      records = PairedFastaQualIterator(open(fa_path), open(qa_path))
                      count = SeqIO.write(records, handle, "fastq")
                  # Report success #
                  print "Converted %i records" % count
                  Last edited by xApple; 09-13-2012, 07:04 AM.

                  Comment

                  • mossman
                    Junior Member
                    • Jan 2016
                    • 2

                    #10
                    FASTA to FASTQ

                    Many thanks to all - was looking for something specific to a Mac but I can use several of these suggestions - my first post and it was a definite help for me - again many thanks

                    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, 10-15-2026, 10:52 AM
                    0 responses
                    22 views
                    0 reactions
                    Last Post SEQadmin2  
                    Started by SEQadmin2, 10-14-2026, 05:39 AM
                    0 responses
                    27 views
                    0 reactions
                    Last Post SEQadmin2  
                    Started by SEQadmin2, 10-13-2026, 09:56 AM
                    0 responses
                    22 views
                    0 reactions
                    Last Post SEQadmin2  
                    Started by SEQadmin2, 10-09-2026, 11:14 AM
                    0 responses
                    28 views
                    0 reactions
                    Last Post SEQadmin2  
                    Working...