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

                    • SEQadmin2
                      Advanced Sequencing Platforms Tackle Neuroscience’s Toughest Genomics Problems
                      by SEQadmin2



                      Genomics studies in neuroscience face a special challenge due to the brain’s complexity and scarcity of samples. Mapping changes in cell type and state using conventional next-generation sequencing methods remains challenging. Advances in technologies like single-cell sequencing, spatial transcriptomics, and long-read sequencing have opened the door to deeper studies of the brain and diseases like Alzheimer’s, amyotrophic lateral sclerosis (ALS), and schizophrenia.
                      ...
                      Today, 11:10 AM
                    • SEQadmin2
                      Cancer Drug Resistance: The Lingering Barrier to Rising Survival
                      by SEQadmin2



                      Cancer survival rates have significantly increased in the last few decades in the United States, reaching a combined 70% 5-year survival rate by 2021. Behind this number, there are years of research to find new therapies, drug targets, and early detection methods. But there is one core challenge that keeps slowing down these advances, and it’s about drug resistance.

                      There is no single reason why many patients don’t respond to treatment as expected. Cancer is...
                      Yesterday, 05:17 AM
                    • 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.
                      07-01-2026, 11:43 AM

                    ad_right_rmr

                    Collapse

                    News

                    Collapse

                    Topics Statistics Last Post
                    Started by SEQadmin2, Today, 10:04 AM
                    0 responses
                    7 views
                    0 reactions
                    Last Post SEQadmin2  
                    Started by SEQadmin2, Yesterday, 10:08 AM
                    0 responses
                    6 views
                    0 reactions
                    Last Post SEQadmin2  
                    Started by SEQadmin2, 07-07-2026, 11:05 AM
                    0 responses
                    9 views
                    0 reactions
                    Last Post SEQadmin2  
                    Started by SEQadmin2, 07-02-2026, 11:08 AM
                    0 responses
                    31 views
                    0 reactions
                    Last Post SEQadmin2  
                    Working...