From 015514a890109b36ca15400d5c8ad31b4f30b16c Mon Sep 17 00:00:00 2001 From: Don Armstrong Date: Mon, 27 Feb 2017 10:29:22 -0800 Subject: [PATCH] output unused rsids --- vcf_rs_grep | 13 +++++++++++++ 1 file changed, 13 insertions(+) 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__ -- 2.39.2