WatsonLab / MAGpy

Snakemake pipeline for downstream analysis of metagenome-assembled genomes (MAGs) (pronounced mag-pie)
62 stars 23 forks source link

Sourcing directive bugfix and minor updates #20

Closed fmaguire closed 3 years ago

fmaguire commented 4 years ago

There was a bug caused by the .bashrc source directive at the start of the snakefile

On a clean Ubuntu 18.04 container envs were being activated for each rule but then seemingly deactivated when snakemake started to execute the shell component.

This caused the python2.7 reliant phylophlan and checkm test scripts to error.

For example, output from adding conda env list to the test_checkm rule shows the correct activation before the shell but the wrong activated environment (shown by asterisk) in the shell instance for the rule:

activating conda environment: /home/root/MAGpy/.snakemake/conda/377a289b
           /home/root/MAGpy/.snakemake/conda/377a289b
           /home/root/MAGpy/.snakemake/conda/8a832417
           base
        *  /root/miniconda3

I think the directive means snakemake (v5.11.2) was sourcing the .bashrc when starting the shell for each rule and resetting to the base environment before executing the rule script commands.

Without that directive the code everything seems to run fine for the tests and full pipeline when tested with snakemake version >5

Otherwise, it was a few trivial updates to documentation, and adding a command to set the checkm dataroot as it was waiting for input and hanging on the test_checkm rule.

yanhui09 commented 4 years ago

Cool. Just met the same problem about checkm as well. Your branch works smothly. Tak.