SEQanswers

Go Back   SEQanswers > Bioinformatics > Bioinformatics



Similar Threads
Thread Thread Starter Forum Replies Last Post
Installed bwa, but there are no bwa files produced in Galaxy Anek Bioinformatics 4 03-14-2014 03:23 AM
weird output with BWA paired end alignment jmt Bioinformatics 2 08-13-2013 06:05 PM
BWA alignment of multiple read files, the order of processing matters? gene_x Bioinformatics 8 07-12-2013 12:20 PM
too small output .sai file created by bwa aln? ..leads to bwa sampe hanging? Stina Bioinformatics 12 12-05-2012 07:32 AM
sam output from bwa colorspace alignment Mr Mutundes Bioinformatics 0 12-15-2009 03:02 AM

Reply
 
Thread Tools
Old 09-08-2014, 11:03 AM   #1
thh32
Member
 
Location: UK

Join Date: Feb 2014
Posts: 60
Default No BWA alignment output files!

Hi,

I have been using Bowtie for the last few months for alignment but now have a file for indexing which is 6Gb and Bowtie cannot deal with so I have moved onto using BWA, the indexing went fine and I got my files.

When reading the documentation is seemed as though "bwa mem" was the best option for the actual alignment however all the output is being sent to the screen and now an actual file (determined as iy is going to the output file from the cluster we have and no new files have been created).

Basically was this the correct choice and did I miss something which has caused the output of aligned and unaligned files to not be created?

here is the code I used:

bwa index -p 50Gb_index -a bwtsw contigs.fa


bwa mem -t 20 50Gb_index ../../NZ_bowtie_nonaligned_hungate_thread.done.gz


THANKS!
thh32 is offline   Reply With Quote
Old 09-08-2014, 11:34 AM   #2
Brian Bushnell
Super Moderator
 
Location: Walnut Creek, CA

Join Date: Jan 2014
Posts: 2,707
Default

Use the redirect operator ">" to pipe to a file:

bwa mem -t 20 50Gb_index ../../NZ_bowtie_nonaligned_hungate_thread.done.gz > mapped.sam
Brian Bushnell is offline   Reply With Quote
Old 09-08-2014, 03:06 PM   #3
thh32
Member
 
Location: UK

Join Date: Feb 2014
Posts: 60
Default

Quote:
Originally Posted by Brian Bushnell View Post
Use the redirect operator ">" to pipe to a file:

bwa mem -t 20 50Gb_index ../../NZ_bowtie_nonaligned_hungate_thread.done.gz > mapped.sam

This would work if I wanted a SAM file output but I am aiming for a similar output to that provided with bowtie where you get a file of the reads that align to the indexed file and a seperate file for reads that dont align to the indexed file.

Is there a way to do this with BWA?
thh32 is offline   Reply With Quote
Old 09-08-2014, 03:18 PM   #4
Brian Bushnell
Super Moderator
 
Location: Walnut Creek, CA

Join Date: Jan 2014
Posts: 2,707
Default

I don't see an option for it, though you can split the output with samtools into mapped and unmapped reads.

Alternatively, BBMap supports unlimited reference size and also separate files for mapped and unmapped reads, using the "outm=" and "outu=" flags. The output can be in sam or other formats, depending on the file extension.
Brian Bushnell is offline   Reply With Quote
Old 09-09-2014, 06:04 AM   #5
dariober
Senior Member
 
Location: Cambridge, UK

Join Date: May 2010
Posts: 311
Default

Quote:
Originally Posted by thh32 View Post
This would work if I wanted a SAM file output but I am aiming for a similar output to that provided with bowtie where you get a file of the reads that align to the indexed file and a seperate file for reads that dont align to the indexed file.

Is there a way to do this with BWA?
Untested, but it should work in bash:

Code:
bwa mem myIndex myReads.fq.gz \
| tee >(samtools view -Sh -f4 - > unmapped.sam) \
| tee >(samtools view -Sh -F4 - > mapped.sam) > /dev/null
This sends unmapped reads (-f4) to unmapped.sam and mapped reads (-F4) to mapped.sam. You could customize the samtools commands in the subshells to decide what goes in each file (e.g. by using -q options). In fact, while you are at it, I would convert to bam and sort the mapped reads.

Dario
dariober is offline   Reply With Quote
Reply

Tags
bwa 0.7.10

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 09:19 AM.


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