Your post inspired me to add this functionality into BBTools (in the next release). I've been using custom code in individual tools to filter by cutoffs in header terms like "count=123", "score=0.57", or "cov=37.2", but a more generalized approach would have been better.
Edit: OK! Now released in v39.06:
reformat.sh in=x.fasta out=filtered.fasta tag=seqs= delimiter=; minvalue=10
Other relevant flags:
tag= Look for this tag in the header to filter by the next value. To filter reads
with a header like 'foo,depth=5.5,bar' where you only want depths
of at least 3, the necessary flags would be 'tag=depth= minvalue=3 delimiter=,'
delimiter= Character after the end of the value, such as delimiter=X. Control and
whitespace symbols may be spelled out, like delimiter=tab or delimiter=pipe.
The tag may contain the delimiter. If the value is the last term in the header,
the delimiter doesn't matter but is still required.
minvalue= If set, only accept a numeric value of at least this.
maxvalue= If set, only accept a numeric value of at most this.
value= If set, only accept a string value of exactly this.
invertfilters=f (invert) Output failing reads instead of passing reads.
For completeness, here are the control character delimiters you can spell out when they become problematic (some of them are difficult to escape):
space
tab
# pound
> greaterthan
< lessthan
= equals
: colon
; semicolon
! bang
& and or ampersand
" quote or doublequote
' singlequote or apostrophe
\ backslash
^ hat or caret
$ dollar
. dot
| pipe or or
? questionmark
* star or asterisk
+ plus
( openparen
) closeparen
[ opensquare
{ opencurly