Skip to content
This repository has been archived by the owner on Oct 29, 2022. It is now read-only.

Commit

Permalink
add initial script
Browse files Browse the repository at this point in the history
  • Loading branch information
alecf committed Apr 21, 2021
1 parent 46dfc8a commit cd2b5af
Showing 1 changed file with 34 additions and 0 deletions.
34 changes: 34 additions & 0 deletions main.nf
@@ -0,0 +1,34 @@
#!/usr/bin/env nextflow

params.in = "$baseDir/combined.fa"
params.pangolin_options = ''
params.outdir = 'out'

process pangolin {
publishDir "${params.outdir}", mode: 'copy'
tag 'pangolin'

container 'staphb/pangolin:latest'

input:
file(fasta) from params.in

output:
file("${task.process}/lineage_report.csv") into pangolin_file
file("logs/${task.process}/${task.process}.${workflow.sessionId}.{log,err}")

shell:
'''
mkdir -p !{task.process} logs/!{task.process}
log_file=logs/!{task.process}/!{task.process}.!{workflow.sessionId}.log
err_file=logs/!{task.process}/!{task.process}.!{workflow.sessionId}.err
date | tee -a $log_file $err_file > /dev/null
pangolin --version >> $log_file
pangolin --pangoLEARN-version >> $log_file
cat !{fasta} > ultimate_consensus.fasta
pangolin !{params.pangolin_options} \
--outdir !{task.process} \
ultimate_consensus.fasta \
2>> $err_file >> $log_file
'''
}

0 comments on commit cd2b5af

Please sign in to comment.