shiver
shiver copied to clipboard
Issue with Initialization using ExampleInput
Hi,
I have been having trouble with using the code and trying to get it to run with python 3.10.0. I initially installed just python 3.10 but encountered errors saying that py2 was needed. I then installed python 2.7 and tried to run initialization again but have now encountered this error:
Traceback (most recent call last): File "/home/kkolsun/shiver/tools/RemoveBlankColumns.py", line 15, in <module> from Bio import AlignIO ImportError: No module named Bio Problem removing pure-gap columns from HIV1_ALL_2020_genome_DNA.fasta. Quitting.
I have tried a few online solutions but with no success. If there is a way to fix this I would love guidance as I really want to try to use this pipeline but am having a tough time getting it to actually run.
Hi Kurtman, indeed shiver requires Python2, not Python3. Within your Python2 installation, certain modules are required including Biopython. If you have multiple Python2 installations on your machine, the one shiver will use is the one that's started if you were to run from the command line the value of the python2
variable in the shiver config.sh
file. By default the value of that variable is 'python2'
; running that for me starts Python 2.7.15 but this will vary from machine to machine. For now I'll assume you've left it at its default value; if not, where I write python2
in what follows, replace this by whatever you've used at that point in the config file. Try running python2
from a command line and then running import Bio
: probably you will get ImportError: No module named Bio
, like the error message you've already seen. To solve that you would need to install Biopython in the Python2 installation shiver is using. shiver's installation instructions https://github.com/ChrisHIV/shiver/blob/master/info/InstallationNotes.sh say to run
sudo pip install biopython
but I think if you run
sudo python2 -m pip install biopython
instead that should be more reliable at getting biopython into your desired python2 installation.
I was able to get shiver working on python 2.7. You need to download and install the last version (1.76) of Biopython that works with 2.7 from here: https://biopython.org/wiki/Download
I then compiled this, making sure to use python2.7 in the commands:
python2.7 setup.py build
sudo python2.7 setup.py install
I can execute the shiver .sh scripts without throwing a biopython error. Dont forget to amend config.sh
to include python2.7
. Hope this helps!
Thank you both for the help! I truly appreciate the fast responses.
I was able to download biopython version 1.76 through miniconda into an environment that is running python 2.7.18 with your suggestions. This allowed me to generate the initialization directory. However, I am trying to use iva for assembly but can't due to it requiring python3. Is there a work-around for this or is it needed at all? Looking at the shiver manual it is asking for contigs but am not sure what I can use to generate them without using iva.
I've not previously had a problem running both python2 and python3 on the same machine, though I'm far from an expert on conda and having different environments etc. An alternative to IVA which my colleagues use for generating contigs from Illumina data for viruses is SPADES. Looks like it lives here https://github.com/ablab/spades