Seqanswers Leaderboard Ad

Collapse

Announcement

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

  • How to remove the newlines in pacific biosciences fastq file

    Hi All,

    Hope someone could help me out here.
    I am trying to analyze a pacbio data set. Because of long reads, the sequences and quality scores have multiple lines with 51 characters per line. When I ran this through fastqc to check quality and statistics, it complains about the format because there are multiple lines. My question is how I can concatenate the sequence into one line and quality score into another line.

    Thank you very much!

  • #2
    Please post an example of the data you need to fix.

    Comment


    • #3
      Thank! Richard.

      An example sequence is below. For the sequence and qualtiy score, there are 5 lines each. I am trying to concatenate them separately.

      Orignal format:

      @chlamy1234
      ATGTGGGCCCAATTTATGTGGGCCCAATTTATGTGGGCC
      CAATTTATGTGGGCCCAATTTATGTGGGCCCAATTTATG
      GGGCCCAATTTATGTGGGCCCAATTTATGTGGGCCCAAT
      TTATGTGGGCCCAATTTATGTGGGCCCAATTTATGTGGG
      CCCAATTTATGTGGGCCCAATTTATGTGGGCCCAATTT
      +
      %^&*$%^&^%^&*$%^&^%^&*$%^&^%^&*$%
      ^&^%^&*$%^&^%^&*$%^&^%^&*$%^&^%^&
      *$%^&^%^&*$%^&^%^&*$%^&^%^&*$%^&^
      %^&*$%^&^%^&*$%^&^%^&*$%^&^%^&*$%
      ^&^%^&*$%^&^%^&*$%^&^%^&*$%^&^$)


      format to be converted to:
      @chlamy1234
      ATGTGGGCCCAATTTATGTGGGCCCAATTTATGTGGGCCCAATTTATGTGGGCCCAATTATGTGGGCCCAATTTATGGGGCCCAATTTATGTGGGCCCAATTTATGTGGGCCCAATTTATGTGGGCCCAATTTATGTGGGCCCAATTTATGTGGGCCCAATTTATGTGGGCCCAATTTATGTGGGCCCAATTT
      +
      %^&*$%^&^%^&*$%^&^%^&*$%^&^%^&*$%^&^%^&*$%^&^%^&*$%^&^%^&*$%^&^%^&*$%^&^%^&*$%^&^%^&*$%^&^%^&*$%^&^%^&*$%^&^%^&*$%^&^%^&*$%^&^%^&*$%^&^%^&*$%^&^%^&*$%^&^%^&*$%^&^$)

      Comment


      • #4
        cat filename.fastq| awk '{p=(NR%12); printf "%s",$0 ; if ((p==1)||(p==6)||(p==7)||(p==0)) printf "\n"}' > newfilename.fastq

        Comment


        • #5
          Thank you Richard! As you can tell that I am new in this area. Apparently, it works for this particular example. But I am dealing with about 1 million reads. The length of every reads varies, which means one has five lines long (as this example) and another has 20 lines long. I think there must be a better way to decide which lines needs to be concatenated.

          Your help is greatly appreciated.

          Stuart

          Comment


          • #6
            seqtk to the rescue: https://github.com/lh3/seqtk

            Code:
            seqtk seq -l 0 infile.fastq > outfile.fastq
            should do it...

            Comment


            • #7
              Thank you flxlex. will try it out and let you know if it works.

              Comment


              • #8
                It worked perfectly. thanks, flxlex

                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
                22 views
                0 likes
                Last Post seqadmin  
                Started by seqadmin, 04-10-2024, 10:19 PM
                0 responses
                24 views
                0 likes
                Last Post seqadmin  
                Started by seqadmin, 04-10-2024, 09:21 AM
                0 responses
                20 views
                0 likes
                Last Post seqadmin  
                Started by seqadmin, 04-04-2024, 09:00 AM
                0 responses
                52 views
                0 likes
                Last Post seqadmin  
                Working...
                X