What's better, having two flags to run an optional...
# nostupidquestions
a
What's better, having two flags to run an optional feature or a single one? for example say you're trying to run and specify the nextclade dataset:
Copy code
--nextclade {data_setname}
or
Copy code
--nextclade
--nextclade-dataset {dataset_name}
the second is more verbose but allows future additions eg adding
--nextclade-tag
. Is one preferred over the other?
e
We usually prefer skip parameters to control that during execution, as in:
Copy code
if (!params.skip_nextclade) {
  ...
}
So, one to control the execution, and another one with the data
j
What's better, having two flags to run an optional feature or a single one
Personal preference 😬 I personally opt for more implicit booleans because it's more 'active' and makes simpler code (less parsing strings, which require extra/more complex custom validation code) But others like the more concise parameters
a
I was reading
viralrecon
and saw that usage @Evangelos Karatzas. But for this pipeline it has to be the specified because the default (by design) is to not run nextclade (its a generic pipeline that needs to support many organisms). In other words nextclade is 'second class' output.
@James Fellows Yates So you suggest having less flags if I understand correctly?
j
I'm saying it's entirely up to you
👍 1
There isn't one right way
I go for more, others go for less
a
Thanks appreciate your thoughts James :)
t
I agree, it's a matter of preference, but it may make a difference if the "data set" is required or optional. If required,
--nextclade
cannot stand on its own, so
--nextclade {data_setname}
makes more sense to me, and if a "tag" is optional, you can always add
--nextclade-tag {tag}
(with a warning that it will be ignored if you don't activate
nextclade
elsewhere), no matter how you set it up. Note that some pipelines also have
--tools
, e.g.
--tools sometool,nextclade,othertool
, so you have options.
If the data set is optional (and rarely used) or has a sane default that is applicable 90% of the time, just a boolean
--nextclade
may be more convenient most of the time. E.g. #sarek lets you pick a
--genome
, and you can change the
--fasta
or the
--known_indels
, etc., but 99.9% of the time you would use the defaults that come with the genome.
a
Excellent suggestion Thomas. I think that's the best of both worlds.
👍 1