Seqanswers Leaderboard Ad

Collapse

Announcement

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

  • 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...

  • #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


    • #3
      With Biopieces you can do:

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

      Comment


      • #4
        This has already been covered in a previous post

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

        Comment


        • #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


          • #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


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

              Comment


              • #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


                • #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


                  • #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

                    • seqadmin
                      Current Approaches to Protein Sequencing
                      by seqadmin


                      Proteins are often described as the workhorses of the cell, and identifying their sequences is key to understanding their role in biological processes and disease. Currently, the most common technique used to determine protein sequences is mass spectrometry. While still a valuable tool, mass spectrometry faces several limitations and requires a highly experienced scientist familiar with the equipment to operate it. Additionally, other proteomic methods, like affinity assays, are constrained...
                      04-04-2024, 04:25 PM
                    • seqadmin
                      Strategies for Sequencing Challenging Samples
                      by seqadmin


                      Despite advancements in sequencing platforms and related sample preparation technologies, certain sample types continue to present significant challenges that can compromise sequencing results. Pedro Echave, Senior Manager of the Global Business Segment at Revvity, explained that the success of a sequencing experiment ultimately depends on the amount and integrity of the nucleic acid template (RNA or DNA) obtained from a sample. “The better the quality of the nucleic acid isolated...
                      03-22-2024, 06:39 AM

                    ad_right_rmr

                    Collapse

                    News

                    Collapse

                    Topics Statistics Last Post
                    Started by seqadmin, 04-11-2024, 12:08 PM
                    0 responses
                    18 views
                    0 likes
                    Last Post seqadmin  
                    Started by seqadmin, 04-10-2024, 10:19 PM
                    0 responses
                    22 views
                    0 likes
                    Last Post seqadmin  
                    Started by seqadmin, 04-10-2024, 09:21 AM
                    0 responses
                    16 views
                    0 likes
                    Last Post seqadmin  
                    Started by seqadmin, 04-04-2024, 09:00 AM
                    0 responses
                    47 views
                    0 likes
                    Last Post seqadmin  
                    Working...
                    X