openwdl / wdl-docs

WDL usage documentation including introductory materials, tutorials and cookbook examples
BSD 3-Clause "New" or "Revised" License
7 stars 3 forks source link

Make a cook book example for string matching in WDL #15

Open ekiernan opened 1 year ago

kayleemathews commented 1 year ago

From Broad slack: https://broadinstitute.slack.com/archives/CESEYJW9W/p1663869404506729

From Morgan:

i think you could use sub to do this with something like > if (sub(sample_name, "clinical", "") != sample_name) { ... i.e. if i'm able to remove the substring i'm looking to match, it means the substring was present and the sub() output will not be the same as my original string

Jess also did this in the example script she wrote for Conditionally running different WDL tasks based on input data type using if(sub())