Header Leaderboard Ad

Collapse

paired end fastq format in bwa

Collapse

Announcement

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

  • paired end fastq format in bwa

    In some examples that I've read for using bwa to analyze paired end data, a fastq for each member of the pair is included (in other words, R1.fastq and R2.fastq). Will bwa handle paired end data that is in a single fastq? The reads are denoted with \1 and \2.

  • #2
    Originally posted by Protaeus View Post
    In some examples that I've read for using bwa to analyze paired end data, a fastq for each member of the pair is included (in other words, R1.fastq and R2.fastq). Will bwa handle paired end data that is in a single fastq? The reads are denoted with \1 and \2.
    AFAIK no, it won't. You may separate reads into two different files, I guess with

    Code:
    $ grep -A2 ^@*1 filein.fq > reads_1.fq
    $ grep -A2 ^@*2 filein.fq > reads_2.fq
    d

    Comment


    • #3
      Originally posted by dawe View Post
      AFAIK no, it won't. You may separate reads into two different files, I guess with

      Code:
      $ grep -A2 ^@*1 filein.fq > reads_1.fq
      $ grep -A2 ^@*2 filein.fq > reads_2.fq
      d
      Not quite. First, FASTQ sets are four lines long so you have to collect the matched line and the 3 following (-A3). Your regular expression means "match 0 or more "@" at the beginning of a line, followed by a 1 (or 2). You need to specify an "@" followed by 0 or more of any character (.*). You are also not anchoring the 1 or 2 to the end of the line. Finally need to enclose the regular expression in quotes. To get what you intended it should be:

      Code:
      $ grep -A3 ^"@.*1"$ filein.fq > reads_1.fq
      $ grep -A3 ^"@.*2"$ filein.fq > reads_2.fq
      There is however a hidden gotcha in this method. @, 1 and 2 are valid characters for the quality string if the FASTQ is Sanger (or Illumina prior to 1.5). This means that your grep could match a quality string and then write it and the next three lines as a FASTQ block. This will cause whatever program was trying to parse this to puke (from personal experience).

      In a random FASTQ file of ~20m reads I found 511 quality strings which were matched by these grep patterns. An incredibly small fraction to be sure but you need one to screw up your FASTQ file.

      Comment


      • #4
        For the reasons kmcarr gives (and other issues like this), personally I'd use a simple script using Biopython, BioPerl or similar rather than grep.

        Comment


        • #5
          Originally posted by maubp View Post
          For the reasons kmcarr gives (and other issues like this), personally I'd use a simple script using Biopython, BioPerl or similar rather than grep.
          I wrote the wrong grep expression, my bad. Indeed I used to grep @XXXX where XXXX is my machine ID for most of the operations... Also, bwa doesn't use quality for alignment (so it will work with A1 or A3).
          Nevertheless, I believe grep is much faster than any bioperl/biopython script.

          d

          Comment


          • #6
            Hi. Just found this post in the GATK forum: http://gatkforums.broadinstitute.org...o-fastq-format
            Essentially, you can use BWA with interleaved BAM files containing info from both pairs. I know that was not exactly the question, but it is related, and hopefully will save time for some (as with my case).

            Comment

            Latest Articles

            Collapse

            • seqadmin
              A Brief Overview and Common Challenges in Single-cell Sequencing Analysis
              by seqadmin


              ​​​​​​The introduction of single-cell sequencing has advanced the ability to study cell-to-cell heterogeneity. Its use has improved our understanding of somatic mutations1, cell lineages2, cellular diversity and regulation3, and development in multicellular organisms4. Single-cell sequencing encompasses hundreds of techniques with different approaches to studying the genomes, transcriptomes, epigenomes, and other omics of individual cells. The analysis of single-cell sequencing data i...

              01-24-2023, 01:19 PM
            • seqadmin
              Introduction to Single-Cell Sequencing
              by seqadmin
              Single-cell sequencing is a technique used to investigate the genome, transcriptome, epigenome, and other omics of individual cells using high-throughput sequencing. This technology has provided many scientific breakthroughs and continues to be applied across many fields, including microbiology, oncology, immunology, neurobiology, precision medicine, and stem cell research.

              The advancement of single-cell sequencing began in 2009 when Tang et al. investigated the single-cell transcriptomes
              ...
              01-09-2023, 03:10 PM

            ad_right_rmr

            Collapse
            Working...
            X