// the passed "v" will be of type VCFVariant
// if the function "filter" returns "true", then the variant will be returned by the iterator
function filter(v) {
	var vFilter = v.getFilter()
	var cutoff = 0.01
	if (("PASS".equals(vFilter) || ".".equals(vFilter)) &&
			filterImpact(v) &&
			filterLessThan(v, "NIEHSAF", cutoff) &&
			filterLessThan(v, "NIEHSIAF", cutoff) &&
			filterLessThan(v, "TGAF", cutoff)
			) return v
	return null
}

importClass(java.lang.System)

function filterImpact(v) {
	var impact = v.getInfoValue("IMPACT");
	//System.err.println("impact: " + impact)
	if (impact == null) return false;
	if (impact.equals("HIGH") || impact.equals("MODERATE")) return v
	return null
}

function filterLessThan(v, key, cutoff) {
	var val = v.getInfoValue(key)
	//System.err.println(key + ": " + val)
	// the convoluted use of "not greater than" to cause NaN values to result in "true"
	if !(parseFloat(v.getInfoValue(key)) > cutoff) return v
	return null
}

@@ -610,18 +610,22 @@
 false;%0A%09
-if
+return
  (impact
@@ -669,38 +669,16 @@
 ERATE%22))
- return v%0A%09return null
 %0A%7D%0A%0Afunc
@@ -753,112 +753,123 @@
 %0A%09//
-System.err.println(key + %22: %22 + val)%0A%09// the convoluted use of
+if (isNaN(val)) return v%0A%09//return (parseFloat(val) %3C= cutoff) ? v : null%0A%09// weird
  %22not
- 
+-
 greater
- 
+-
 than%22 
-to cause NaN values to
+so NaNs will
  res
@@ -879,19 +879,24 @@
  in 
-%22
+'
 true
-%22%0A%09if 
+'%0A%09return (
 !(pa
@@ -909,58 +909,21 @@
 at(v
-.getInfoValue(key)) %3E cutoff) return v%0A%09return null
+al) %3E cutoff))
 %0A%7D%0A

fix breakage from filter (v/null instead of true/false) change