From aba828abbabcb9a952ad3144d8ae03e7f4e0ea87 Mon Sep 17 00:00:00 2001 From: Patrick Simianer Date: Fri, 21 May 2021 17:49:56 +0200 Subject: tsv-exclude --- tsv-exclude | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100755 tsv-exclude diff --git a/tsv-exclude b/tsv-exclude new file mode 100755 index 0000000..e951ea1 --- /dev/null +++ b/tsv-exclude @@ -0,0 +1,21 @@ +#!/usr/bin/env ruby + +require 'zipf' +require 'set' + +to_exclude0 = {} +to_exclude1 = {} +f = ReadFile.new ARGV[0] + +while line = f.gets + p0, p1 = line.strip.split "\t" + to_exclude0[p0] = true + to_exclude1[p1] = true +end + +while line = STDIN.gets + p0, p1 = line.strip.split "\t" + if not to_exclude0.has_key? p0 and not to_exclude1.has_key? p1 + puts line + end +end -- cgit v1.2.3