To celebrate the release of GATK 4.0, we are giving away free credits for running the GATK4 Best Practices pipelines in FireCloud, our secure online analysis portal. It’s first come first serve, so sign up now to claim your free credits worth $250. Sponsored by Google Cloud. Learn more at

Using Picard FilterSamReads with Java filters

I'm planning to use Picard FilterSamReads with FILTER=includeJavascript for some of my bamouts with --emitDroppedReads, and, to be frank, I still have no idea as for how that Javascript works. For example, if I use a script like this to identify reads that are not dropped by the caller:

function filterEmittedDroppedReads (record) { var ft = record.getAttribute("FT"); if (ft==null) { return true; }else { return false; } }

Yet FilterSamReads reports 0 reads passed the filter. I'm quite sure there's something wrong in my Javascript, but what can it be?


Issue · Github
by Sheila

Issue Number
Last Updated
Closed By

Best Answer


  • Geraldine_VdAuweraGeraldine_VdAuwera Cambridge, MAMember, Administrator, Broadie

    Hi @johnma, I haven't used the JS expressions myself yet, so I'm not super familiar with the syntax. I think @lindenb is the one who added this functionality, perhaps he can help you. To aid in the process, could you show a test example of reads that you expect to pass the filter?

Sign In or Register to comment.