X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=vcf_rs_grep;h=4c89281f037abea871e4209f95f92c52a94bca0f;hb=56c8d8b286ae38e170ce915472f9aa86fabf9fee;hp=56aef856b514d4ca83f94a160650b316e1a4bb60;hpb=05dbb78bfedc7d9de2c0fc7ba70ea93ff9847af4;p=bin.git diff --git a/vcf_rs_grep b/vcf_rs_grep index 56aef85..4c89281 100755 --- a/vcf_rs_grep +++ b/vcf_rs_grep @@ -126,7 +126,20 @@ while (<$vcf>) { $_ =~ /^\S+\s+\S+\s+(\S+)/o; next unless $1; next unless exists $rsids{$1} and $rsids{$1}; + $rsids{$1}++; print $_; } +my @unused_rsids; +for my $rsid (keys %rsids) { + if ($rsids{$rsid} == 1) { + push @unused_rsids,$rsid; + } +} +if (@unused_rsids) { + print STDERR "The following rsids were not found\n"; + print STDERR map {$_."\n"} @unused_rsids; +} + + __END__