Hi ,
I am running a awk with regex expression in nextflow shell , but it seems not a strightforward things to do in shell , nextflow: this is my code , but it doesnt work :
process POST_proc {
publishDir “${params.output}”, mode: “copy”, overwrite: true
input:
file(f5.vcf)
output:
file(f6.vcf)
shell:
“”"
awk '\$1 !~/#/' f5.vcf | sort -u | awk -F"\t" '{OFS=FS}{for (i=10;i<=NF;i++) if (\$i ~/.\//) \$i='./.'; else \$i=substr(\$i,1,3)}1' >> f6.vcf
"""
}
when i add (awk -F"\t" ‘{OFS=FS}{for (i=10;i<=NF;i++) if ($i ~/.//) $i=’./.‘; else $i=substr($i,1,3)}1’), it doesnt run. seems the regex expression should be changed.
any helps would be appreciated
Regards
Iman