![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
breakdancer bam2cfg error | mei404 | Bioinformatics | 3 | 02-08-2017 02:36 AM |
Misunderstanding breakdancer output | ralonso | Bioinformatics | 3 | 04-11-2012 08:02 AM |
breakdancer empty cfg (no output from bam2cfg) - Problem Solved | jtjli | Bioinformatics | 0 | 09-13-2011 07:07 PM |
breakdancer output question | csoong | Bioinformatics | 6 | 12-23-2010 03:46 AM |
how to make BreakDancer's bam2cfg.pl work? | cliff | Bioinformatics | 5 | 09-07-2010 09:15 AM |
![]() |
|
Thread Tools |
![]() |
#1 |
Member
Location: Beijing Join Date: Dec 2011
Posts: 13
|
![]()
Hi, everyone, I had spent days to do trouble-shooting on bam2cfg.pl,
breakdancer-1.1_2011_02_21.zip. I had tried some ways to figure out the problem, but without any success. Owing to only one lib I have, I changed the header code of bam2cfg.pl, Edited code: open(BAM,"samtools view -h $fbam |") || die "unable to open $fbam\n"; while(<BAM>){ chomp; if(/^\@PG/){ #getting RG=>LIB mapping from the bam header my ($id)="bwa"; my ($lib)="1.2k"; my ($platform)="Illumina"; my ($sample)="88LN"; my ($insertsize)="1200"; #if(defined $insertsize && $insertsize>0){ #$lib=$sample . '_'. $lib; $libs{$lib}=1; $RGlib{$id}=$lib; $RGplatform{$id}=$platform; #} } this is the sorted bam file I have: @SQ SN:scaffold00001 LN:10500 @SQ SN:scaffold00002 LN:2281 @SQ SN:scaffold00003 LN:27085 @SQ SN:scaffold00004 LN:12161 @SQ SN:scaffold00005 LN:2206 . . . @PG ID:bwa PN:bwa VN:0.5.9-r16 . . . HWI-ST833:6:4:18265:54791#0 145 scaffold00001 207 0 50M scaffold00079 243097 0 TTTACTAAAACCGATTGGNCCCGGACAATATTTCGATGTGGGCCGGCCCT ggggggfggg\[]]][K]B[e`gggggfggWgggggegcggggggggggg XT:A:R NM:i:1 SM:i:0 AM:i:0 X0:i:2 X1:i:2 XM:i:1 XO:i:0 XG:i:0 MD:Z:18T31 XA:Z:scaffold00100,+12080,50M,1;scaffold00042,-1233,50M,2;scaffold00007,-133793,50M,2; . . . "perl bam2cfg.pl *bam > jun.cfg" At last: samtaols and perl run successfully, but no output from bam2cfg . Could anyone help me? Thanks in advance! Best Jun Last edited by zhongj; 12-14-2011 at 01:50 AM. |
![]() |
![]() |
![]() |
#2 |
Junior Member
Location: St. Louis, MO Join Date: Apr 2009
Posts: 7
|
![]()
Your code does not seem quite right. Are you sure the conditional tests on @PG (program)? The standard version of bam2cfg.pl tests on @RG (read group). Does your BAM header contain a @PG entry? If not, your changes are not getting executed because they are inside an if block that never evaluates to true. Can you just add an RG group to your BAM using samtools reheader? Otherwise, you should probably just set the $libs{$lib}, $RGlib{$id}, and $RGplatform{$id} before you open the BAM.
__________________
David Dooling |
![]() |
![]() |
![]() |
#3 |
Member
Location: Beijing Join Date: Dec 2011
Posts: 13
|
![]()
Hi, ddgenome, thanks for your suggestion, I will have a try.
|
![]() |
![]() |
![]() |
#4 | |
Member
Location: Beijing Join Date: Dec 2011
Posts: 13
|
![]()
It still do not work. My Bam header do contain a @PG entry. Any one could help me? BreakDancer is too annoying...
![]() Quote:
|
|
![]() |
![]() |
![]() |
#5 |
Junior Member
Location: St. Louis, MO Join Date: Apr 2009
Posts: 7
|
![]()
It really seems your BAM is not well-formed (at least for sequence analysis). Looking closer at the alignment record from the example BAM you provided, the read does not have an RG tag. So you are creating an RG record, but then no reads are associated with it.
__________________
David Dooling |
![]() |
![]() |
![]() |
#6 |
Member
Location: Beijing Join Date: Dec 2011
Posts: 13
|
![]()
Yes, you are right! But how can I fix my BAM file to adapt bam2cfg.pl? Manually add "@RG" ahead every alignment line? Like the following
@R 1.2k GHWI-ST833:6:4:18265:54791#0 145 scaffold00001 207 0 50M scaffold00079 243097 0 TTTACTAAAACCGATTGGNCCCGGACAATATTTCGATGTGGGCCGGCCCT ggggggfggg\[]]][K]B[e`gggggfggWgggggegcggggggggggg XT:A:R NM:i:1 SM:i:0 AM:i:0 X0:i:2 X1:i:2 XM:i:1 XO:i:0 XG:i:0 MD:Z:18T31 XA:Z:scaffold00100,+12080,50M,1;scaffold00042,-1233,50M,2;scaffold00007,-133793,50M,2; or How to fix bam2cfg.pl to adapt my BAM file? Looking forward for your reply! Thanks. Last edited by zhongj; 12-16-2011 at 12:52 AM. |
![]() |
![]() |
![]() |
#7 |
Junior Member
Location: St. Louis, MO Join Date: Apr 2009
Posts: 7
|
![]()
You need to add the @RG entry to the header and then add an RG field pointing to that @RG entry for each alignment record. See the SAM/BAM specification for more information.
http://samtools.sourceforge.net/SAM1.pdf
__________________
David Dooling |
![]() |
![]() |
![]() |
#8 | |||
Member
Location: Germany Join Date: Mar 2011
Posts: 68
|
![]()
Hello,
did you solve the problem? If yes, could you share the solution, please? I have no outpufile as well and I don't know, what is wrong with my bam file. My header looks like the following lines: Quote:
My reads look like Quote:
Quote:
Best regards Robby |
|||
![]() |
![]() |
![]() |
#9 |
Member
Location: Beijing Join Date: Dec 2011
Posts: 13
|
![]()
sorry,I am still working on it
|
![]() |
![]() |
![]() |
#10 | ||
Member
Location: Germany Join Date: Mar 2011
Posts: 68
|
![]()
Dear zhongj,
thanks for your answer. My problem is already solved. I used the following command Quote:
Quote:
Best regards Robby |
||
![]() |
![]() |
![]() |
#11 |
Junior Member
Location: Miami Join Date: Jun 2010
Posts: 6
|
![]()
Hi all,
I'm having a similar problem and I think it might be due to the way I'm originally aligning the file. I'm aligning with bowtie in the SAM format (-S), but the header is @PG and there are no @RG tags for the reads. How are you aligning your files to get the Read Group Id? Thanks, Sara |
![]() |
![]() |
![]() |
#12 |
Junior Member
Location: St. Louis, MO Join Date: Apr 2009
Posts: 7
|
![]()
__________________
David Dooling |
![]() |
![]() |
![]() |
#13 |
Member
Location: Germany Join Date: Mar 2011
Posts: 68
|
![]()
Hi slink,
if your mappings are already finished you can add the read group with Picard as well. For breakdancer ist is also enough, if the RG is mentioned in the header. So you can simply modify the header manually. Best regards Robby |
![]() |
![]() |
![]() |
#14 |
Member
Location: Los Angeles, CA Join Date: Jun 2012
Posts: 18
|
![]()
I'm going to bump this thread to mention to mention that BAMs merged with samtools merge will not produce output unless the -c flag is provided to combine @RG headers with colliding IDs - if appropriate.
Without the -c flag, samtools merge will create additional @RG IDs in the read mapping that may not be in the header, especially if a header is provided with the -h flag. |
![]() |
![]() |
![]() |
Tags |
bam2cfg, breakdancer, structure variation, svs |
Thread Tools | |
|
|