I have a tool which consumes a CSV input where each line is an ID and a label, eg.
6479933119,first
6479959170,second
My tool then uses the ID to pull some data from somewhere else, analyse it and label the output with the corresponding string. I want the user to be able to specify a variable number of rows where I would expect the maximum to be around 10. Basically I'm looking for advice about how to specify this in CWL.
I was planning to use dependent record types for each row:
so I would need a record that has an int and a string, something like this:
dependent_parameters:
type:
type: record
name: sample_label_pairs
fields:
id:
type: int
label:
type: string
except I need this to be an array of these records, so the user can specify N of them.
And then I thought I would turn it into a file as suggested here:
http://www.commonwl.org/v1.0/UserGuide.html#Creating_files_at_runtime
My tool also expects this file to be consumed at the command line with an @ prefix, in the same way that curl consumes data files.
So I guess I have a few questions:
- Does this sound like a sensible approach?
- How do I specify an array of records as an input? Is it as simple as record[]?
- How do I add an @ prefix to a command line argument? I guess if I use inputBinding: prefix: I'll get a space between the @ and the file?
Thanks,
Peter
Hi, I don't see any relation to bioinformatics, it looks like a very technical question on cwl syntax which renders this question pure programming and seems to be of very limited interest to users of this site. Please explain the connection to bioinformatics in your question, as Biostars is not a cwl support forum (afaik;).
You might get better help on Stackoverflow
Hint: this might be partly due to the fact that your question is obscured, what is "my tool" this might be essential for any forum to get a good answer.
My apologies - I followed the link from here:
http://www.commonwl.org/
where it says:
There do seem to be a lot of technical questions on this site regarding the low-level syntax of CWL, but if you tell me my question is not of interest I will try to take it elsewhere.
Can any CWL expert here recommend where I should post?
Hi, my apologies, I didn't know Biostars was explicitly mentioned as support forum. I recognized at least one or two names on the list of maintainers. If CWL is mainly intended as a bioinformatics tool, that should be fine. Please ignore my concern and continue posting. As a side note, it is very hard for moderators to know whether this site is used as an official support forum for a specific tool.
I've made a bit more progress on this and I'm now stuck mostly on making an array of records. This is what I have so far:
and it gives me: