gbouras13/phold

ValueError: Columns must be same length as key

Closed this issue · 7 comments

  • phold version: latest version
  • Python version: 3.10.14
  • Operating System: Linux

Description

Hi,

I was trying to run phold with a fasta file and a gbk file produced by pharokka and I got the following error for both file types.

What I Did

Paste the command(s) you ran and the output.
-   phold run -i kadir/wipo25_contig12.fasta -o phold_run_wipo25_contig12 -t 30
-   phold run -i kadir/pharokka_wipo25_contig12/pharokka.gbk -o phold_run_pharokka_gbk -t 32

If there was a crash, please include the traceback here.
Traceback (most recent call last):
  File "/Users/yanack/anaconda3/envs/mamba/envs/phold/bin/phold", line 10, in <module>
    sys.exit(main())
  File "/Users/yanack/anaconda3/envs/mamba/envs/phold/lib/python3.10/site-packages/phold/__init__.py", line 1355, in main
    main_cli()
  File "/Users/yanack/anaconda3/envs/mamba/envs/phold/lib/python3.10/site-packages/click/core.py", line 1157, in __call__
    return self.main(*args, **kwargs)
  File "/Users/yanack/anaconda3/envs/mamba/envs/phold/lib/python3.10/site-packages/click/core.py", line 1078, in main
    rv = self.invoke(ctx)
  File "/Users/yanack/anaconda3/envs/mamba/envs/phold/lib/python3.10/site-packages/click/core.py", line 1688, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/Users/yanack/anaconda3/envs/mamba/envs/phold/lib/python3.10/site-packages/click/core.py", line 1434, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/Users/yanack/anaconda3/envs/mamba/envs/phold/lib/python3.10/site-packages/click/core.py", line 783, in invoke
    return __callback(*args, **kwargs)
  File "/Users/yanack/anaconda3/envs/mamba/envs/phold/lib/python3.10/site-packages/click/decorators.py", line 33, in new_func
    return f(get_current_context(), *args, **kwargs)
  File "/Users/yanack/anaconda3/envs/mamba/envs/phold/lib/python3.10/site-packages/phold/__init__.py", line 298, in run
    subcommand_compare(
  File "/Users/yanack/anaconda3/envs/mamba/envs/phold/lib/python3.10/site-packages/phold/subcommands/compare.py", line 372, in subcommand_compare
    filtered_topfunctions_df, weighted_bitscore_df = get_topfunctions(
  File "/Users/yanack/anaconda3/envs/mamba/envs/phold/lib/python3.10/site-packages/phold/results/topfunction.py", line 58, in get_topfunctions
    foldseek_df[["contig_id", "cds_id"]] = foldseek_df["query"].str.split(
  File "/Users/yanack/anaconda3/envs/mamba/envs/phold/lib/python3.10/site-packages/pandas/core/frame.py", line 4299, in __setitem__
    self._setitem_array(key, value)
  File "/Users/yanack/anaconda3/envs/mamba/envs/phold/lib/python3.10/site-packages/pandas/core/frame.py", line 4341, in _setitem_array
    check_key_length(self.columns, key, value)
  File "/Users/yanack/anaconda3/envs/mamba/envs/phold/lib/python3.10/site-packages/pandas/core/indexers/utils.py", line 390, in check_key_length
    raise ValueError("Columns must be same length as key")
ValueError: Columns must be same length as key

Thanks,
KY

Hi @kayanac ,

This is interesting. It suggests that your phage proteins have no Foldseek hits at all.

Is this phage contig very small with few genes?

Regardless, thanks for raising this error - I'll make a fix in the next update.

George

Hi George,

It is a complete phage genome (length 71 kb) according to checkV. I detected lots of viral genes with pharokka, vibrant and dramv. I just wanted to further confirm and improve my results with phold. Please let me know when you fix it.

Thanks,

Ky

Hi @kayanac ,

That is interesting - almost certainly then the error is something else.

Would you be able to share the phage (or pharokka genbank output) with me so I can reproduce the error?

George

Hi George,

Sorry for my late response. Please see attached both files. I changed the extension of both files to .txt to be able to attach them .
wipo25_contig12.txt
pharokka.txt

Hi @kayanac ,

I was able to run phold v0.1.4 without any issue (I've uploaded a .zip output for the output)

Maybe you're using an older version?

George

kayanc_pharok.zip

Thank you! I am also using v0.1.4.

Ky

No problem @kayanac,

I will close this now - I'm not sure what your error is but I can't reproduce it. If you run into the same error again in future, please reopen this issue.

George