...
Log in to teton
load the nextflow module:
module load nextflow
Create the text file below and call it
minimal_wrapper.nf
. You can then run it with the commandnextflow run minimal_wrapper.nf
.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 theaccount
name to match yours, otherwise the job will not run.Output will be in the folder
work/
. This includes hidden files for standard error and out from the jobs: you can see these withls -al work/*/*/
Code Block | ||
---|---|---|
| ||
#!/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) } |
...
Log in to teton
load the nextflow module:
module load nextflow
Create a file from the first text window below and save it as
minimal_wrapper_Rwork.nf
Create a second file with the simple R command
rnorm(5)
to give R something to do and call itRtest.R
To run the collection of jobs,
nextflow run minimal_wrapper_Rwork.nf -c teton.config
Output will be in the folder
work/
. This includes hidden files for standard error and out from the jobs: you can see these withls -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) } |
...