I am running `nf-core pipelines lint` on my <#C06T...
# linting
c
I am running
nf-core pipelines lint
on my #C06TRU74N4D pipeline, and I have lines like this:
Copy code
│ pairalign_m2m                          │ subworkflows/local/pairalign_m2m/main.nf                          │ Included component 'ALIGNMENT_TRAIN' versions are not added in <http://main.nf|main.nf>
However, the versions channel information is properly collected.
Copy code
$ grep -C5 ALIGNMENT_TRAIN subworkflows/local/pairalign_m2o/main.nf
include { LAST_DOTPLOT as ALIGNMENT_DOTPLOT_O2O     } from '../../../modules/nf-core/last/dotplot/main'
include { LAST_DOTPLOT as ALIGNMENT_DOTPLOT_O2O_FLT } from '../../../modules/nf-core/last/dotplot/main'
include { LAST_LASTAL  as ALIGNMENT_LASTAL_M2O      } from '../../../modules/nf-core/last/lastal/main'
include { LAST_LASTDB  as ALIGNMENT_LASTDB          } from '../../../modules/nf-core/last/lastdb/main'
include { LAST_SPLIT   as ALIGNMENT_SPLIT_O2O       } from '../../../modules/nf-core/last/split/main'
include { LAST_TRAIN   as ALIGNMENT_TRAIN           } from '../../../modules/nf-core/last/train/main'
(…)
    versions = Channel.empty()
        .mix(     ALIGNMENT_LASTDB.out.versions)
        .mix(      ALIGNMENT_TRAIN.out.versions)
        .mix( ALIGNMENT_LASTAL_M2O.out.versions)
        .mix(  ALIGNMENT_SPLIT_O2O.out.versions)
        .mix(ALIGNMENT_DOTPLOT_O2O.out.versions)
}
How do I solve the lint warning?
s
I think the versions channel is to be updated just after the included module is run in the subworkflow. Thats how the linter works I guess on a subworkflow file. And using the
nf-core subworkflows create
command generates a template that has version channel update code just after the module use code snippet.
c
Thanks a lot for the fast answer, this solved my problem!
May I ask one more questions: if I include multiple times the same module under a different alias, do I have to record the (same) version number for all includes, or just ignore the warning for all includes except the first? For instance, I have:
Copy code
include { LAST_DOTPLOT as ALIGNMENT_DOTPLOT_M2M     } from '../../../modules/nf-core/last/dotplot/main'
include { LAST_DOTPLOT as ALIGNMENT_DOTPLOT_M2M_FLT } from '../../../modules/nf-core/last/dotplot/main'
and this warning, because I only collect version number for
ALIGNMENT_DOTPLOT_M2M…
Copy code
│ pairalign_m2m                          │ subworkflows/local/pairalign_m2m/main.nf                          │ Included component 'ALIGNMENT_DOTPLOT_M2M_FLT' versions are not added in <http://main.nf|main.nf>                                                                                          │
s
Yes, versions are to be collected for the aliases too, because there might be a case where you only run one of the aliases from your subworkflow depending upon a condition.
c
Thanks! One more question if you don't mind, I get warnings when I run the collection with
first()
like in the subworkflow template. Shall I remove these when it suppresses warnings? Example:
Copy code
ch_versions.mix(ALIGNMENT_LASTDB.out.versions.first()
s
Yes,
first()
can be removed