cancerit/BRASS

Fail when RG==0

ym3 opened this issue · 1 comments

ym3 commented

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, ...

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

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

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 $!"; }