Unconfigured Ad

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

    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

                    • GATTACAT
                      Reply to Nine Things a Sample Prep Scientist Thinks About Before Sequencing
                      by GATTACAT
                      Love this - good data definitely starts from good input, and poor input can only give relatively poor data. I particularly like the mention of Nanodrop/absorbance based methods for quantification. It's such a toss up if you'll get an accurate reading or what amounts to a randomly generated number, and a lot of library/sequencing related issues can be traced back to poor quant.
                      Today, 11:43 AM
                    • SEQadmin2
                      Nine Things a Sample Prep Scientist Thinks About Before Sequencing
                      by SEQadmin2


                      I’m not a sequencing expert. I’m a purification scientist who uses NGS to evaluate workflows my group develops. With this perspective, we think about the sample first and the NGS workflow second. The sequencer is an exceptionally honest reporter, but it can only report on what you give it, so whether you get clean, interpretable data from an NGS workflow is largely determined before you begin.

                      Here are nine questions we think about, in roughly the order they matter, before...
                      06-18-2026, 07:11 AM
                    • SEQadmin2
                      From Collection to Sequencing: Why Sample Preparation and Preservation Define Sequencing Data
                      by SEQadmin2


                      Data variability is still an issue in sequencing technologies despite the advances in reproducibility and accuracy of these platforms. But the problem does not originate in the sequencing itself, but in the previous steps, before the sample reaches the sequencer.


                      The first step is collection, followed by preservation and sample preparation for analysis. Most scientists overlook those steps, but not being careful might just be skewing the experiment’s results.
                      ...
                      06-02-2026, 10:05 AM

                    ad_right_rmr

                    Collapse

                    News

                    Collapse

                    Topics Statistics Last Post
                    Started by SEQadmin2, Yesterday, 05:37 AM
                    0 responses
                    9 views
                    0 reactions
                    Last Post SEQadmin2  
                    Started by SEQadmin2, 06-26-2026, 11:10 AM
                    0 responses
                    18 views
                    0 reactions
                    Last Post SEQadmin2  
                    Started by SEQadmin2, 06-17-2026, 06:09 AM
                    0 responses
                    52 views
                    0 reactions
                    Last Post SEQadmin2  
                    Started by SEQadmin2, 06-09-2026, 11:58 AM
                    0 responses
                    110 views
                    0 reactions
                    Last Post SEQadmin2  
                    Working...