SEQanswers

Go Back   SEQanswers > Bioinformatics > Bioinformatics



Similar Threads
Thread Thread Starter Forum Replies Last Post
Extract fastq files of unaligned reads with Bowtie 2 Mad4Seq Bioinformatics 4 06-19-2013 09:53 PM
How to extract mapped and unmapped raw reads from bwa's sam file ? vaibhavvsk Bioinformatics 11 02-07-2013 09:01 AM
Extract unaligned reads (Tophat) from FastQ Uwe Appelt Bioinformatics 5 08-07-2012 04:33 AM
how to filter unaligned duplicate reads HESmith Bioinformatics 4 11-30-2011 02:13 AM
unaligned reads of tophat ae_ucla RNA Sequencing 1 04-07-2011 10:06 AM

Reply
 
Thread Tools
Old 12-20-2011, 01:01 PM   #1
joseph
Member
 
Location: ca

Join Date: Feb 2008
Posts: 39
Default how to extract raw unaligned reads?

Hello

I used bowtie to map sequencing reads:
Code:
> bowtie ~/hg19 -v 2 -k 5 --best --strata -S -t reads.fastq reads.sam
End-to-end 2/3-mismatch full-index search: 01:00:21
# reads processed: 12084153
# reads with at least one reported alignment: 9391748 (77.72%)
# reads that failed to align: 2692405 (22.28%)
Reported 30293838 alignments to 1 output stream(s)
I would like to make a fastq file from the reads with at least one reported alignment [(9391748 (77.72%)].
Converting sam to bam and then using the samtools view with the -F 4 option gives me the Reported 30293838 alignments.
Any suggestions will be appreciated.
Joseph
joseph is offline   Reply With Quote
Old 12-20-2011, 01:11 PM   #2
Nicolas
Member
 
Location: new york city

Join Date: Apr 2009
Posts: 40
Default

You can use Bowtie's options (--al and --un) to output a fast[aq] files with the unmapped reads, and/or as fast[aq] with the reads that align at least once:

Quote:
--al <filename>
Write all reads for which at least one alignment was reported to a file with name <filename>. Written reads will appear as they did in the input, without any of the trimming or translation of quality values that may have taken place within bowtie. Paired-end reads will be written to two parallel files with _1 and _2 inserted in the filename, e.g., if <filename> is aligned.fq, the #1 and #2 mates that fail to align will be written to aligned_1.fq and aligned_2.fq respectively.
Quote:
--un <filename>
Write all reads that could not be aligned to a file with name <filename>. Written reads will appear as they did in the input, without any of the trimming or translation of quality values that may have taken place within Bowtie. Paired-end reads will be written to two parallel files with _1 and _2 inserted in the filename, e.g., if <filename> is unaligned.fq, the #1 and #2 mates that fail to align will be written to unaligned_1.fq and unaligned_2.fq respectively. Unless --max is also specified, reads with a number of valid alignments exceeding the limit set with the -m option are also written to <filename>.
I hope it helps
Nicolas is offline   Reply With Quote
Old 12-20-2011, 05:24 PM   #3
joseph
Member
 
Location: ca

Join Date: Feb 2008
Posts: 39
Default

Quote:
Originally Posted by joseph View Post
Hello

I used bowtie to map sequencing reads:
Code:
> bowtie ~/hg19 -v 2 -k 5 --best --strata -S -t reads.fastq reads.sam
End-to-end 2/3-mismatch full-index search: 01:00:21
# reads processed: 12084153
# reads with at least one reported alignment: 9391748 (77.72%)
# reads that failed to align: 2692405 (22.28%)
Reported 30293838 alignments to 1 output stream(s)
I would like to make a fastq file from the reads with at least one reported alignment [(9391748 (77.72%)].
Converting sam to bam and then using the samtools view with the -F 4 option gives me the Reported 30293838 alignments.
Any suggestions will be appreciated.
Joseph

thank you for your help.
joseph 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 11:18 PM.


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