iTaxoTools / DecontaminatorGui

Qt Gui for Decontaminator
GNU General Public License v3.0
0 stars 0 forks source link

Problem running brach length decontamination #12

Open mvences opened 1 year ago

mvences commented 1 year ago

I am copying here an issue that Ariel Rodriguez had some months ago, unfortunately he wrote it to me in Spanish only but I am just pasting it here to make sure it is not forgotten. Once work on decontaminator starts again, we can look into this together:

He tratado de correr la version 2.0 del script decontaminator-branches.py usando la opción “-factor” pero me da este error:

python3 decontamination_branches.py --dir . /ingroup_alignments/longbranch_removal/gene_trees --thresh 0.2 --mode "factor" > decontamination_branches.log

Traceback (most recent call last):

File "decontamination_branches.py", line 17, in

import Utils

File ". /Utils.py", line 147, in

def get_sister_nodes(tree: dendropy.Tree) -> list[list[str,str]]:

TypeError: 'type' object is not subscriptable

Me imagino que lo que esta pasando es que el script esta teniendo problemas porque los árboles, además de los taxa, contienen la info de los largos de ramas. Creo que la línea �[list[str,str]] da problemas porque en los árboles la información de los taxa hermanos esta representada como “ (taxon1:0.015, taxon2:0.016)”.

No soy experto en Python, pero creo que esa es la causa del error.

StefanPatman commented 12 months ago

At first glance, it looks like Rodriguez tried running the script using Python 3.8 or lower. It requires Python 3.9 or greater, which is the version that added support for type annotations using built-in primitives. This was noted in the package requirements of the Decontaminator repository by David.

To run the same command in a Python >3.9 environment:

pip install git+https://github.com/iTaxoTools/Decontaminator.git
decontamination_branches --dir . /ingroup_alignments/longbranch_removal/gene_trees --thresh 0.2 --mode "factor" > decontamination_branches.log

Notice that the script is called from the endpoint, not as an argument to python3.