faircloth-lab / phyluce

software for UCE (and general) phylogenomics
http://phyluce.readthedocs.org/
Other
78 stars 49 forks source link

Problem with phyluce_assembly_get_match_counts #262

Closed ratonvaquero closed 2 years ago

ratonvaquero commented 2 years ago

First of all, I apologize because I do not think this is a new issue. I believe it is the same problem described in issues #155, #174, and #191. All of these issues are closed; unfortunately, in none of them you can see how the problem was solved. I describe the problem again: I am running phyluce in a supported operative system (MacOs 10.15.7) and installed it using Miniconda3. I am using the Tetrapods-UCE-5Kv1.fasta probe set. When I ran "phyluce_assembly_match_contigs_to_probes" successfully, which produced the expected output. However, when I tried to extract the UCE loci with "phyluce_assembly_get_match_counts" I got the error message below:

(phyluce-1.7.1) Adrian:Phyluce adrianxxxxx$ phyluce_assembly_get_match_counts \

--locus-db uce-search-results/probe.matches.sqlite \ --taxon-list-config taxon-set.conf \ --taxon-group 'all' \ --incomplete-matrix \ --output taxon-sets/all/all-taxa-incomplete.conf 2021-12-07 20:27:12,185 - phyluce_assembly_get_match_counts - INFO - =========== Starting phyluce_assembly_get_match_counts ========== 2021-12-07 20:27:12,185 - phyluce_assembly_get_match_counts - INFO - Version: 1.7.1 2021-12-07 20:27:12,185 - phyluce_assembly_get_match_counts - INFO - Commit: None 2021-12-07 20:27:12,185 - phyluce_assembly_get_match_counts - INFO - Argument --extend_locus_db: None 2021-12-07 20:27:12,185 - phyluce_assembly_get_match_counts - INFO - Argument --incomplete_matrix: True 2021-12-07 20:27:12,185 - phyluce_assembly_get_match_counts - INFO - Argument --keep_counts: False 2021-12-07 20:27:12,185 - phyluce_assembly_get_match_counts - INFO - Argument --locus_db: /Users/adrianxxxxx/Dropbox/Proyectos/UCEs/Phyluce/uce-search-results/probe.matches.sqlite 2021-12-07 20:27:12,186 - phyluce_assembly_get_match_counts - INFO - Argument --log_path: None 2021-12-07 20:27:12,186 - phyluce_assembly_get_match_counts - INFO - Argument --optimize: False 2021-12-07 20:27:12,186 - phyluce_assembly_get_match_counts - INFO - Argument --output: /Users/adrianxxxxx/Dropbox/Proyectos/UCEs/Phyluce/taxon-sets/all/all-taxa-incomplete.conf 2021-12-07 20:27:12,186 - phyluce_assembly_get_match_counts - INFO - Argument --random: False 2021-12-07 20:27:12,186 - phyluce_assembly_get_match_counts - INFO - Argument --sample_size: 10 2021-12-07 20:27:12,186 - phyluce_assembly_get_match_counts - INFO - Argument --samples: 10 2021-12-07 20:27:12,186 - phyluce_assembly_get_match_counts - INFO - Argument --silent: False 2021-12-07 20:27:12,186 - phyluce_assembly_get_match_counts - INFO - Argument --taxon_group: all 2021-12-07 20:27:12,186 - phyluce_assembly_get_match_counts - INFO - Argument --taxon_list_config: /Users/adrianxxxxx/Dropbox/Proyectos/UCEs/Phyluce/taxon-set.conf 2021-12-07 20:27:12,186 - phyluce_assembly_get_match_counts - INFO - Argument --verbosity: INFO Traceback (most recent call last): File "/Users/adrianxxxxx/miniconda3/envs/phyluce-1.7.1/bin/phyluce_assembly_get_match_counts", line 360, in main() File "/Users/adrianxxxxx/miniconda3/envs/phyluce-1.7.1/bin/phyluce_assembly_get_match_counts", line 333, in main len(organisms), args.taxon_group, os.path.basename(args.taxon_list_config) TypeError: object of type 'NoneType' has no len()

I tried reinstalling Miniconda and phyluce, phyluce 1.7.0, and repeating the previous step (finding UCE loci) in case the *.lastz files and the probe.matches.sqlite files were not corrupted. But nothing worked. And, like I said, although it looks like this is a closed issue, I fail to see how it can be solved.

I would very much appreciate your help.

ratonvaquero commented 2 years ago

I meant in case the *lastz files and the probe.matches.sqlite files WERE corrupted. Sorry

brantfaircloth commented 2 years ago

This looks like a problem with your taxon-set.conf. Please post that file. Thx.

ratonvaquero commented 2 years ago

Thank you! This is how my taxon-set.conf file looks in Bbedit:

[all] MX31 MX35 MX37 MX40 MX65 MX121 MX122 MX124 MX127 MX129 MX130 MX131 MX136 MX140 MX145 MX146 MX223b MX232 MX235 MX236 MX237 MX239 MX241 MX242 MX243 MX253 MX254 MX255 MX326 MX341 MX344 MX353 MX358 MX435 MX436


These are all my samples (35)

brantfaircloth commented 2 years ago

The file looks ok. Are you sure that the path you are using to the file is correct, e.g.:

/Users/adrianxxxxx/Dropbox/Proyectos/UCEs/Phyluce/taxon-set.conf

So, can you see the file contents (and are they correct) when you run something like:

head -n 20 /Users/adrianxxxxx/Dropbox/Proyectos/UCEs/Phyluce/taxon-set.conf

The error you are seeing is basically saying that when phyluce goes to read the config file and the all group, it's not actually finding either the file or the all group within the file. Because it cannot find the file or the all group within the file, the code returns an empty result, and the empty result throws the error (I've not made this a little more clear in the code... but that update won't make it into a release for a while).

If the file path and the contents seem ok, I'll need your probe.matches.sqlite and taxon-set.conf files to run some additional checks to see if I can replicate the error (probably best to send a dropbox link to me by email).

ratonvaquero commented 2 years ago

You were absolutely right. The path to my "taxon-set.conf" file was correct. But when I ran "head -n 20 /Users/adrianxxxxx/Dropbox/Proyectos/UCEs/Phyluce/taxon-set.conf" I could not see any file contents. I re-labeled the file as "taxon-set.conf.txt" and then I was able to see the contents when I ran "head -n 20 /Users/adrianxxxxx/Dropbox/Proyectos/UCEs/Phyluce/taxon-set.conf".

So I just updated the file name in the commands below:

phyluce_assembly_get_match_counts \ --locus-db uce-search-results/probe.matches.sqlite \ --taxon-list-config taxon-set.conf.txt \ --taxon-group 'all' \ --incomplete-matrix \ --output taxon-sets/all/all-taxa-incomplete.conf

And it worked!

Thanks a lot Brant!!

brantfaircloth commented 2 years ago

you bet - glad you got it fixed 👍