Get notifications!

You can opt in to receive email notifications, for example when your questions get answered or when there are new announcements, by following the instructions given here.

Got a problem?

1. Search using the upper-right search box, e.g. using the error message.
2. Try the latest version of tools.
3. Include tool and Java versions.
4. Tell us whether you are following GATK Best Practices.
5. Include relevant details, e.g. platform, DNA- or RNA-Seq, WES (+capture kit) or WGS (PCR-free or PCR+), paired- or single-end, read length, expected average coverage, somatic data, etc.
6. For tool errors, include the error stacktrace as well as the exact command.
7. For format issues, include the result of running ValidateSamFile for BAMs or ValidateVariants for VCFs.
8. For weird results, include an illustrative example, e.g. attach IGV screenshots according to Article#5484.
9. For a seeming variant that is uncalled, include results of following Article#1235.

Jump to another community

Re:Automating SelectVariants in a script using bash parameter sustitution

I have found SelectVariants really useful to cull out homozygous calls from my vcf file, especially using the variant context JEXL expressions. However, since I have many VCF files, I like to automate using a bash script. The following is my bash script:

I understand the error message, clearly the JEXL expression "vc.getGenotype()" is expecting a real sample ID and the bash parameter substitution isn't working. I have no problems passing sample IDs if I run SelectVariants on an individual VCF files and I have done that many times. However if I have to automate, do you have suggestions about how I can pass the appropriate sample IDs from within each VCF file during every cycle of the bash script? I think it amounts to passing a bash parameter substitution to a JEXL expression, Is this possible?

I did modify my bash syntaxes as well, in fact if I echo I get the exact command I would use if I were running it on an individual file. However when I run the program I always get a variation of the JEXL error. So i think it is a case of finding the right JEXL syntax to make it recognize the bash variables we are passing to it.