CGATOxford / UMI-tools

Tools for handling Unique Molecular Identifiers in NGS data sets
MIT License
491 stars 190 forks source link

whitelist error :Syntax error near unexpected symbol ` (' #491

Closed jehuliu closed 2 years ago

jehuliu commented 3 years ago

When use the umi_tools whitelist, I got a error: Syntax error near unexpected symbol ` (' Could you please help to solve this problem? The code was follows:

sample="barcode1_BDSW210000636-1A_1 barcode1_BDSW210000636-1A_2 barcode2_BDSW210000637-1A_1 barcode2_BDSW210000637-1A_2" for s in $sample do umi_tools whitelist -I $s.fq.gz --method=umis --extract-method=regex -p (?P.{4}) -S $s.whitelist.txt wait done

TomSmithCGAT commented 3 years ago

The error is from bash, e.g not umi-tools itself, and is due to missing quotes around the barcode pattern. Same issue as described here: https://askubuntu.com/questions/372926/bash-syntax-error-near-unexpected-token

umi_tools whitelist -I $s.fq.gz --method=umis --extract-method=regex -p "(?P<umi_1>.{4})" -S $s.whitelist.txt should work fine

IanSudbery commented 2 years ago

Did this work?

IanSudbery commented 2 years ago

I'm going to assume that this fixed the problem and will close the issue. Please let me know if this is not the case and I will reopen.