cancerit / BRASS

Breakpoints via assembly - Identifies breaks and attempts to assemble rearrangements in whole genome sequencing data.
GNU Affero General Public License v3.0
57 stars 20 forks source link

Fail when RG==0 #80

Closed ym3 closed 5 years ago

ym3 commented 5 years ago

The code in its current form fails whenever readgroup is set to 0 by design: @RG ID=0 Read groups from Illumina/Isaac pipeline are typically numbered 0, 1, 2, ...

https://github.com/cancerit/BRASS/blob/d08d1746a2db65f86a2febf4f947185c0d61b003/perl/bin/brassI_prep_bam.pl#L146

If you want to use unless, you need to make an exception for RG==0, e.g.

my $bas_ob_rg=$bas_ob->get($rg_id, 'readgroup'); 
unless($bas_ob_rg==0 || $bas_ob_rg) { die "Readgroup $rg_id in bam file but not in bas file $!"; }

Traceback from inside dockstore-cgpwgs-2.0.1.simg Readgroup 0 in bam file but not in bas file at /opt/wtsi-cgp/bin/brassI_prep_bam.pl line 146. Command exited with non-zero status 255

keiranmraine commented 5 years ago

Hm, yes this needs to be fixed should be:

unless (defined $bas_ob->get($rg_id, 'readgroup')) { die "Readgroup $rg_id in bam file but not in bas file $!"; }