diff --git a/README.md b/README.md index ea83399..15e8ab6 100644 --- a/README.md +++ b/README.md @@ -25,23 +25,14 @@ vcfexpr filter -e "return variant:info('AN') > 3000" \ ``` --- -use `all` in user-defined `funcs.lua` -check the sample fields to get variants where all samples have high DP +check the sample fields to get variants where `all` samples have high DP. +`all` is defined by `vcfexpr` (`any`, `filter` are also available). +Users can load their own functions with `-l $lua_file`. ``` -vcfexpr filter -l funcs.lua \ - -e 'return all(variant:format("DP"), function (dp) return dp > 10 end)' \ +vcfexpr filter \ + -e 'return all(function (dp) return dp > 10 end, variant:format("DP"))' \ -o all-high-dp.bcf $input_vcf ``` -``` -$ cat funcs.lua -function all(t, f) - for _, v in pairs(t) do - if v ~= nil and not f(v) then - return false - end - end -return true -``` --- get all of the FORMAT fields for a single sample into a lua table. @@ -143,18 +134,28 @@ Arguments: Path to input VCF or BCF file Options: - -e, --expression boolean Lua expression(s) to filter the VCF or BCF file - -t, --template