I am trying to use `samtools view` to filter a bam file. I would ideally like to take a sorted bam with the DT flags set by `picard markduplicates` (e.g. DT:Z:SQ for optical/sequencing and DT:Z:LB for PCR/library) and exclude reads with either DT:SQ only OR DT:SQ & DT:LB. As far as I can tell, `samtools` only supports filtering by ***including*** specific tag:value pairs with the `-d` parameter. Is there any workaround here? Or is the only option to write another intermediate file? 
using samjdk http://lindenb.github.io/jvarkit/SamJdk.html

(not tested)

     java -jar dist/samjdk.jar -e 'Object att = record.getAttribute("DT"); return att==null || !(att.equals("SQ") || att.equals("LB"));' input.bam