Infer a network from count data within Snakemake using a sparse Poisson lognormal model (PLNnetwork)
This Snakemake workflow provides the means to fit a sparse Poisson lognormal model for sparse covariance inference for counts (aka PLNnetwork). This model is a subset of a nice collection of models bundled into the R package PLNmodels. The R version and package dependencies are contained within conda
environment for reproducibility.
The R commands are splitted as Snakemake rules to be able to start again on error and follow up the dependencies between the created files (such as RDS files for the models or bootstraps).
The organisation of this workflow was adapted from the template of snakemake workflows.
- Create a new github repository using this workflow as a template.
- Clone the newly created repository to your local system, into the place where you want to perform the data analysis.
Configure the workflow according to your needs via editing the config.yaml
file in the config/
folder. The default configuration runs with a toy dataset which is a subset of the example used in the R package PLNmodels.
Install Snakemake using conda:
conda create -c bioconda -c conda-forge -n snakemake snakemake
For installation details, see the instructions in the Snakemake documentation.
Activate the conda environment:
conda activate snakemake
Test your configuration by performing a dry-run via
snakemake --use-conda -n
Execute the workflow locally via
snakemake --use-conda --cores $N
If you have previously installed the dependencies (R
and PLNmodels
) for this workflow independently or using the following commands, the --use-conda
is not necessary:
conda create -n PLNmodels r-plnmodels
snakemake -n --cores $N
Snakemake has built-in capabilities of reporting the results of the workflow. To do so, you can execute the following line:
snakemake --report report.html