Difference between revisions of "Conda"

From wiki
Jump to: navigation, search
(Created page with "WIP for progressing to user-centric conda installs Dear Cosmika, We are testing Bioconda on Marvin on a per user basis, so you have total control over it. Would you please...")
 
 
(13 intermediate revisions by the same user not shown)
Line 1: Line 1:
WIP for progressing to user-centric conda installs
+
conda =
  
 +
'''This is the future'''
  
Dear Cosmika,
+
 
 +
Conda on Marvin on a per user basis, so you have total control over it. 
 +
Log in and from the command line type Only ever do this once or you will get error pessages):
 
   
 
   
We are testing Bioconda on Marvin on a per user basis, so you have total control over it. Would you please be our first actual user test? The default python in /usr/bin is python 2.6 which is too old. As a warning, running the following will update this to 2.7 and 3.7. So, only do so if you do not specifically require the python 2.6 version for your other work. Although, you could set up a conda environment with 2.6 if you really wanted. I can’t think of anything that requires 2.6.
+
install-bioconda
 
   
 
   
Log in and from the command line type:
+
Either log out  and back in, or type:
 +
source ~/.bashrc
 +
 
 +
This will make a user specific version of conda avaible to you.
 +
 
 +
'''To find the package you want, search here:'''
 +
'''
 +
https://bioconda.github.io/conda-recipe_index.html'''
 +
 
 +
'''or google search:''' - as there are multiple channels!!
 +
conda name_of_tool_you_want
 
   
 
   
install-bioconda
+
We strongly advise using environments: You can do this in many ways. Please see the link for more details (here you can specifiy exact version etc ..)
 +
https://conda.io/docs/user-guide/tasks/manage-environments.html
 +
 
 +
The easiest usage would be:    e.g. 
 
   
 
   
Either log out and back in or type:
+
  conda create -n NAME_OF_ENV PACKAGE_TO_INSTALL
source ~/.bashrc
+
 
 +
This is an example of a toold called roary
 
   
 
   
We strongly advise using environments: https://conda.io/docs/user-guide/tasks/manage-environments.html . You can do this in many ways. Please see the link for more details (here you can specifiy eact version etc ..). The easiest usage would be:   e.g.  conda create -n NAME_OF_ENV PACKAGE_TO_INSTALL
+
conda create -n roaryENV roary
 +
 
 +
once it has installed, you can activate the environment by typing:
 
   
 
   
conda create -n roary roary
+
conda activate roaryENV
 +
 
 +
As a lot of tools have dependencies, all the dependencies should be installed during this process. It is a good idea to keep them looked up in their own ENV, so they dont interfere with dependencies and spcific version required for other things you have installed.
 +
 
 +
To get the latest version
 
   
 
   
conda activate roary
+
  conda update roary
   
 
conda update roary
 
 
   
 
   
 
   
 
   
 
You are now ready to use this package.
 
You are now ready to use this package.
 
   
 
   
Conda deactivate        to leave this environment.
+
conda deactivate        to leave this environment.
 
   
 
   
 +
If you want to install a specific version of a tool (use the equals sign and the version you want):
 
   
 
   
This works for me and a test user. But may fail for you, so be patient with us.
+
conda create -n samtools1.3 samtools=1.3
 +
 
 +
or
 
   
 
   
To list all the environments you have created:
+
conda create -n python27 python=27
 +
 
 +
once you have this version of python installed, you can easily use (after you have activated the python env:
 +
pip install biopython  (or whatever you require)
 +
 
 +
'''conda and perl'''
 +
Firstly, perl is a pain to look after. The way the cluster has been historically set up, all perl versions and modules are different on all the nodes. The new cluster will not be like this. Therefore, we cannot install modules for every user on all the nodes. What we recommend is you having you own perl version using conda:
 +
conda create -n perlEnv perl
 +
 
 +
conda activate perlEnv
 +
 
 +
then install the modules you want
 +
 
 +
http://www.cpan.org/modules/INSTALL.html
 +
 
 +
cpan App::cpanminus
 
   
 
   
conda info –envs
+
cpanm Term::ReadKey
 +
 
 +
Bioperl is difficult to install. Fact. But someone has put this in coda. So lets use that:
 +
 
 +
conda create -n bioperlEnv perl-bioperl
 
   
 
   
installing packages: https://bioconda.github.io/recipes.html
 
 
   
 
   
Please let me know how you get on, and tell me of any errors.
+
To list all the environments you have created (you will forget the envs after a while, so name them well!!):
 
   
 
   
Regards,
+
conda info –envs
 +
 
 +
To list all the dependencies you have within an env
 
   
 
   
Peter Thorpe
+
conda list -n ''envname''
 +
 
 +
For example, trinity comes with jellyfish, which can be difficult to install. Therefore some of these tools are a treasure chest of cools tools, which can save many hours and kg of pain in installation process. 
 +
 
 +
To install multiple tools in one env:
 +
conda create -n python36_bioperl python=3.6 perl-bioperl mummer scipy numpy biopython matplotlib
 +
 
 +
You can activate multiple conda envs, they have preference as the latest is used first in you path:
 +
conda activate trinityenv
 +
conda activate python27
 +
conda activate python36
 +
in this example, a simple python command will use the python3 version as this was the last to be activated, if you want python 2. You have to specifiy python2. The perl will be the one in the monster python36 env i created. But jelly fish will be from the trinity env. Make sense?
 +
 
 +
ENJOY!!!
 +
 
 +
 
 +
installing packages: https://bioconda.github.io/conda-recipe_index.html
 +
 
 +
 
 +
'''conda and samtools problems'''
 +
 
 +
Bascially sometimes this get installed from the wrong channel. This may happen with other tools. We havent come across this yet.
 +
 
 +
The problem will look like this if you try to use samtools:
 +
samtools: error while loading shared libraries: libcrypto.so.1.0.0: cannot open shared object file: No such file or directory).
 +
 
 +
