merenlab / anvio

An analysis and visualization platform for 'omics data
http://merenlab.org/software/anvio
GNU General Public License v3.0
426 stars 145 forks source link

One of the commits from 2/5 or 2/6 appears to break anvi-pan-genome #1349

Closed jaybake5 closed 4 years ago

jaybake5 commented 4 years ago

Hey guys, I'm new to the community, so if I'm not following protocol with my posts, let me know! I noticed this issue today so I figured I would report it.

anvi-self-test -v
Anvi'o version ...............................: esther (v6.1-master)
Profile DB version ...........................: 31
Contigs DB version ...........................: 14
Pan DB version ...............................: 13
Genome data storage version ..................: 6
Auxiliary data storage version ...............: 2
Structure DB version .........................: 1

Installed on Linux server using 'Following the active codebase' (wizard status!)

One of the commits from either 2/5/20 or 2/6/20 appears to make problems for anvi-pan-genome. Either running anvi-pan-genome on actual data or anti-self-test --suite pangenomics now causes an error each time anvi'o gets to the computing homogeneity step. The below error is from anvi-self-test --suite pangenomics:

* Gene clusters are initialized for all 121 gene clusters in the database.

[06 Feb 20 18:17:25 Computing gene cluster homogeneity indices] Initializing 1 threads...                                                                                         ETA: ∞:∞:∞
WARNING
==============================================================
Homogeneity indices computation for gene cluster GC_00000101 failed. This can
happen due to one of three reasons: (1) this gene cluster is named incorrectly,
does not exist in the database, or is formatted into the input dictionary
incorrectly, (2) there is an alignment mistake in the gene cluster, and not all
genes are aligned to be the same lenght; or (3) the homogeneity calculator was
initialized incorrectly. As you can see, this is a rare circumstance, and anvi'o
will set this gene cluster's homogeneity indices to `-1` so things can move on,
but we highly recommend you to take a look at your data to make sure you are
satisfied with your analysis.

Process Process-4:
Traceback (most recent call last):
  File "/usr/local/projdata/0718/projects/jon/conda_envs/github/anvio/anvio/dbops.py", line 1165, in homogeneity_worker
    funct_index, geo_index, combined_index = homogeneity_calculator.get_homogeneity_dicts(gene_cluster)
  File "/usr/local/projdata/0718/projects/jon/conda_envs/github/anvio/anvio/homogeneityindex.py", line 174, in get_homogeneity_dicts
    fun = self.compute_functional_index(cluster_sequences)
  File "/usr/local/projdata/0718/projects/jon/conda_envs/github/anvio/anvio/homogeneityindex.py", line 61, in compute_functional_index
    elif utils.is_amino_acid_functionally_conserved(amino_acid_residue_1,amino_acid_residue_2):
  File "/usr/local/projdata/0718/projects/jon/conda_envs/github/anvio/anvio/utils.py", line 1564, in is_amino_acid_functionally_conserved
    if amino_acid_residue_2 in conserved_group:
TypeError: argument of type 'NoneType' is not iterable

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/projdata/0718/projects/jon/conda_envs/envs/anvio-master/lib/python3.6/multiprocessing/process.py", line 258, in _bootstrap
    self.run()
  File "/usr/local/projdata/0718/projects/jon/conda_envs/envs/anvio-master/lib/python3.6/multiprocessing/process.py", line 93, in run
    self._target(*self._args, **self._kwargs)
  File "/usr/local/projdata/0718/projects/jon/conda_envs/github/anvio/anvio/dbops.py", line 1176, in homogeneity_worker
    combined_index[gene_cluster_name] = -1
UnboundLocalError: local variable 'combined_index' referenced before assignment

..and the program stalls here

You get the same issue when running anvi-pan-genome. Going back to before those commits via git checkout 6f99da878519fe9879fa8f190413949a62498231 restores proper completion of ansi-self-test --suite pangenomics

meren commented 4 years ago

Hi, @jaybake5, I could reproduce the error. Thank you very much. I will look into this ASAP.

Best,

meren commented 4 years ago

It should be fixed now. Thank you very much for your report!