From: Don Armstrong Date: Mon, 27 Feb 2017 18:29:22 +0000 (-0800) Subject: output unused rsids X-Git-Url: https://git.donarmstrong.com/?p=bin.git;a=commitdiff_plain;h=015514a890109b36ca15400d5c8ad31b4f30b16c output unused rsids --- 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__