mkandziora/PhylUp

example_analysis.py failure

Closed this issue · 1 comments

I personally find python errors very difficult to track down. Do you have any idea what is going on?

$ python3 example_analysis.py 
Workflow runs with 8 threads.
REMEMBER TO UPDATE THE NCBI DATABASES REGULARLY! Looks like you last updated it 3 days ago.
Run the file 'update_databases.py' from the data folder to automatically update. Note, that you are accessing a US government website to do so.
Translate input names to ncbi taxonomy...
Build table with information about sequences and taxa.
Initialize NODES and NAMES!!
Load sequences...
Begin update: 2021-04-08 16:21:16.862005.

Clean the input data: data/tiny_test_example/test.tre, data/tiny_test_example/test.fas.Format mrca: {18794} - SenecioBlast round number 0. Max. rounds set to 1.
Find new sequences using the BLAST database.
Blast 1 out of 5, subsample size is 1.
Warning: [blastn] Number of threads was reduced to 4 to match the number of available CPUs
Blast 2 out of 5, subsample size is 1.
Warning: [blastn] Number of threads was reduced to 4 to match the number of available CPUs
Blast 3 out of 5, subsample size is 1.
Warning: [blastn] Number of threads was reduced to 4 to match the number of available CPUs
Blast 4 out of 5, subsample size is 1.
Warning: [blastn] Number of threads was reduced to 4 to match the number of available CPUs
Blast 5 out of 5, subsample size is 1.
Warning: [blastn] Number of threads was reduced to 4 to match the number of available CPUs
Length of new seqs before filtering: 52
Traceback (most recent call last):
  File "example_analysis.py", line 17, in <module>
    test.run(status_end=1) # status ends limits the number of blast rounds
  File "/home/josephwb/Downloads/PhylUp/PhylUp/phyl_up.py", line 463, in run
    new_seqs = self.call_filter(new_seqs, self.aln)
  File "/home/josephwb/Downloads/PhylUp/PhylUp/phyl_up.py", line 303, in call_filter
    new_seqs = self.compare_filter(new_seqs)
  File "/home/josephwb/Downloads/PhylUp/PhylUp/phyl_up.py", line 341, in compare_filter
    f.filter(new_seqs, self.config.downtorank)
  File "/home/josephwb/Downloads/PhylUp/PhylUp/phyl_up.py", line 783, in filter
    if all_preferred.index == True:
ValueError: The truth value of an array with more than one element is ambiguous. Use a.any() or a.all()

Ha, yes. Pandas error. Thanks for the patch. In theory, both (any() and all()) should work, just from the logic any() is more appropriate here. Fix added.