Error installing wmgx: biobakery_workflows_databases --install wmgx

Solution?
So I tried to trace back the issue.
Apparently, the problem lies within a python code called client.py which is part of the http package.
If installed through conda, it can be found in:
~/miniconda3/envs/$MY_ENV/lib/python3.7/http/client.py

Change line 271:

line = str(self.fp.readline(_MAXLINE + 1), "iso-8859-1")

to:

line = str(self.fp.readline(_MAXLINE + 1), "iso-8859-2")

For some reason, the header of the http response needs to be decoded using the iso-8859-2 encoding and not iso-8859-1. I have no idea why. I know it’s not related to biobakery_workflows, but I still thought it would be important to provide the solution as someone else might stumble upon the same problem I did.


I also had some problems with my locale which might be related.
For documentation purposes, I got the error:

  Name: humann_count_alignments_species
  Original error: 
  Error executing action 0. Original Exception: 
  Traceback (most recent call last):
    File "~/miniconda3/envs/$MY_ENV/lib/python3.7/site-packages/anadama2/runners.py", line 201, in _run_task_locally
      action_func(task)
    File "~/miniconda3/envs/$MY_ENV/lib/python3.7/site-packages/anadama2/helpers.py", line 89, in actually_sh
      ret = _sh(s, **kwargs)
    File "~/miniconda3/envs/$MY_ENV/lib/python3.7/site-packages/anadama2/util/__init__.py", line 320, in sh
      raise ShellException(proc.returncode, msg.format(cmd, ret[0], ret[1]))
  anadama2.util.ShellException: [Errno 1] Command `get_counts_from_humann_logs.py --input ~/output_data/humann/main --output /pita/users/hila/output_data/humann/counts/humann_read_and_species_count_table.tsv' failed. 
  Out: b''
  Err: b'Traceback (most recent call last):\n  File "~/miniconda3/envs/$MY_ENV/bin/get_counts_from_humann_logs.py", line 79, in <module>\n    main()\n  File "~/miniconda3/envs/$MY_ENV/bin/get_counts_from_humann_logs.py", line 59, in main\n    data[1]=int(line.split()[7][2:])\nValueError: invalid literal for int() with base 10: \'perl:\'\n'

I got this because biobakery_workflows uses perl. The output from perl, a log file, is assigned to the variable line. Location line.split()[7][2:] doesn’t indicate what you would like it to indicate if there are problems with the locale. As in, the script tries to:

…create a table of reads from humann log files. The table will have
total reads, unaligned after nucleotide search, and unaligned after translated search.
The table will also include the total species number.

So line.split()[7][2:] tries to get the total number of reads but if there are problems with the locale, perl might output some extra characters into the log file which are unexpected.

I eventually solved this problem, following:

It was hard solving that though, as I do not have sudo access.

I would suggest using regex instead in future updates.