Skip to content

Commit

Permalink
Fixed a bug in genotype mode regarding handling of no calls (when the…
Browse files Browse the repository at this point in the history
…re's not enough real calls to fill the sample groups to their minimum sizes.

Files checked in: src/vcfSampleCompare.pl
  • Loading branch information
hepcat72 committed Oct 15, 2018
1 parent 6d9a723 commit 97e103e
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions src/vcfSampleCompare.pl
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
use strict;
use CommandLineInterface;

our $VERSION = '2.007';
our $VERSION = '2.008';
setScriptInfo(VERSION => $VERSION,
CREATED => '6/22/2017',
AUTHOR => 'Robert William Leach',
Expand Down Expand Up @@ -534,6 +534,9 @@
{push(@$group_diff_mins,1,1)}
}

debug("Min group sizes: [",join(',',@$group_diff_mins),"].",
{LEVEL => 3});

#Print the new header
$outputs->{HEADER_LINES} .= "#$_\n";

Expand Down Expand Up @@ -571,7 +574,7 @@
my(@data) = @cols[$sample_name_start_index..$#cols];

debug("FORMAT string for data record [$data_line]: [$format_str].");
debug({LEVEL => 2},"Data record [$data_line]: [",join("\t",@data),"].");
debug({LEVEL => 2},"Record [$data_line]: [$_].");

#Determine the subindex of each piece of sample data based on the
#FORMAT string by creating a hash
Expand Down Expand Up @@ -1538,8 +1541,10 @@ sub createSampleGroups
sort {$genotype_counts->{$sample_info->{$b}->{GT}} <=>
$genotype_counts->{$sample_info->{$a}->{GT}}}
grep {$sample_info->{$_}->{GT} !~ /\./} keys(%$sample_info);
my @nocalls = grep {/\./} keys(%$sample_info);
my @samples_remaining = (@ordered_gts_real,@nocalls);
my @nocalls = (grep {$sample_info->{$_}->{GT} =~ /\./}
keys(%$sample_info));
my @samples_remaining = (grep {defined($_)}
@ordered_gts_real,@nocalls);
my $call = '';
while(scalar(@samples_remaining) &&
scalar(@$group1) < $min_size1 &&
Expand Down

0 comments on commit 97e103e

Please sign in to comment.