Unconfigured Ad

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • zszong@hotmail.com
    Member
    • Sep 2012
    • 17

    #1

    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!
  • Richard Finney
    Senior Member
    • Feb 2009
    • 701

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

    Comment

    • zszong@hotmail.com
      Member
      • Sep 2012
      • 17

      #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

      • Richard Finney
        Senior Member
        • Feb 2009
        • 701

        #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

        • zszong@hotmail.com
          Member
          • Sep 2012
          • 17

          #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

          • flxlex
            Moderator
            • Nov 2008
            • 412

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

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

            Comment

            • zszong@hotmail.com
              Member
              • Sep 2012
              • 17

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

              Comment

              • zszong@hotmail.com
                Member
                • Sep 2012
                • 17

                #8
                It worked perfectly. thanks, flxlex

                Comment

                Latest Articles

                Collapse

                • SEQadmin2
                  16S/ITS Profiling vs. Shotgun Metagenomics: What Changes in Your Workflow?
                  by SEQadmin2




                  NGS has revolutionized clinical microbiology by offering new ways to identify and surveil pathogens without prior knowledge of the target. One popular approach is 16S rRNA and ITS amplicon sequencing, which targets specific microbial markers. But studies are increasingly incorporating shotgun metagenomics, a technique that sequences all DNA from a sample without targeting specific microbial markers. This approach allows more detailed taxonomic classification, detection...
                  Today, 06:46 AM
                • 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

                ad_right_rmr

                Collapse

                News

                Collapse

                Topics Statistics Last Post
                Started by SEQadmin2, 10-28-2026, 09:57 AM
                0 responses
                22 views
                0 reactions
                Last Post SEQadmin2  
                Started by SEQadmin2, 10-28-2026, 09:51 AM
                0 responses
                15 views
                0 reactions
                Last Post SEQadmin2  
                Started by SEQadmin2, 10-22-2026, 11:13 AM
                0 responses
                68 views
                0 reactions
                Last Post SEQadmin2  
                Started by SEQadmin2, 10-22-2026, 10:48 AM
                0 responses
                48 views
                0 reactions
                Last Post SEQadmin2  
                Working...