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
                  Recent Advances in Sequencing Analysis Tools
                  by seqadmin


                  The sequencing world is rapidly changing due to declining costs, enhanced accuracies, and the advent of newer, cutting-edge instruments. Equally important to these developments are improvements in sequencing analysis, a process that converts vast amounts of raw data into a comprehensible and meaningful form. This complex task requires expertise and the right analysis tools. In this article, we highlight the progress and innovation in sequencing analysis by reviewing several of the...
                  Yesterday, 07:48 AM
                • seqadmin
                  Essential Discoveries and Tools in Epitranscriptomics
                  by seqadmin




                  The field of epigenetics has traditionally concentrated more on DNA and how changes like methylation and phosphorylation of histones impact gene expression and regulation. However, our increased understanding of RNA modifications and their importance in cellular processes has led to a rise in epitranscriptomics research. “Epitranscriptomics brings together the concepts of epigenetics and gene expression,” explained Adrien Leger, PhD, Principal Research Scientist...
                  04-22-2024, 07:01 AM

                ad_right_rmr

                Collapse

                News

                Collapse

                Topics Statistics Last Post
                Started by seqadmin, Today, 06:57 AM
                0 responses
                9 views
                0 likes
                Last Post seqadmin  
                Started by seqadmin, Yesterday, 07:17 AM
                0 responses
                13 views
                0 likes
                Last Post seqadmin  
                Started by seqadmin, 05-02-2024, 08:06 AM
                0 responses
                19 views
                0 likes
                Last Post seqadmin  
                Started by seqadmin, 04-30-2024, 12:17 PM
                0 responses
                22 views
                0 likes
                Last Post seqadmin  
                Working...
                X