genome / breakdancer

SV detection from paired end reads mapping
114 stars 42 forks source link

Correctly handle readgroups with ID of 0 #1

Closed bpow closed 11 years ago

bpow commented 11 years ago

Line 114 of perl/bam2cfg.pl currently reads:

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