Re: [Bio-bwa-help] Realign BAM with new reference
Status: Beta
Brought to you by:
lh3lh3
From: Heng Li <lh...@sa...> - 2012-05-14 01:04:19
|
You need to sort your BAM by read names. heng On May 9, 2012, at 5:24 PM, Matthew Flickinger wrote: > I have an existing BAM file aligned using BWA. I want to re-align the > BAM using a different reference and quality trimming options. To to this > i ran: > > bwa aln -q 15 -t 1 hs37d5.fa -b1 S181.bam > S181.1.sai > bwa aln -q 15 -t 1 hs37d5.fa -b2 S181.bam > S181.2.sai > bwa sampe hs37d5.fa S181.1.sai S181.2.sai S181.bam S181.bam | samtools > view -uhS - | samtools sort -m 30000000000 - S181.bwape > > However, i get reads with odd mate pairings. Here is the output for pair > of reads using this method (they have the incorrect position for the > mate, incompatible flags, and are mapped to the wrong chromosome) > > HWI-ST1096:125:C0CD7ACXX:1:2205:18365:28103 97 1 15414 0 100M > 2 114355840 0 CTG[clip]ACC CCC[clip]CC9 AM:i:0 MD:Z:100 > NM:i:0 SM:i:0 XT:A:R X0:i:5 X1:i:2 XM:i:0 XO:i:0 XG:i:0 > XA:Z:16,+65096,100M,0;9,+15525,100M,0;2,-114355500,100M,0;15,-102515652,100M,0;X,-155254222,100M,1;12,-90112,100M,1; > HWI-ST1096:125:C0CD7ACXX:1:2205:18365:28103 177 1 15424 0 100M > 2 114355087 0 AGC[clip]GCA :BDD[clip]8@@ AM:i:0 MD:Z:100 > NM:i:0 SM:i:0 XT:A:R X0:i:5 X1:i:1 XM:i:0 XO:i:0 XG:i:0 > XA:Z:2,+114355490,100M,0;16,-65106,100M,0;9,-15535,100M,0;15,+102515642,100M,0;X,+155254212,100M,1; > > Whereas these reads appeared in the original bam as > > HWI-ST1096:125:C0CD7ACXX:1:2205:18365:28103 163 2 114355490 0 > 100M = 114355500 110 TGC[clip]GCT @@8[clip]DDB: AM:i:0 > MD:Z:100 NM:i:0 RG:Z:C0CD7ACXX_s1 SM:i:0 XT:A:R X0:i:5 X1:i:1 > XM:i:0 XO:i:0 XG:i:0 > HWI-ST1096:125:C0CD7ACXX:1:2205:18365:28103 83 2 114355500 0 > 100M = 114355490 -110 GGT[clip]CAG 9CC[clip]CCC AM:i:0 > MD:Z:100 NM:i:0 RG:Z:C0CD7ACXX_s1 SM:i:0 XT:A:R X0:i:5 X1:i:2 > XM:i:0 XO:i:0 XG:i:0 > > And if i just pull out these two reads into tjheir own bam and re-align > them, i get the following putout > > HWI-ST1096:125:C0CD7ACXX:1:2205:18365:28103 83 2 114355500 0 > 100M = 114355490 -110 GGT[clip]CAG 9CC[clip]CCC XT:A:R > NM:i:0 SM:i:0 AM:i:0 X0:i:5 X1:i:2 XM:i:0 XO:i:0 XG:i:0 MD:Z:100 > HWI-ST1096:125:C0CD7ACXX:1:2205:18365:28103 163 2 114355490 0 > 100M = 114355500 110 TGC[clip]GCT @@8[clip]DDB: XT:A:R > NM:i:0 SM:i:0 AM:i:0 X0:i:5 X1:i:1 XM:i:0 XO:i:0 XG:i:0 MD:Z:100 > > This is running bwa version 0.6.1-r104 > > Any ideas on what might be going wrong? Does the BAM file i wish to > realign need to be sorted? Must i convert to fastq first? > > -Matthew > > ------------------------------------------------------------------------------ > Live Security Virtual Conference > Exclusive live event will cover all the ways today's security and > threat landscape has changed and how IT managers can respond. Discussions > will include endpoint security, mobile security and the latest in malware > threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ > _______________________________________________ > Bio-bwa-help mailing list > Bio...@li... > https://lists.sourceforge.net/lists/listinfo/bio-bwa-help -- The Wellcome Trust Sanger Institute is operated by Genome Research Limited, a charity registered in England with number 1021457 and a company registered in England with number 2742969, whose registered office is 215 Euston Road, London, NW1 2BE. |