run_pipeline.def 4.41 KB
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
Bootstrap:docker
From:debian:buster-slim
Stage: build-haskell

%post
	apt-get update -y
	apt-get install -y curl libtinfo-dev
	mkdir -p /root/.local/bin
	export PATH="/root/.local/bin:${PATH}"
	export PATH="/usr/local/bin:${PATH}"
	curl -sSL https://get.haskellstack.org/ | sh
	stack upgrade
	mkdir -p /usr/local/src
	cd /usr/local/src
	# Getting the workflows
	cd /usr/local/src
	git clone https://gitlab+deploy-token-75:sakyTxfe-PxPHDwqsoGm@gitlab.pasteur.fr/bli/bioinfo_utils.git
	cd bioinfo_utils
	git submodule update --init --remote --merge
	# Note that currently only remove-duplicates-from-sorted-fastq
	# and trim-t-tail-from-fastq are copied to the next stage
	has_haskell_install=$(find . -name install.sh -print | xargs dirname | grep "Haskell")
	for dir in ${has_haskell_install}
	do
25
	    (cd ${dir} && grep "local" install.sh && ./install.sh)
26
27
28
29
30
31
32
33
34
35
36
	done

Bootstrap:docker
From:python:3.7-buster

%files from build-haskell
	/usr/local/bin/remove-duplicates-from-sorted-fastq
	/usr/local/bin/trim-t-tail-from-fastq

%post
	apt-get -y update
37
38
	# Useful for interactive work using the container
	apt-get -y install vim
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
	# run_pipeline.sh (and maybe other tools) needs bc
	apt-get -y install bc rsync
	apt-get -y install bedops bedtools bowtie2 cutadapt subread hisat2 parallel samtools
	# Some programs are not provided by debian
	# mkdir -p /usr/local/src
	#####################
	# Installing bioawk #
	#####################
	cd /usr/local/src
	git clone https://github.com/lh3/bioawk.git
	cd bioawk
	apt install -y byacc
	make
	ln -s /usr/local/src/bioawk/bioawk /usr/local/bin/.
	##########################
	# Installing fastq-tools #
	##########################
	cd /usr/local/src
	wget --continue http://homes.cs.washington.edu/~dcjones/fastq-tools/fastq-tools-0.8.tar.gz
	tar -xzf fastq-tools-0.8.tar.gz
	cd fastq-tools-0.8
	./configure
	make
	make install
	#########################
	# Installing kent utils #
	#########################
	cd /usr/local/src
	#mkdir UCSC-tools
	#cd UCSC-tools
	rsync -azvP rsync://hgdownload.soe.ucsc.edu/genome/admin/exe/linux.x86_64/bedGraphToBigWig /usr/local/bin/.
	# It is possible to test whether the R install is already OK
	deb_source="deb http://cran.irsn.fr/bin/linux/debian buster-cran35/"
	echo ${deb_source} >> /etc/apt/sources.list.d/cran.list
	apt-key adv --keyserver keys.gnupg.net --recv-key 'E19F5F87128899B192B1A2C2AD5F960A256A04AF'
	apt-get -y update
	apt-get -y install r-base-core r-base-dev
	R -e 'install.packages("BiocManager")'
	R -e 'BiocManager::install(ask=FALSE)'
	R -e 'BiocManager::install(c("docopt", "DESeq2"), ask=FALSE)'

	# To use the "local" python, not the system one.
	export PATH="/usr/local/bin":$PATH
	# To avoid using python things installed in the HOME of root
	# (that will be mounted during singularity build)
	export PYTHONNOUSERSITE=1
85
86
87
	python3.7 -m pip install --upgrade pip
	# Needs to install before custom pybedtools
	# python3.7 -m pip install pysam
Blaise Li's avatar
Blaise Li committed
88
89
	# To get scipy properly built as requirement:
	python3.7 -m pip install pybind11
90
91
92
93
94
95
96
97
	# Needed to manually cythonize custom pybedtools before installing it
	#/usr/bin/env python3 -m pip install Cython
	#/usr/bin/env python3 -m pip install --global-option="cythonize" git+https://github.com/blaiseli/pybedtools.git@fix_missing_headers
	# Getting the workflows
	cd /usr/local/src
	#git clone --recurse-submodules https://gitlab+deploy-token-75:sakyTxfe-PxPHDwqsoGm@gitlab.pasteur.fr/bli/bioinfo_utils.git
	git clone https://gitlab+deploy-token-75:sakyTxfe-PxPHDwqsoGm@gitlab.pasteur.fr/bli/bioinfo_utils.git
	cd bioinfo_utils
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
	pip install -r requirements.txt
	#git submodule update --init --remote --merge
	#has_requirements=$(find . -name requirements.txt -print | xargs dirname)
	## Needed for scipy (https://stackoverflow.com/a/58534155/1878788)
	## No, does not solve the issue...
	## apt install -y gfortran
	#for dir in ${has_requirements}
	#do
	#    (cd ${dir} && pip install -r requirements.txt)
	#done
	#has_install=$(find . -name install.sh -print | xargs dirname | grep -v "Nim" | grep -v "Haskell")
	#for dir in ${has_install}
	#do
	#    (cd ${dir} && ./install.sh)
	#done
113
114
115
116
117
118
119
120
121
122
123
124
125
126

%environment
	export LC_ALL=C
	# To use the "local" python, not the system one.
	export PATH="/usr/local/bin":$PATH
	# To avoid using python things installed in the HOME of the user
	# (that will be mounted during container execution)
	export PYTHONNOUSERSITE=1
	export PATH=/usr/local/src/bioinfo_utils:"${PATH}"

%runscript
	cmd="${1}"
	shift
	exec /usr/local/src/bioinfo_utils/${cmd} "$@"