my $lib=($t->{readgroup})?$RGlib{$t->{readgroup}}:'NA'; #when multiple libraries are in a BAM file
If the read group id is 0, the conditional part of the ?: statement evaluates to false, so that readgroup is ignored. It would be better to see if $t->{readgroup} is defined:
my $lib=defined($t->{readgroup})?$RGlib{$t->{readgroup}}:'NA'; #when multiple libraries are in a BAM file
Line 114 of perl/bam2cfg.pl currently reads:
If the read group id is 0, the conditional part of the ?: statement evaluates to false, so that readgroup is ignored. It would be better to see if
$t->{readgroup}
is defined: