Kneaddata_build_database error

Hi,
when i run the fllow command,
kneaddata_build_database Homo_sapiens.GRCh38.dna.primary_assembly.fa -o hum
an_genome
it report an error showing on the fig

Hello, Thank you for the detailed post and sorry for the confusing error message. It looks like the kneaddata build database script is not currently python3 compatible. We will make those changes on our end and include them in the next release. Until then would you run the script with python 2? I think this should resolve the errors that you are seeing.

Thank you,
Lauren

1 Like

Hello, I ran into the same issue. I tried to use a python2 environment by source activate py2, but the problem persisted:

Exception in thread makeblastdb:
Traceback (most recent call last):
  File "/home/hfan/build/anaconda3/lib/python3.7/threading.py", line 917, in _bootstrap_inner
    self.run()
  File "/home/hfan/build/anaconda3/lib/python3.7/site-packages/kneaddata/generate_db.py", line 54, in run
    f.write(output)
TypeError: write() argument must be str, not bytes

^CTraceback (most recent call last):
  File "/home/hfan/build/anaconda3/bin/kneaddata_build_database", line 10, in <module>
    sys.exit(main())
  File "/home/hfan/build/anaconda3/lib/python3.7/site-packages/kneaddata/generate_db.py", line 189, in main
    t.join()
  File "/home/hfan/build/anaconda3/lib/python3.7/threading.py", line 1032, in join
    self._wait_for_tstate_lock()
  File "/home/hfan/build/anaconda3/lib/python3.7/threading.py", line 1048, in _wait_for_tstate_lock
    elif lock.acquire(block, timeout):
KeyboardInterrupt
Exception in thread srprism:
Traceback (most recent call last):
  File "/home/hfan/build/anaconda3/lib/python3.7/threading.py", line 917, in _bootstrap_inner
    self.run()
  File "/home/hfan/build/anaconda3/lib/python3.7/site-packages/kneaddata/generate_db.py", line 54, in run
    f.write(output)
TypeError: write() argument must be str, not bytes

Is it something wrong with my installation of kneaddata? Should have I installed it in an python2 environment to begin with?

I also tried the biobakery3 environment and it did not work either with the same error message.

Any help is appreciated.

Hello, Thank you for the detailed post and sorry for any confusion. The kneaddata_db utility script is not python 3 compatible in the latest release. We have made the changes and it will be python 3 compatible in the next release. If you would run that utility script with python 2 it should resolve the errors you are seeing.

Thank you,
Lauren