The solution:
 +
install from the bioconda channel: -c bioconda
 +
conda install -c bioconda samtools
 +
 
 +
or specifically the problem was found with unicycler:
 +
remove the old unicycler failed install:
 +
conda remove --name unicyclerENV --all
 +
 
 +
remake this env from the bioconda channel:
 +
conda create -n unicyclerENV -c bioconda unicycler
 +
 
 +
 
 +
to update the base conda, if required
 +
 
 +
conda update -n base conda
 +
 
 +
 
 +
'''conda hanging on solving environment'''
 +
 
 +
Can you try this please, then try re installing the beastie package.
 +
 +
conda config --remove channels conda-forge
 +
conda config --add channels conda-forge
 +
 
 +
if this still doesnt work try:
 +
conda config --set channel_priority strict
 +
 
 +
 
 +
More samtools problems, try:
 +
https://github.com/bioconda/bioconda-recipes/issues/12100
 +
samtools: error while loading shared libraries: libcrypto.so.1.0.0: cannot open shared object file: No such file or directory
 +
conda install -c bioconda samtools openssl=1.0

Latest revision as of 08:56, 28 July 2020

conda

This is the future


Conda on Marvin on a per user basis, so you have total control over it. Log in and from the command line type Only ever do this once or you will get error pessages):

install-bioconda

Either log out and back in, or type:

source ~/.bashrc

This will make a user specific version of conda avaible to you.

To find the package you want, search here:

https://bioconda.github.io/conda-recipe_index.html

or google search: - as there are multiple channels!!

conda name_of_tool_you_want

We strongly advise using environments: You can do this in many ways. Please see the link for more details (here you can specifiy exact version etc ..)

https://conda.io/docs/user-guide/tasks/manage-environments.html 

The easiest usage would be: e.g.

conda create -n NAME_OF_ENV PACKAGE_TO_INSTALL

This is an example of a toold called roary

conda create -n roaryENV roary

once it has installed, you can activate the environment by typing:

conda activate roaryENV

As a lot of tools have dependencies, all the dependencies should be installed during this process. It is a good idea to keep them looked up in their own ENV, so they dont interfere with dependencies and spcific version required for other things you have installed.

To get the latest version

conda update roary


You are now ready to use this package.

conda deactivate        to leave this environment.

If you want to install a specific version of a tool (use the equals sign and the version you want):

conda create -n samtools1.3 samtools=1.3

or

conda create -n python27 python=27

once you have this version of python installed, you can easily use (after you have activated the python env:

pip install biopython   (or whatever you require)

conda and perl Firstly, perl is a pain to look after. The way the cluster has been historically set up, all perl versions and modules are different on all the nodes. The new cluster will not be like this. Therefore, we cannot install modules for every user on all the nodes. What we recommend is you having you own perl version using conda:

conda create -n perlEnv perl
conda activate perlEnv

then install the modules you want

http://www.cpan.org/modules/INSTALL.html
cpan App::cpanminus

cpanm Term::ReadKey

Bioperl is difficult to install. Fact. But someone has put this in coda. So lets use that:

conda create -n bioperlEnv perl-bioperl


To list all the environments you have created (you will forget the envs after a while, so name them well!!):

conda info –envs

To list all the dependencies you have within an env

conda list -n envname

For example, trinity comes with jellyfish, which can be difficult to install. Therefore some of these tools are a treasure chest of cools tools, which can save many hours and kg of pain in installation process.

To install multiple tools in one env:

conda create -n python36_bioperl python=3.6 perl-bioperl mummer scipy numpy biopython matplotlib

You can activate multiple conda envs, they have preference as the latest is used first in you path:

conda activate trinityenv
conda activate python27
conda activate python36

in this example, a simple python command will use the python3 version as this was the last to be activated, if you want python 2. You have to specifiy python2. The perl will be the one in the monster python36 env i created. But jelly fish will be from the trinity env. Make sense?

ENJOY!!!


installing packages: https://bioconda.github.io/conda-recipe_index.html


conda and samtools problems

Bascially sometimes this get installed from the wrong channel. This may happen with other tools. We havent come across this yet.

The problem will look like this if you try to use samtools:

samtools: error while loading shared libraries: libcrypto.so.1.0.0: cannot open shared object file: No such file or directory).

The solution:

install from the bioconda channel: -c bioconda 
conda install -c bioconda samtools

or specifically the problem was found with unicycler: remove the old unicycler failed install:

conda remove --name unicyclerENV --all 

remake this env from the bioconda channel:

conda create -n unicyclerENV -c bioconda unicycler


to update the base conda, if required

conda update -n base conda


conda hanging on solving environment

Can you try this please, then try re installing the beastie package.

conda config --remove channels conda-forge
conda config --add channels conda-forge

if this still doesnt work try:

conda config --set channel_priority strict


More samtools problems, try: https://github.com/bioconda/bioconda-recipes/issues/12100 samtools: error while loading shared libraries: libcrypto.so.1.0.0: cannot open shared object file: No such file or directory

conda install -c bioconda samtools openssl=1.0