|
|
# How to build our Singularity container (analysis from raw data to reads quantification on genes)
|
|
|
# How to build our Singularity container (analysis from raw data to taxonomic affiliation of reads)
|
|
|
|
|
|
**Singularity installation**
|
|
|
```
|
|
|
sudo apt install -y singularity-container
|
|
|
```
|
|
|
|
|
|
Follow instructions on:
|
|
|
|
|
|
`https://github.com/sylabs/singularity/blob/master/INSTALL.md`
|
|
|
|
|
|
**Miniconda installation and configuration**
|
|
|
|
|
|
```
|
... | ... | @@ -12,45 +14,27 @@ bash Miniconda3-latest-Linux-x86_64.sh |
|
|
conda config --set auto_activate_base false
|
|
|
conda deactivate
|
|
|
conda config --add channels bioconda
|
|
|
conda config --add channels conda-forge ?
|
|
|
conda config --add channels conda-forge
|
|
|
```
|
|
|
|
|
|
**Create conda environment and export it in .yml file**
|
|
|
```
|
|
|
conda create -n env_pipeline_diamond_pandas -c conda-forge -c bioconda cutadapt sickle-trim bwa samtools bedtools spades megahit kaiju cd-hit krona subread fastqc prokka bcbio-gff multiqc diamond pandas
|
|
|
conda create -n env_metagWGS_december -c conda-forge -c bioconda cutadapt sickle-trim bwa samtools bedtools spades megahit kaiju cd-hit krona subread fastqc prokka bcbio-gff multiqc diamond pandas
|
|
|
|
|
|
conda activate env_pipeline_diamond_pandas
|
|
|
conda activate env_metagWGS_december
|
|
|
|
|
|
conda deactivate
|
|
|
|
|
|
conda env export -n env_pipeline_diamond_pandas > env_pipeline_diamond_pandas.yml
|
|
|
conda env export -n env_metagWGS_december > env_metagWGS_december.yml
|
|
|
```
|
|
|
`env_metagWGS_december.yml` has been modified (remove `prefix` line at the end, remove built of tools, change name of environment) and the .yml file used for built of Singularity image is [`metagWGS_dependancies.yml`](https://forgemia.inra.fr/genotoul-bioinfo/metagwgs/blob/dev/env/metagWGS_dependancies.yml).
|
|
|
|
|
|
**Create Singularity recipe**
|
|
|
|
|
|
In Singularity_recipe_env_pipeline_diamond_pandas file write:
|
|
|
|
|
|
```
|
|
|
Bootstrap: docker
|
|
|
From: continuumio/miniconda3
|
|
|
IncludeCmd: yes
|
|
|
|
|
|
%files
|
|
|
env_pipeline_diamond_pandas.yml /
|
|
|
|
|
|
%post
|
|
|
apt-get update && apt-get install -y procps && apt-get clean -y
|
|
|
/opt/conda/bin/conda env create -f /env_pipeline_diamond_pandas.yml && /opt/conda/bin/conda clean -a
|
|
|
|
|
|
%environment
|
|
|
export PATH=/opt/conda/envs/env_pipeline_diamond_pandas/bin:$PATH
|
|
|
|
|
|
%runscript
|
|
|
"$@"
|
|
|
```
|
|
|
Our Singularity recipe is available here: [`Singularity_recipe_metagWGS_dependancies`](https://forgemia.inra.fr/genotoul-bioinfo/metagwgs/blob/dev/env/Singularity_recipe_metagWGS_dependancies).
|
|
|
|
|
|
**Build Singularity container**
|
|
|
```
|
|
|
sudo singularity build Singularity_container_diamond_pandas.img Singularity_recipe_env_pipeline_diamond_pandas
|
|
|
sudo singularity build metagWGS_with_dependancies.img Singularity_recipe_metagWGS_dependancies
|
|
|
```
|
|
|
|