workflows_base.def 5.08 KB
Newer Older
Blaise Li's avatar
Blaise Li committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
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
19
	HASKELL_TOOLS_VERSION=$(git log | head -1 | cut -d " " -f2)
Blaise Li's avatar
Blaise Li committed
20
21
22
23
24
25
26
27
	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
	    (cd ${dir} && grep "local" install.sh && ./install.sh)
	done
28
	mkdir -p /usr/local/share/doc
29
30
	echo "# Haskell tools" >> /usr/local/share/doc/program_versions.txt
	echo "${HASKELL_TOOLS_VERSION}" >> /usr/local/share/doc/program_versions.txt
Blaise Li's avatar
Blaise Li committed
31
32
33
34
35
36
37

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
38
	/usr/local/share/doc/program_versions.txt
Blaise Li's avatar
Blaise Li committed
39
40
41
42
43
44
45
46
47
48

%post
	apt-get -y update
	# Useful for interactive work using the container
	apt-get -y install vim
	# To be able to generate rule graphs of the workflows
	apt-get -y install graphviz
	# 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
49
50
51
52
53
54
55
56
57
58
	# Recording program versions
	for prog in bedops bedtools bowtie2 cutadapt hisat2 parallel samtools
	do
	    echo "# ${prog}" >> /usr/local/share/doc/program_versions.txt
	    eval "${prog} --version" >> /usr/local/share/doc/program_versions.txt
	done
	# subread provides featureCounts
	prog="featureCounts"
	echo "# ${prog}" >> /usr/local/share/doc/program_versions.txt
	eval "${prog} -v" 2>> /usr/local/share/doc/program_versions.txt
Blaise Li's avatar
Blaise Li committed
59
60
61
62
63
64
65
66
	# 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
67
	BIOAWK_VERSION=$(git log | head -1 | cut -d " " -f2)
Blaise Li's avatar
Blaise Li committed
68
69
70
	apt install -y byacc
	make
	ln -s /usr/local/src/bioawk/bioawk /usr/local/bin/.
71
72
73
	prog="bioawk"
	echo "# ${prog}" >> /usr/local/share/doc/program_versions.txt
	echo "${BIOAWK_VERSION}" >> /usr/local/share/doc/program_versions.txt
Blaise Li's avatar
Blaise Li committed
74
75
76
77
78
79
80
81
82
83
	##########################
	# 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
84
85
86
87
	# fastq-tools provides fastq-sort
	prog="fastq-sort"
	echo "# ${prog}" >> /usr/local/share/doc/program_versions.txt
	eval "${prog} --version" >> /usr/local/share/doc/program_versions.txt
Blaise Li's avatar
Blaise Li committed
88
89
90
91
92
93
94
	#########################
	# 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/.
95
96
97
	prog="bedGraphToBigWig"
	echo "# ${prog}" >> /usr/local/share/doc/program_versions.txt
	eval "${prog}" 2>> /usr/local/share/doc/program_versions.txt
Blaise Li's avatar
Blaise Li committed
98
99
100
101
102
103
	# 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
104
105
106
	prog="R"
	echo "# ${prog}" >> /usr/local/share/doc/program_versions.txt
	eval "${prog} --version" >> /usr/local/share/doc/program_versions.txt
Blaise Li's avatar
Blaise Li committed
107
108
109
	R -e 'install.packages("BiocManager")'
	R -e 'BiocManager::install(ask=FALSE)'
	R -e 'BiocManager::install(c("docopt", "DESeq2"), ask=FALSE)'
110
111
112
	prog="DESeq2"
	echo "# ${prog}" >> /usr/local/share/doc/program_versions.txt
	R -q -e 'packageVersion("DESeq2")' >> /usr/local/share/doc/program_versions.txt
Blaise Li's avatar
Blaise Li committed
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139

	# 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
	python3.7 -m pip install --upgrade pip
	# Useful for experimenting in shell mode
	python3.7 -m pip install ipython
	# Should be installed before pyBedTools for the latter to have numpy support
	python3.7 -m pip install numpy
	# Needs to install before custom pybedtools
	# python3.7 -m pip install pysam
	# To get scipy properly built as requirement:
	python3.7 -m pip install pybind11

%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
	exec "$@"