Created
          February 27, 2025 04:13 
        
      - 
      
- 
        Save yfarjoun/7a6afa7604ae51c705e21c4724b89630 to your computer and use it in GitHub Desktop. 
    Nextflow workflow with env output
  
        
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | process countStuff{ | |
| input: path(input_file) | |
| output: | |
| env('lines'), emit: lines | |
| env('chars'), emit: chars | |
| env('words'), emit: words | |
| script: | |
| """ | |
| lines=\$(wc -l <${input_file}) | |
| chars=\$(wc -c <${input_file}) | |
| words=\$(wc -w <${input_file}) | |
| """ | |
| } | |
| workflow { | |
| countStuff(params.input) | |
| countStuff.out.lines.view { result -> println "Number of rows: $result" } | |
| countStuff.out.chars.view { result -> println "Number of chars: $result" } | |
| countStuff.out.words.view { result -> println "Number of words: $result" } | |
| } | 
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment