<@U02JS8EFMMJ> do we still allow single item chann...
# modules
n
@Júlia Mir do we still allow single item channel entries in a module's meta.yaml? I've a boolean option as input to a module so it doesn't really make sense to have it as a tuple input. Should I update the json schema to still allow this?
j
you should be able to do it, it's a channel of one element:
Copy code
- - my_boolean:
      type: boolean
      description: bla blah
n
Ah hmm but the input isn't actually a tuple so making it a list here doesn't really make sense?
Copy code
input:
    tuple val(meta), path(bams), path(bais), path(bed)
    tuple val(meta2), path(fasta)
    tuple val(meta3), path(fasta_fai)
    val(run_test)
I'm talking about
run_test
in this case
j
🤔 I see it as elements of the channel, not like the difinition of a tuple
n
Yeah allright doesn't really matter that much to me 😛
thank you! I'll just make it a list with one entry 😛
j
having a mix of both will make things way more complicated I think 😬
💯 1
n
You got a point there 😁 let's keep it simple indeed 😛
🙌🏻 1
m
a website says thank you 😉
🤣 2
p
wwwait a minute
Not sure about this
meta.yml should represent the nextflow code, everything else is much more secondary I think
If this isn't a tuple, then it shouldn't be a tuple in the meta.yml..
This is how we got ourselves into this mess in the first place 😅
My hope was that we could go back and forth between meta and nextflow
But this breaks that promise ☝🏻
🤔 2
You'd get
tuple val(run_test)
which is different..
n
Also true! It should be fairly simple fix in the JSON schema but not sure how much work this will be in other places
j
the website and tools
nf-core modules lint --fix
will have to be fixed
and linting will also fail if we change the JSON schema without updating tools 🙊
p
Sorry, I didn't realise that this wasn't already supported
@Júlia Mir do you agree that it should be this way, irrespective of implementation details?
Copy code
- - meta:
      type: object
  - bams:
      type: path
  - bais:
      type: path
  - bed:
      type: path
- - meta2:
      type: object
  - fasta:
      type: path
- - meta3:
      type: object
  - fasta_fai:
      type: path
- run_test:
    type: boolean
j
I had envisioned this meta.yml structure as channels with element, independent of if they are tuples or not. And I didn't think about tuples with only one element, to me this meant having a simple channel. But yes, if we can have one element tuples I agree
p
Is
val(run_test)
a tuple with one element? Or is it not a tuple at all? I was thinking the latter..
j
not a tuple 😄
I mean I didn't think we could have
tuple val(run_test)
so a meta.yml with
Copy code
- - meta3:
      type: object
  - fasta_fai:
      type: path
- - run_test:
      type: boolean
was always this in my head
Copy code
tuple val(meta3), path(fasta_fai)
val tun_test
n
I'd prefer this, but that currently isn't supported by the JSON schema
Copy code
╭─ [✗] 1 Module Test Failed ────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
│              ╷                                      ╷                                                                                                                 │
│ Module name  │ File path                            │ Test message                                                                                                    │
│╶─────────────┼──────────────────────────────────────┼────────────────────────────────────────────────────────────────────────────────────────────────────────────────╴│
│ vardictjava  │ modules/nf-core/vardictjava/meta.yml │ The meta.yml of the module vardictjava is not valid: {'run_test': {'type': 'boolean', 'description': 'Run tests │
│              │                                      │ using teststrandbias.R or testsomatic.R\nWhen false, the --fisher option will be automatically added to the     │
│              │                                      │ arguments\nhttps://github.com/AstraZeneca-NGS/VarDictJava/issues/300#issuecomment-638085125\n'}} is not of type │
│              │                                      │ 'array'. Check the entry for input.                                                                             │
│              ╵                                      ╵                                                                                                                 │
╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
p
Is this something that we need to hold v3 #tools for if we're going for it? 🤔
I think it should be fine to go for v3.1 or v3.0.1 right?
Are there existing #modules where we would need to update this?
j
I also think it can be 3.0.1
And there are probably lots of modules to update, but it can be automated like we did before
🎉 1
p
Sounds good 👌🏻
Sorry for not catching this sooner
j
Hello! Sorry to bring this up again 😅 but I was working on the modules template and trying to take this into account and I am confusing myself 🤯 I will try to put an example to doublecheck if we agree
main.nf
Copy code
input:
    tuple val(meta), path(fasta)
    val(run_test)

output:
    tuple val(meta), path("*.bam"), emit: bam
    path("versions.yml"), emit: versions
Would result in
meta.yml
Copy code
input:
- - meta:
      type: map
  - fasta:
      type: file
- run_test:
    type: boolean

output:
- bam:
    - - meta:
          type: map
      - "*.bam":
          type: file
- versions:
    - "versions.yml":
        type: file
correct?
n
yes that seems about right!
p
Does the
output
block need to be an array or can it be a dict? Is
emit
always unique? I think so, right? 🤔 Wondering if we can do this:
Copy code
output:
  bam:
    - - meta:
          type: map
      - "*.bam":
          type: file
  versions:
    - "versions.yml":
        type: file
j
makes sense, I think the emit must be unique
👍🏻 1