Open prototaxites opened 1 year ago
Hey, thanks for bringing this to my attention. Are you by any chance using python>=3.11? Python 3.11 removed the automatic conversion of sets to lists as population of random samples and there is one instance of CAMISIM using the keys of a dict for random sampling. For compatibility with Python 3.11 there are two changes which need to be performed for CAMISIM to run:
scripts/configparserwrapper.py
line 5: from collections import Iterable
needs to be changed to from collections.abc import Iterable
(since CAMISIM does not run without that change I assume you already did this?)scripts/StrainSelector/strainselector.py
line 253: for otu_id in random.sample(self._otu_list.keys(), len(self._otu_list)):
to for otu_id in random.sample(list(self._otu_list.keys()), len(self._otu_list)):
making the conversion explicit.After this, CAMISIM runs on my end. I have not pushed these changes since I want to check that it keeps everything else intact and to ensure backward compatibility, but it should let you run CAMISIM. If you are not using Python 3.11 then I am sorry and will have to check things again, in the meantime I changed the title so other people using it can find the solution in this Issue.
Hey, thanks for the very quick reply! Yes, I was using Python 3.11 (though I'm currently spinning up a 3.9 conda environment). I did figure out the first change but not the second - I'll see how I get on with the 3.9 environment in the first instance, but if that fails I'll give the above a go.
Hi, Python 3.9 did the trick! For anyone else stumbling across this, the following conda environment works to run Camisim quite happily:
conda create -n camisim python=3.9 perl matplotlib-base numpy biopython biom-format scikit-learn configparser ete3 perl-xml-simple
Glad that it works, we tested CAMISIM mainly on Python 3.7. I hope that most of these environment and version problems will be solved once we move to CAMISIM2.0 (coming soon™)
Trying to run CAMISIM to generate a very small test metagenome data set with a mixture of eukaryotic and prokaryotic genomes to test a pipeline with, following the example in the usage guide. I am getting the following error:
Any idea what's going on and how to fix it?
metadata.tsv:
genome_to_id.tsv