Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update functions.nf to be more flexible for publishing by meta keys #423

Merged
merged 3 commits into from
Apr 9, 2021

Conversation

drpatelh
Copy link
Member

@drpatelh drpatelh commented Apr 9, 2021

Copied from Slack:

Started playing with changing the publish_by_id functionality we discussed a couple of weeks back. Soon realised I would have to sit down and test this all properly in a real-pipeline context. I now have something together relative to the #rnaseq pipeline here

I have renamed publish_by_id -> publish_by_meta and it now can either accept:

  • A boolean true value in modules.config which is the same as the old behaviour i.e. ${publish_dir}/${meta.id}/
  • A list of keys available in meta that will be concatenated together to get the final directory path

e.g. as defined in modules.config :

'fastqc' {
    args          = "--quiet"
    publish_by_meta = [ 'id', 'single_end', 'mytestfolder', 'strandedness']
    // If meta = [id:WT_REP1, single_end:false, strandedness:reverse]
    // Output folder: results/fastqc/WT_REP1/single_end_false/mytestfolder/reverse/
}
'fastqc' {
    args          = "--quiet"
    publish_by_meta = true
    // If meta = [id:WT_REP1, single_end:false, strandedness:reverse]
    // Output folder: results/fastqc/WT_REP1/ i.e. ${meta[id]} by default
}

If an entry in publish_by_meta isn't present in the meta map then it will still be appended on to give developers even more control to customise the paths if they so wish e.g. mytestfolder in the above example.

If an entry in publish_by_meta has a boolean value in the meta map then the id is appended to the boolean value e.g. single_end_false in the above example.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant