ERROR ~ illegal string body character after dollar sign

5,658 views
Skip to first unread message

Steve

unread,
Apr 9, 2018, 3:31:52 PM4/9/18
to Nextflow
I am getting a strange error about the syntax in my 'script' block.

N E X T F L O W  ~  version 0.28.0
Launching `main.nf` [festering_euler] - revision: e73847c049
ERROR
~ illegal string body character after dollar sign;
   solution
: either escape a literal dollar sign "\$5" or bracket the value expression "${5}" @ line 22, column 70.
   output
-type v - 2> "${sampleID}.bcftools
                                 ^

1 error


 -- Check '.nextflow.log' file for details


The pipeline in question:

Channel.from( ['NC-HAPMAP', file("input/NC-HAPMAP.original.vcf") ] )
       
.set { sample_variants }
Channel.fromPath("ref/iGenomes/Homo_sapiens/UCSC/hg19/Sequence/WholeGenomeFasta/genome.fa")
       
.into { ref_fasta1; ref_fasta2 }

process normalize_vcf
{
    tag
"${sampleID}"
    echo
true
    publishDir
"${params.output_dir}/normalize_vcf", mode: 'copy', overwrite: true

    input
:
   
set val(sampleID), file(sample_vcf), file(ref_fasta) from sample_variants.combine(ref_fasta1)

    output
:
    file
("${sampleID}.norm.vcf")
    file
("${sampleID}.bcftools.multiallelics.stats.txt")
    file
("${sampleID}.bcftools.realign.stats.txt")

    script
:
   
"""
    cat ${sample_vcf} | \
    bcftools norm --multiallelics -both --output-type v - 2> "
${sampleID}.bcftools.multiallelics.stats.txt" | \
    bcftools norm --fasta-ref "
$(ref_fa)" --output-type v - 2> "${sampleID}.bcftools.realign.stats.txt" > \
    "
${sampleID}.norm.vcf"
    """

}





Any ideas what could be triggering this? Its the same syntax I have used before without issue.

Paolo Di Tommaso

unread,
Apr 9, 2018, 3:41:03 PM4/9/18
to nextflow
You need to escape $ placeholder when it refers to Bash code

    "$(ref_fa)" 


p




--
You received this message because you are subscribed to the Google Groups "Nextflow" group.
To unsubscribe from this group and stop receiving emails from it, send an email to nextflow+unsubscribe@googlegroups.com.
Visit this group at https://groups.google.com/group/nextflow.
For more options, visit https://groups.google.com/d/optout.

Steve

unread,
Apr 9, 2018, 3:59:39 PM4/9/18
to Nextflow
Thanks, I missed that one
To unsubscribe from this group and stop receiving emails from it, send an email to nextflow+u...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages