You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// We want to run a bunch of variant callers// Then count common SNPsconstvariantCallerInput={reference: '*_genomic.fna',bam: '*.bam',_bai: '*.bam.bai'}// two tasks once stream support ;)constmpileupAndCall=task({input: variantCallerInput,output: 'variants.vcf',name: 'samtools mpileup | bcftools call',},({ input })=>`samtools mpileup -uf ${input.reference}${input.bam} | \bcftools call -c - > variants.vcf`)constvariantCaller2=task({input: variantCallerInputoutput: '*.vcf'},({ input })=>`caller ${input.reference}${input.bam}`)// Maybe declares a count for an input,// whereas { input: '*.vcf' } could fail when more than one is found since it expects 1constcounter=task({input: [{pattern: '*.vcf',count: (n)=>n>=1}]output: '*.snpcount'},({ input })=>`counter ${input.join(' ')}`// currently, this would actually work// minus the count: (n) => <boolean expression> part// when the counter tasks resolves input, it will find multiple files matching// *.vcf from the junction node which is its immidiate parent// lets see we did count: (n) => n === 5, and let it pick up matching files until 5 was reached// this would work if there was 5 callers, but could pick up more files from upstream tasks// SO. maybe whats needed is a way to declare which nodes a task has// permission to resolve input files fromconstpipeline=join(junction(mpileupAndCall,variantCaller2),counter)pipeline().then(console.log)
Related problems:
use an upstream task who went to stdout output as an input as a file for another task
run something for each variant calling after each one finishes, but then also run the task that requires all variant calls when they are all ready (or the chromosome example, run something for each chromosome, then do more, and run something that needs result of all chromosomes when they are ready)
Related problems: