Adding functions to Queue pipelines on the fly

jeremylp2jeremylp2 Member
edited November 2013 in Ask the GATK team

I'm wondering if there's a straightforward way to add (or not add) a function to a queue pipeline based on some condition that is known only after running an intermediate step of the pipeline. I realize the below won't work, but the logic would look something like this:

<br /> def script = {<br /> foo.input = "foo_input"<br /> foo.output = "foo_output"<br /> add(foo) <br /> if (foo_results_analysis(foo.output))<br /> {<br /> add(bar)<br /> }<br /> }<br />
Of course, this doesn't work because the script is run and functions are added before the pipeline actually starts running. But this sort of functionality could be helpful if, for instance, you are trying to run repeated rounds of BQSR until you meet some convergence criterion (call SNPS, pull out high confidence subset and feed to BQSR as the "known" set, repeat until the set of SNP calls is stable). This is suggested in the BQSR documentation for cases in which a genome you are working on doesn't have a decent SNP database. Any suggestions on pipelining something like this?

Best Answer


Sign In or Register to comment.