SEQanswers

Go Back   SEQanswers > Bioinformatics > Bioinformatics



Similar Threads
Thread Thread Starter Forum Replies Last Post
bwa mem segfault; bwa bwasw breaks MarkDuplicates ElenaN Bioinformatics 2 06-30-2013 10:23 PM
CIGAR string from BWA-SW output incorrect ? robs Bioinformatics 13 01-13-2012 04:07 AM
BWA generating incorrect CIGAR string? foxyg Bioinformatics 6 09-16-2011 11:22 AM
The 'S' in CIGAR of sam file (bwa) qixiaofei General 6 09-15-2011 11:28 PM
bwa MD and cigar fields inconsistency biterbilen Bioinformatics 4 07-28-2009 08:37 AM

Reply
 
Thread Tools
Old 11-06-2016, 02:36 AM   #1
dovah
Member
 
Location: Russia

Join Date: Jul 2014
Posts: 18
Default extended cigar in bwa-mem

Hi all,

I am aligning pacbio reads to a reference genome using bwa mem. Do you know how to output an extended CIGAR in output sam file from bwa v0.7.13?

My command is:
Code:
bwa mem -x pacbio refgenome.fasta reads.fastq > output.sam
Thanks in advance
dovah is offline   Reply With Quote
Old 11-06-2016, 12:54 PM   #2
dpryan
Devon Ryan
 
Location: Freiburg, Germany

Join Date: Jul 2011
Posts: 3,479
Default

What exactly do you mean by "extended CIGAR"? bwa mem will output SAM files with an appropriate CIGAR string already.
dpryan is offline   Reply With Quote
Old 11-07-2016, 08:37 AM   #3
Brian Bushnell
Super Moderator
 
Location: Walnut Creek, CA

Join Date: Jan 2014
Posts: 2,707
Default

He probably means cigar strings with X and = symbols instead of M, which are very handy.
Brian Bushnell is offline   Reply With Quote
Old 11-08-2016, 02:19 PM   #4
dovah
Member
 
Location: Russia

Join Date: Jul 2014
Posts: 18
Default

Yes, this is what I mean by "extended cigar". By the way, I found a tool that can do that a posteriori, in case someone else is interested: SamFixCigar (http://github.com/lindenb/jvarkit )
dovah is offline   Reply With Quote
Old 05-30-2017, 10:31 PM   #5
sklages
Senior Member
 
Location: Berlin, DE

Join Date: May 2008
Posts: 620
Default

Are there any plans to extend bwa to write X/= instead of M? At least optional?
sklages is offline   Reply With Quote
Old 06-01-2017, 04:09 PM   #6
Brian Bushnell
Super Moderator
 
Location: Walnut Creek, CA

Join Date: Jan 2014
Posts: 2,707
Default

You can now use BBMap's reformat.sh to add those:

reformat.sh in=mapped.sam out=extended.sam sam=1.4

I have not tested it extensively on things like hard-clipping but it should generally work.
Brian Bushnell is offline   Reply With Quote
Old 06-01-2017, 09:58 PM   #7
sklages
Senior Member
 
Location: Berlin, DE

Join Date: May 2008
Posts: 620
Default

Brian,

thanks for the suggestion. I will try :-)

Nevertheless I'd wish bwa would provide an option to either use M or X=.
Just to avoid more I/O due to another conversion ...

Sven
sklages is offline   Reply With Quote
Old 06-02-2017, 04:27 AM   #8
sklages
Senior Member
 
Location: Berlin, DE

Join Date: May 2008
Posts: 620
Default

After studying some docs I do see that with optional MD:Z I am even as flexible as with X=, with the advantage of not having too "complicated" CIGARs. :-)
sklages is offline   Reply With Quote
Reply

Tags
alignment, bwa, pacbio

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:49 PM.


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