output constant sites as a val so it can be passed into iqtree (#429)

* output constant sites as a val as well as a file so it can be passed into iqtree

* Using an env variable because that's far safer!

* Update software/snpsites/main.nf

Co-authored-by: Harshil Patel <drpatelh@users.noreply.github.com>
This commit is contained in:
Anthony Underwood 2021-04-10 18:49:35 +01:00 committed by GitHub
parent ec15bae344
commit 212177d479
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -24,6 +24,7 @@ process SNPSITES {
path "*.fas" , emit: fasta
path "*.sites.txt" , emit: constant_sites
path "*.version.txt", emit: version
env CONSTANT_SITES, emit: constant_sites_string
script:
def software = getSoftwareName(task.process)
@ -34,6 +35,8 @@ process SNPSITES {
echo \$(snp-sites -C $alignment) > constant.sites.txt
CONSTANT_SITES=\$(cat constant.sites.txt)
echo \$(snp-sites -V 2>&1) | sed 's/snp-sites //' > ${software}.version.txt
"""
}