snakemake config PATH ENVIRONMENT - snakemake

I try to write a workflow using snakemake, but do not know how to configure PATH environment for all rules in the configure file, and did not find relational questions. Anyone can give a help?

Have a look at this FAQ entry. However, please also consider to simply use Conda integration instead of manupulating PATH yourself.

Related

Where can read about available commands i can use as a script in my gitlab CI yml file?

Basically, i'm getting started with gitlab's continuous integration, but having a hard time looking for a guide or documentation that would help me write scripts for the file.
Where can i read about operators, conditionals and instructions i can use for this?
Thanks!
First of all read the Quick start
Here is everything about yml file: Configuration of your jobs with .gitlab-ci.yml
I can recommend to use CI lint which can validates your yml syntax. It can saves your time ;-)

How to get the conda environment path inside a rule?

On previous versions of Snakemake (tested on 3.9.1 using integration with bioconda --use-conda) I could just check for the md5 hash of the environment.yaml file and find the respective environment at: workdir/.snakemake/conda/md5
On version 4.3.0 the md5 hash of the file does not match the environment folder. Looking at the source code I found out that the full path of the environment file is included when calculating the md5 hash to avoid conda errors on hard-coded paths but I am not sure how to generate the correct hash.
Is there another easier way to get the environment path inside a rule? If not, how can I generate the correct md5 to finde the environment?
Currently, the only reasonable way is to check the log. The path is displayed when the environment is activated. However, it is a very good idea to provide a command line option to list all environments, something like snakemake --list-conda-envs. I will do that as soon as possible.
EDIT: I have implemented --list-conda-envs in the master branch. It will be in the next release.

How to get the working directory path?

I'm wondering how to manage paths in my Snakefiles. Say I have this configuration:
current_dir
current_dir/snakefiles
current_dir/configfiles
and I execute my workflows this way:
current_dir$ snakemake -s snakefiles/my_snakefile --configfile configfiles/my_config.yml
I know I can get the path to my Snakefile using the global variable workflow.snakefile, but I would like to get also:
the path to my configfile
the path where I'm executing my snakefile, e.g. current_dir
How to achieve this? Are there other global variables in Snakemake, that I'm not aware of?
Thank you
The working directory is set via Python. You can get it with os.getcwd(). Also please note that there is a canonical way to organize Snakemake workflows: http://snakemake.readthedocs.io/en/latest/project_info/faq.html#what-is-the-recommended-way-to-distribute-a-snakemake-workflow.
While you can of course use something else, following this scheme helps others to understand your workflow. There might of course be cases where this does not fit.

zc.buildout: Script Recipe With Access to Buildout Configuration

I want to write a script in a zc.buildout recipe, but the script needs to have access to buildout.cfg.
I know how to create a buildout recipe (which has access to its configuration) and how to create a buildout script, but I don't know how the script could read the config.
Is there a way that the script receive the configuration from buildout.cfg?
Or should it open the file by itself and parse the config?
In the last case, what is the best way to get the path? what's the best way to parse it?
Thanks in advance.

Changing multiple SSIS Packages in an Automated way

Background:
I have about 170 SSIS packages. A new requirement is that users from other workstations can run them from their command lines using dtexec.
Question:
To make this possible I'd like to set change the protection level to encrypt sensitive with password, and change the password in each package.
Is there a way to automate this?
It's not something I've tried personally, but you could potentially amend or add the property in the XML source of the packages using a global search and replace.
A much easier method is to use the built in package configuration functionality. Configure your package to look to load its configuration from a config file. Distribute the config file with the package(s). You'll have to decide on what technique to use for the package to find it's config file (this technique will be used on all dev workstations). I've typically used registry entry. You can also use system variables. From an execution stand point, you can pass in the name and location of the config file to dtexec.