Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  1. Log in to teton

  2. load the nextflow module: module load nextflow

  3. Create the text file below and call it minimal_wrapper.nf. You can then run it with the command nextflow run minimal_wrapper.nf.

  4. If you want to run the same command using SLURM, rather than the local computer, create the second file below, and call it teton.config. Then you can run the same command using SLURM and its distribution of jobs to the cluster. Please adjust the account name to match yours, otherwise the job will not run.

  5. Output will be in the folder work/. This includes hidden files for standard error and out from the jobs: you can see these with ls -al work/*/*/

Code Block
languagegroovy
#!/usr/bin/env nextflow
// author: Alex Buerkle <buerkle@uwyo.edu>
nextflow.enable.dsl=2

// invoke as, to run locally:   nextflow run minimal_wrapper.nf 
// or as, to use SLURM: nextflow run minimal_wrapper.nf -c teton.config
// output will be in work/*/*/.commands.out and neighboring files

simsRds = Channel.fromPath( "/etc/*d.conf")  // several arbitrary files in the /etc/ directory

process iterateFiles{
       input:
         file x
       output:
         stdout

       """
       echo 'made it here $x $HOSTNAME'
       """
}

workflow{ 
    // workflow uses channels as input by default
    iterateFiles(simsRds) 
}

...

  1. Log in to teton

  2. load the nextflow module: module load nextflow

  3. Create a file from the first text window below and save it as minimal_wrapper_Rwork.nf

  4. Create a second file with the simple R command rnorm(5) to give R something to do and call it Rtest.R

  5. To run the collection of jobs, nextflow run minimal_wrapper_Rwork.nf -c teton.config

  6. Output will be in the folder work/. This includes hidden files for standard error and out from the jobs: you can see these with ls -al work/*/*/

Code Block
#!/usr/bin/env nextflow
// author: Alex Buerkle <buerkle@uwyo.edu>
nextflow.enable.dsl=2

// to run locally:   nextflow run minimal_wrapper_Rwork.nf 
// or using SLURM: nextflow run minimal_wrapper_Rwork.nf -c teton.config

// output will be in work/*/*/.commands.out and neighboring files

simsRds = Channel.fromPath( "/etc/*d.conf")  // several arbitrary files in the /etc directory

process iterateFiles{
       input:
         path x
       output:
         stdout

       """
       echo 'Working on $x'
       Rscript --vanilla Rtest.R $x out_$x
       """
}

workflow{ 
    // workflow uses simsRds channel as input
    iterateFiles(simsRds) 
}

...