Structure harvester - AttributeError

162 views
Skip to first unread message

Samuel Lam

unread,
Feb 17, 2024, 12:01:32 PMFeb 17
to structure-software
Dear all,

I have been trying to run the structureharvester.py with the command:

python3 structureHarvester.py --dir=./ --out=./output --evanno --clumpp

where the current working directory contains:
_k10_run10_f
_k10_run1_f
_k10_run2_f
_k10_run3_f
_k10_run4_f
_k10_run5_f
_k10_run6_f
_k10_run7_f
_k10_run8_f
_k10_run9_f
_k11_run10_f
_k11_run1_f
_k11_run2_f
_k11_run3_f
_k11_run4_f
_k11_run5_f
_k11_run6_f
_k11_run7_f
_k11_run8_f
_k11_run9_f
_k1_run10_f
....

However, structure harvester returned the error as below:
  File "structureHarvester.py", line 542, in <module>
    main()
  File "structureHarvester.py", line 535, in main
    harvestFiles(data, options)
  File "structureHarvester.py", line 203, in harvestFiles
    data.sortedKs.sort()
AttributeError: 'dict_keys' object has no attribute 'sort'

Anyone has any idea on the cause of this error?

Cheer,
Sam

Vikram Chhatre

unread,
Feb 18, 2024, 7:08:37 PMFeb 18
to structure...@googlegroups.com
A quick search suggests that Python 3.x may have dropped support for the sort() function. I am copying the author here in case he can provide suggestions.

V

--
You received this message because you are subscribed to the Google Groups "structure-software" group.
To unsubscribe from this group and stop receiving emails from it, send an email to structure-softw...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/structure-software/691f3087-f07c-49f6-8948-ee599f4f2f39n%40googlegroups.com.

Dent Earl

unread,
Feb 20, 2024, 8:08:56 AMFeb 20
to Vikram Chhatre, structure...@googlegroups.com
Thanks for the re-direct Vikram!

Hey Sam, looking at the error message you've posted I wonder if you have an older version of the harvester that you've downloaded? I recall having to resolve a few of these python3 gotchas a couple of years ago. The current version (available here: https://github.com/dentearl/structureHarvester) makes use of the python3 sorted() function instead of calling the python2 dictionary .sort() method.

HTHs!

d
Reply all
Reply to author
Forward
0 new messages