meta data for this page
  •  

This is an old revision of the document!


Conplex

Conplex is an internal software written in RUST for using shared conda environments. It utilizes a dedicated user account to provide read-only access to conda environments for commonly used tools. This reduces the time required to set up software especially for interns / teaching. Conplex acts as a wrapper for the actions and data described on the global conda page here.

Activating conplex

Run the following command: export PATH=/home/worker/bin:$PATH

Using conplex

Conplex can be invoked as a command and features subcommand for all major actions. You can check for availability using which:

(base) lucask@wks14:~$ which conplex
/home/lucask/bin/conplex

Invoking conplex will return the following output:

(base) lucask@wks14:~$ conplex
-------------------------------------------
   ______                  __         
  / ____/___  ____  ____  / /__  _  __
 / /   / __ \/ __ \/ __ \/ / _ \| |/_/
/ /___/ /_/ / / / / /_/ / /  __/>  <  
\____/\____/_/ /_/ .___/_/\___/_/|_|  
                /_/                       

----- Conda Multiplexer version 0.1.0 -----

Usage: conplex [OPTIONS] <COMMAND>

Commands:
  list        List all available conda environments
  load        Load a named conda environment
  check       Verify that this user's conda installation is compatible
  setup       Setup your conda installation for usage with conplex
  deactivate  Deactivate the currently loaded environment
  help        Print this message or the help of the given subcommand(s)

Options:
  -s, --silent   Don't print to cli. Verify success using exit code
  -h, --help     Print help
  -V, --version  Print version

The help flag can be specified for both conplex and its subcommand.

(base) lucask@wks14:~$ conplex load -h
Load a named conda environment

Usage: conplex load <NAME>

Arguments:
  <NAME>  Environment name

Options:
  -h, --help     Print help
  -V, --version  Print version

conplex check

Conplex requires a certain set of configurations of your personal conda installation to work properly. The conplex check command runs a checklist to verify your installation is ready to go and provides instructions if one of the checklist points fails.

When using conplex for the first time, it is expected to fail the checklist. You fist need to follow the installation steps under conplex setup.

(base) lucask@wks14:~$ conplex check
Last update of environment definitions: 03/08/2023 14:36:50
[✓] Your conda path is /home/lucask/miniconda3/bin/conda
[✓] .condarc file is present
[✓] Global environments are present in .condarc
[✓] Global environments are readable

conplex setup

The conplex setup command will modify your conda installation for usage with complex. Please not that this will alter your .condarc file.

(base) lucask@wks14:~$ conplex setup
Last update of environment definitions: 03/08/2023 14:36:50
Checking if conplex is already set up... → Your conda installation is not set up to use conplex
You can find information on setting up conplex here: http://core.izn-ffm.intern/wiki/doku.php?id=howto:globalconda
Conplex can perform the setup for you.
 If you have altered your .condarc file, this action is potentially destructive! Proceed? y/n
y
→ You don't have a .condarc file. Creating one for you...
→ conda config
→ Looking for new .condarc file
[✓] .condarc file is present
→ Loading .condarc as YAML
→ no entry for envs_dirs exists. This is perfect!
Dumping new config:
channels:
- conda-forge
- defaults
envs_dirs:
- /home/worker/envs/

→ Writing config...  Done!
→ Setup finished without issues
→ Verifying installation 
[✓] Your conda path is /home/lucask/miniconda3/bin/conda
[✓] .condarc file is present
[✓] Global environments are present in .condarc
[✓] Global environments are readable
You are ready to use conplex! Goodbye!

conplex list

The list command returns a list of all available conplex environments. This matches the environments described on Global conda environments page.

(base) lucask@wks14:~$ conplex list
Last update of environment definitions: 03/08/2023 14:36:50
Tool          |   Version  |   Status    |   Stable commands / Autostart                   |   
taxaminer     |   v.0.7.2  |   stable    |   taxaminer.run                                 |   
phyloprofile  |   3.17     |   stable    |   bash /home/worker/utility/runPhyloProfile.sh  |   
busco         |   -        |   unstable  |   busco                                         |   
samtools      |   1.17     |   stable    |   samtools and subcommands                      |

conplex load

Finally, conplex load allows you to reference one of the listed environments by name and returns a command to load it.

(base) lucask@wks14:~$ conplex load samtools
Last update of environment definitions: 03/08/2023 14:36:50
Looking for samtools... Found it!
[✓] Your conda path is /home/lucask/miniconda3/bin/conda
→ This shell is ready 
→ Please run  conda activate /home/worker/envs/samtools to activate.

Running in silent mode / Use in your pipeline

Specifying the silent flag will reduce the output of conplex or - where applies - discard it completely. Conplex provides exit codes accordingly. In case of conplex load it will still provide the command string. This implementation is used by VISUM to always obtain the most up to date path. You can check whether the environment was found using the the exit code.

Type Silent? Exit Code
Environment found yes 0
Environment found no 0
Environment not found yes 1
Environment not found no 0

If it was found, the conda command is forwarded to stdout.