From 04e6e104074760758e8a538b6d1c20afc3d7214a Mon Sep 17 00:00:00 2001
From: nikos <n.pappas@uu.nl>
Date: Tue, 12 Jan 2021 11:04:00 +0100
Subject: [PATCH] added host taxon predictor

---
 resources/singularity/htp/README.md | 28 +++++++++++++++++++++
 resources/singularity/htp/htp.def   | 39 +++++++++++++++++++++++++++++
 2 files changed, 67 insertions(+)
 create mode 100644 resources/singularity/htp/README.md
 create mode 100644 resources/singularity/htp/htp.def

diff --git a/resources/singularity/htp/README.md b/resources/singularity/htp/README.md
new file mode 100644
index 0000000..0eb9613
--- /dev/null
+++ b/resources/singularity/htp/README.md
@@ -0,0 +1,28 @@
+# Host Taxon Predictor (HTP) 
+
+Available from `library://papanikos_182/default/htp:1.0.2`
+
+## Procedure
+
+1. Build the image with the definition file
+```
+$ sudo singularity build htp.sif htp.def
+```
+
+3. [Optional] Sign the image
+```
+$ singularity sign htp.sif
+```
+
+4. Push it on the cloud
+```
+$ singulairty push htp.sif library://papanikos_182/default/htp:1.0.2
+```
+
+## Usage
+
+```
+$ singularity run library://papanikos_182/default/htp:1.0.2 \
+  viruses_classifier -h
+```
+
diff --git a/resources/singularity/htp/htp.def b/resources/singularity/htp/htp.def
new file mode 100644
index 0000000..9d3b57d
--- /dev/null
+++ b/resources/singularity/htp/htp.def
@@ -0,0 +1,39 @@
+Bootstrap: docker
+From: continuumio/miniconda3 
+
+%labels
+	Author "Wojciech Gałan"
+	Maintainer papanikos_182
+    Version 1.0.2
+	Source https://github.com/wojciech-galan/viruses_classifier
+	Publication	https://www.nature.com/articles/s41598-019-39847-2
+
+%post
+	# Update OS
+    apt update && apt upgrade -y
+
+	# Install dependencies
+	conda config --add channels conda-forge
+	conda config --add channels default
+	conda config --add channels bioconda
+	conda config --add channels r
+	conda update -y conda	
+	
+	conda create -n htp python=2.7 scipy numpy scikit-learn pip
+
+	conda clean --all -y
+
+	echo ". /opt/conda/etc/profile.d/conda.sh" >> $SINGULARITY_ENVIRONMENT
+	echo "conda activate htp" >> $SINGULARITY_ENVIRONMENT
+
+	. /opt/conda/etc/profile.d/conda.sh
+	conda activate htp
+	pip install git+https://github.com/wojciech-galan/viruses_classifier.git
+	
+%help
+	A container for Host Taxon Predictor v0.1.2
+	[https://github.com/wojciech-galan/viruses_classifier].
+
+	To run htp help:
+
+	$ singularity exec library://papanikos_182/default/htp:1.0.2 viruses_classifier --help
-- 
GitLab