We've moved!
This site is now read-only. You can find our new documentation site and support forum for posting questions here.
Be sure to read our welcome blog!

help with scala script and SplitNCigarReads

estif74estif74 Saint Paul, MN, USAMember

Hi there,

I'm having some trouble getting the arguments to work properly for SplitNCigarReads in a scala script that are specified in article #3891. Specifically:

-rf ReassignOneMappingQuality -RMQF 255 -RMQT 60 and

What I'm trying is something like:

        val SNCR = new SplitNCigarReads with CommonArguments
        SNCR.input_file :+= qscript.bamFile
        SNCR.out = swapExt(qscript.bamFile, "bam", "split.bam")
        SNCR.read_filter :+= "ReassignOneMappingQuality -RMQF 255 -RMQT -60"
        SNCR.unsafe = "ALLOW_N_CIGAR_READS"

The SNCR.unsafe yields a result that indicates:

found : String("ALLOW_N_CIGAR_READS")
required: org.broadinstitute.sting.gatk.arguments.ValidationExclusion.TYPE

and the SNCR.read_filter will work in the dry run, but when I add the -run flag to my scala script it tells me that this argument isn't valid either.

Any thoughts from some scala pros?


Best Answer


  • Geraldine_VdAuweraGeraldine_VdAuwera Cambridge, MAMember, Administrator, Broadie admin

    Hi Steve,

    For the ALLOW_N_CIGAR_READS question, it's the same variable type issue as your other recent scala question: because the argument takes an enumerated type rather than a string, you need to specify it as

    SNCR.unsafe = ValidationExclusion.TYPE.ALLOW_N_CIGAR_READS

    The read filter question is a little different; the problem there is that you can't include the filter parameters in the string where you specify the filter name. You should do

    SNCR.read_filter :+= "ReassignOneMappingQuality"

    and pass the parameters separately. I'm not actually sure how to do that; I expect SNCR.RMQF = 255 and SNCR.RMQT = 60 should work, but haven't tested it. As it happens, those are the default values, so in our pipeline scripts we just don't specify them.

  • estif74estif74 Saint Paul, MN, USAMember

    Thanks @Geraldine_VdAuwera‌ . I couldn't get the SNCR.RMQF or SNCR.RMQT to work, but I opted not to include them b/c they're the defaults as you said.

    Also, I found that I needed to add

    import org.broadinstitute.sting.gatk.arguments.ValidationExclusion

    To the top of my script, and this made it work.

    I owe you big time for your help - I can't thank you enough! If you ever need free veterinary advice for your pets, feel free to PM me :-)

Sign In or Register to comment.