Positional inputs

21 views
Skip to first unread message

mqualls

unread,
Jun 14, 2018, 6:23:26 PM6/14/18
to bpipe-discuss
How can I set up a pipeline to run stage1 on input1 and stage2 on input2 (with a stage3 that takes both the prior outputs as input)?  I'd like the behavior to be governed by positional order. Swapping the order of the two inputs would be a valid, but different, operation.
The files are of the same type, so there's not a convenient way to differentiate using extensions. Using $input2 in a stage makes it expect two inputs internal to that stage alone.
Passing names as variables loses the fact that these are input files, so there's no dependency tracking.

Simon Sadedin

unread,
Jun 15, 2018, 5:46:27 PM6/15/18
to bpipe-discuss on behalf of mqualls
There are a few different ways to do it that implicitly get the second input to be used in the second stage, but if positional order is really how you want to drive the recognition of the inputs, I actually suggest adding an init stage that identifies them by name using branch variables.

Here's a simple example:

init = {
    branch.first = input1
    branch.second = input2
}

hello = {
    from(first) {
        exec """
            cp -v $input $output
        """
    }
}

world = {
    from(second) {
        exec """
            cp -v $input $output
        """
    }
}

run {
    init + hello + world
}

Here I just called them 'first' and 'second' but obviously you can name them something meaningful in terms of what they actually represent.

Hope this helps!

Simon




--
You received this message because you are subscribed to the Google Groups "bpipe-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to bpipe-discuss+unsubscribe@googlegroups.com.
To post to this group, send email to bpipe-...@googlegroups.com.
Visit this group at https://groups.google.com/group/bpipe-discuss.
For more options, visit https://groups.google.com/d/optout.

Morgan Qualls

unread,
Jun 15, 2018, 5:53:12 PM6/15/18
to bpipe-discuss on behalf of Simon
Thanks, that should do nicely.

--
You received this message because you are subscribed to a topic in the Google Groups "bpipe-discuss" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/bpipe-discuss/HzFsffbhKE0/unsubscribe.
To unsubscribe from this group and all its topics, send an email to bpipe-discuss+unsubscribe@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages