# Error in rule colours: jobid 5

**URL:** <https://nextstrain.discourse.group/t/error-in-rule-colours-jobid-5/160>\
**Category:** Help and Getting Started\
**Created:** [October 14, 2020, 1:12pm UTC](https://nextstrain.discourse.group/t/error-in-rule-colours-jobid-5/160 "2020-10-14T13:12:03Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![llau](https://avatars.discourse-cdn.com/v4/letter/l/c5a1d2/32.png) [@llau](https://nextstrain.discourse.group/u/llau)\
**Post date:** [October 14, 2020, 1:12pm UTC](https://nextstrain.discourse.group/t/error-in-rule-colours-jobid-5/160/1 "2020-10-14T13:12:03Z")

</div>

Hi,

I’m currently getting started with the nanopore sequencing for covid strain testing at Sickkids DPLM. I’m use to Illumina WES/WGS sequencing so this is something totally different for me.

I ran the installation and setup on our HPC centos7 with no issues using my own installation of miniconda3.

Unfortunately, when trying to run the example step:  
snakemake --cores 1 --profile ./my\_profiles/getting\_started

I’m getting the following error:  
[Wed Oct 14 06:09:17 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   
for line in f.readlines():  
File “/hpf/largeprojects/pray/llau/programs/miniconda3/miniconda3\_2020/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 7071: ordinal not in range(128)  
[Wed Oct 14 06:09:18 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!)

```

The log file has the same error as above this:  
(nextstrain) [llau@qlogin11 logs]$ cat colors\_global.txt  
Traceback (most recent call last):  
File “scripts/assign-colors.py”, line 22, in   
for line in f.readlines():  
File “/hpf/largeprojects/pray/llau/programs/miniconda3/miniconda3\_2020/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 7071: ordinal not in range(128)

I’ve tried to add :  
with open(args.ordering, ‘r+’, encoding=‘utf-8’) as f:  
Unfortunately, that caused more errors downstream in the write out:  
f.write(trait\_name + “\t” + trait\_value + “\t” + color + “\n”)

Any help would be greatly appreciated! Thanks so much!  
Lynette

---

<div class="post-metadata">

**Author:** ![trs](https://yyz1.discourse-cdn.com/flex031/user_avatar/nextstrain.discourse.group/trs/32/5_2.png) [@trs](https://nextstrain.discourse.group/u/trs)\
**Post date:** [October 14, 2020, 6:42pm UTC](https://nextstrain.discourse.group/t/error-in-rule-colours-jobid-5/160/2 "2020-10-14T18:42:04Z")

</div>

Welcome, @llau! I believe the issue here is that your HPC system is using an ASCII (not UTF-8) locale (like `C`) but the _assign-colors.py_ script assumes a UTF-8 locale (like `en_CA.UTF-8`).

For troubleshooting purposes, can you run the `locale` command on your HPC system and paste the output here?

The long-term fix is to update the _assign-colors.py_ script to be explicit about its file encoding instead of assuming the locale’s encoding will be UTF-8. As a workaround in the meantime, however, you can try running `snakemake` after overriding the default locale to use a UTF-8 one. For example:

```auto
LC_ALL=en_CA.UTF-8 snakemake --cores 1 --profile ./my_profiles/getting_started

```

We fixed a [similar issue](https://github.com/nextstrain/augur/issues/559) in Augur itself earlier this year, but your problem seems to be within the ncov-specific _assign-colors.py_.

Let me know what `locale` says and if the workaround above works for you?

---

<div class="post-metadata">

**Author:** ![llau](https://avatars.discourse-cdn.com/v4/letter/l/c5a1d2/32.png) [@llau](https://nextstrain.discourse.group/u/llau)\
**Post date:** [October 14, 2020, 6:53pm UTC](https://nextstrain.discourse.group/t/error-in-rule-colours-jobid-5/160/3 "2020-10-14T18:53:45Z")

</div>

Hi trs! Thanks so much for your help!!!

(nextstrain) [llau@qlogin11 ~]$ locale

locale: Cannot set LC\_CTYPE to default locale: No such file or directory

locale: Cannot set LC\_MESSAGES to default locale: No such file or directory

locale: Cannot set LC\_ALL to default locale: No such file or directory

LANG=C.UTF-8

LC\_CTYPE=“C.UTF-8”

LC\_NUMERIC=“C.UTF-8”

LC\_TIME=“C.UTF-8”

LC\_COLLATE=“C.UTF-8”

LC\_MONETARY=“C.UTF-8”

LC\_MESSAGES=“C.UTF-8”

LC\_PAPER=“C.UTF-8”

LC\_NAME=“C.UTF-8”

LC\_ADDRESS=“C.UTF-8”

LC\_TELEPHONE=“C.UTF-8”

LC\_MEASUREMENT=“C.UTF-8”

LC\_IDENTIFICATION=“C.UTF-8”

LC\_ALL=  
(nextstrain) [llau@qlogin11 ~]$

I’m trying the workaround now!

---

<div class="post-metadata">

**Author:** ![trs](https://yyz1.discourse-cdn.com/flex031/user_avatar/nextstrain.discourse.group/trs/32/5_2.png) [@trs](https://nextstrain.discourse.group/u/trs)\
**Post date:** [October 14, 2020, 9:02pm UTC](https://nextstrain.discourse.group/t/error-in-rule-colours-jobid-5/160/4 "2020-10-14T21:02:56Z")

</div>

> [@llau](#):
>
> ```auto
> locale: Cannot set LC_CTYPE to default locale: No such file or directory
> locale: Cannot set LC_MESSAGES to default locale: No such file or directory
> locale: Cannot set LC_ALL to default locale: No such file or directory
> 
> ```

Ah, I think these warning messages from `locale` are telling. The `C.UTF-8` locale that’s set is a UTF-8 locale (so that’s good!), but it appears unsupported on your HPC system (so that’s bad!). It appears this means that something (Python or the system) ends up falling back to the basic `C` locale, which uses ASCII.

---

<div class="post-metadata">

**Author:** ![llau](https://avatars.discourse-cdn.com/v4/letter/l/c5a1d2/32.png) [@llau](https://nextstrain.discourse.group/u/llau)\
**Post date:** [October 15, 2020, 7:40pm UTC](https://nextstrain.discourse.group/t/error-in-rule-colours-jobid-5/160/5 "2020-10-15T19:40:16Z")

</div>

Thanks so much @trs!

Good to know - I have contacted our HPC admins to help as I’m beta testing there roll out of centos7.

I have included one of the samples sequenced here in the GSAID fasta and meta data file. Do you know how long approximate it will run for and how much RAM is needed? I used 4 cores but it got killed as it exceeded the 32Gb I requested after ~10hrs. I have tried again with 100Gb…

Thanks again for the help!

Lynette

---

<div class="post-metadata">

**Author:** ![trs](https://yyz1.discourse-cdn.com/flex031/user_avatar/nextstrain.discourse.group/trs/32/5_2.png) [@trs](https://nextstrain.discourse.group/u/trs)\
**Post date:** [November 9, 2020, 8:31pm UTC](https://nextstrain.discourse.group/t/error-in-rule-colours-jobid-5/160/6 "2020-11-09T20:31:51Z")

</div>

@llau I’d be curious to hear if you got this working or not. 🙂

Apologies for missing your question about the runtime and RAM. I don’t have a good handle on the current numbers for those, but we could probably dig up some metrics from our own recent runs if they’d still be helpful.

---

<div class="post-metadata">

**Author:** ![llau](https://avatars.discourse-cdn.com/v4/letter/l/c5a1d2/32.png) [@llau](https://nextstrain.discourse.group/u/llau)\
**Post date:** [November 9, 2020, 8:44pm UTC](https://nextstrain.discourse.group/t/error-in-rule-colours-jobid-5/160/7 "2020-11-09T20:44:24Z")

</div>

Hi @trs!

Yes! I did! Thanks so much! I managed to get it working and finished in ~10hrs using 64Gb and 4 threads! But this is using all the gsaid sequences with ours.

Thanks so much again!

---

<div class="post-metadata">

**Author:** ![trs](https://yyz1.discourse-cdn.com/flex031/user_avatar/nextstrain.discourse.group/trs/32/5_2.png) [@trs](https://nextstrain.discourse.group/u/trs)\
**Post date:** [November 9, 2020, 8:56pm UTC](https://nextstrain.discourse.group/t/error-in-rule-colours-jobid-5/160/8 "2020-11-09T20:56:03Z")

</div>

Awesome! Glad to hear it’s working!
