I have a tuple channel containing entries like:
SH7794_SA119138_S1_L001, [R1.fq.gz, R2.fq.gz]
And a csv split into 36 entries, each like:
[samplename:SH7794_SA119138_S1, mouseID:1-4, treat:vehicle, dose:NA, time:day18, tgroup:vehicle__day18, fastqsuffix:_L001_R1_001.fastq.gz, bamsuffix:_Filtered.bam, trim:fulgentTrim, species:human, host:mouse, outlier:NA, RIN:6.9]
I was able to combine the tuple channel with the csv entries using the each
keyword. This results in a cross-product of all 36 csv rows for each tuple. I then added a when
condition to do the filtering:
input:
tuple sampleid, reads from fq
each samplemeta from samplelist
...
when:
sampleid.contains(samplemeta.samplename)
This works but I'm curious if this is an appropriate solution. What is the correct way to dynamically join channels using a regular expression, by matching a value from one channel against multiple values from a second channel?