Error running snakemake

Hi there,

I installed nextstrain following the instructions (Setup and installation | Tutorial: Using Nextstrain for SARS-CoV-2), but for some reason am getting an error when i try to run the following snakemake command:

(nextstrain) dan@PATH:~/Work/Computer/GitRepos/ncov$ snakemake --cores 4 --profile
./my_profiles/getting_started/
localrules directive specifies rules that are not present in the Snakefile:
Building DAG of jobs...
Using shell: /usr/bin/bash
Provided cores: 4
Rules claiming more threads will be scaled down.
Conda environments: ignored
Job counts:
[Thu Dec 31 11:17:36 2020]
Job 23: 
excluding sequences flagged in the diagnostic step in file results/to-exclude.txt                                                                                                  
augur filter             --sequences results/aligned.fasta             --metadata data/example_metadata.tsv             --exclude results/to-exclude.txt             --output results/aligned-filtered.fasta 2>&1 | tee logs/refiltered.txt

[Thu Dec 31 11:17:36 2020]
Job 5: Constructing colors file
python3 scripts/assign-colors.py             --ordering defaults/color_ordering.tsv             --color-    schemes defaults/color_schemes.tsv             --output results/global/colors.tsv             --metadata data/example_metadata.tsv 2>&1 | tee logs/colors_global.txt

Traceback (most recent call last):
File "scripts/assign-colors.py", line 22, in <module>
for line in f.readlines():
 File "/home/dan/.miniconda3/envs/nextstrain/lib/python3.6/encodings/ascii.py", line 26, in decode
return codecs.ascii_decode(input, self.errors)[0]
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 88: ordinal not in range(128)
[Thu Dec 31 11:17:36 2020]
Error in rule colors:
jobid: 5
output: results/global/colors.tsv
log: logs/colors_global.txt (check log file(s) for error message)
shell:

python3 scripts/assign-colors.py             --ordering defaults/color_ordering.tsv             --color-schemes defaults/color_schemes.tsv             --output results/global/colors.tsv             --metadata data/example_metadata.tsv 2>&1 | tee logs/colors_global.txt

(one of the commands exited with non-zero exit code; note that snakemake uses bash strict mode!)
Logfile logs/colors_global.txt:
Traceback (most recent call last):
  File "scripts/assign-colors.py", line 22, in <module>
for line in f.readlines():
  File "/home/dan/.miniconda3/envs/nextstrain/lib/python3.6/encodings/ascii.py", line 26, in decode
return codecs.ascii_decode(input, self.errors)[0]
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 88: ordinal not in range(128)

No meta data for MN908947, excluding from all further analysis.

1 sequences were dropped during filtering
0 of these were dropped because they were in results/to-exclude.txt
418 sequences have been written out to results/aligned-filtered.fasta
[Thu Dec 31 11:17:37 2020]
Finished job 23.
1 of 21 steps (5%) done
Shutting down, this might take some time.
Exiting because a job execution failed. Look above for error message
Complete log: /home/dan/Work/Computer/GitRepos/ncov/.snakemake/log/2020-12-31T111735.850250.snakemake.log

Unsure if this is related to the issue above, but I also get an error when running the following:
`(nextstrain) dan@PATH:~/Work/Computer/GitRepos/ncov$ nextstrain check-setup --set-default
nextstrain-cli is up to date!
Traceback (most recent call last):
File “/home/dan/.miniconda3/envs/nextstrain/bin/nextstrain”, line 8, in
sys.exit(main())
File “/home/dan/.miniconda3/envs/nextstrain/lib/python3.6/site-packages/nextstrain/cli/main.py”, line 10, in main
return cli.run( argv[1:] )
File “/home/dan/.miniconda3/envs/nextstrain/lib/python3.6/site-packages/nextstrain/cli/init.py”, line 35, in run
return opts.command.run(opts)
File “/home/dan/.miniconda3/envs/nextstrain/lib/python3.6/site-packages/nextstrain/cli/command/check_setup.py”, line 61, in run
print(“Testing your setup\u2026”)
UnicodeEncodeError: ‘ascii’ codec can’t encode character ‘\u2026’ in position 18: ordinal not in range(128)’

Hi @dbridges, welcome! This looks like a previously-identified issue where some of the ncov build code assumes a UTF-8 character encoding.

Could you try the suggestions there and report back?

Thanks @trs, had a look at the thread you mentioned and the fix suggested sorted out the issue. Great support - thanks so much!

1 Like