SEQanswers

Go Back   SEQanswers > Bioinformatics > Bioinformatics



Similar Threads
Thread Thread Starter Forum Replies Last Post
random subset paired-end fastq dnusol Bioinformatics 15 04-17-2016 02:36 AM
Fastq format and Paired-end reads sandhya Bioinformatics 10 07-03-2013 04:24 AM
Illumina Paired End FASTQ kjsalimian Bioinformatics 2 01-05-2012 12:19 PM
Casava 1.8 Fastq format for using with BWA a14418e10 Bioinformatics 3 11-11-2011 09:13 AM
Fastq: Paired end reads and mapping cedance Bioinformatics 7 06-18-2011 12:33 PM

Reply
 
Thread Tools
Old 12-09-2010, 09:10 AM   #1
Protaeus
Member
 
Location: 86001

Join Date: Aug 2010
Posts: 21
Default 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.
Protaeus is offline   Reply With Quote
Old 12-09-2010, 11:26 AM   #2
dawe
Senior Member
 
Location: 4530'25.22"N / 915'53.00"E

Join Date: Apr 2009
Posts: 258
Default

Quote:
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
dawe is offline   Reply With Quote
Old 12-09-2010, 01:24 PM   #3
kmcarr
Senior Member
 
Location: USA, Midwest

Join Date: May 2008
Posts: 1,169
Default

Quote:
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.
kmcarr is offline   Reply With Quote
Old 12-09-2010, 02:14 PM   #4
maubp
Peter (Biopython etc)
 
Location: Dundee, Scotland, UK

Join Date: Jul 2009
Posts: 1,542
Default

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.
maubp is offline   Reply With Quote
Old 12-09-2010, 02:28 PM   #5
dawe
Senior Member
 
Location: 4530'25.22"N / 915'53.00"E

Join Date: Apr 2009
Posts: 258
Default

Quote:
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
dawe is offline   Reply With Quote
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off




All times are GMT -8. The time now is 01:16 PM.


Powered by vBulletin® Version 3.8.9
Copyright ©2000 - 2019, vBulletin Solutions, Inc.
Single Sign On provided by vBSSO