This was something that was requested in an offline discussion.
Given a Fastq file with variable read length (e.g. after preprocessing):
mapped = select(mapped) using |mr|:
mr = mr.filter(min_match_size={read_length}, action={drop})
if not mr.flag({mapped}): ^^^^^^^^^^^^^
discard
here {read_length} could be mr.read_length().