-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathSingularity.hybphaser
114 lines (92 loc) · 2.9 KB
/
Singularity.hybphaser
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
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
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
# Author: B. Anderson
# Singularity recipe for creating a container for using HybPhaser
# see: https://github.com/LarsNauheimer/HybPhaser/
Bootstrap: docker
From: r-base:4.0.0
%labels
MAINTAINER bmichanderson
PROGRAM HybPhaser
VERSION 2.0
%help
This container is for running HybPhaser scripts from Lars Nauheimer
Scripts are stored in /HybPhaser (in the PATH)
You will need a config.txt file in the current directory
To run Rscripts, use:
singularity run -H $(pwd) hybphaser.sif [script_name]
To run the bash scripts, use:
singularity exec hybphaser.sif [script_name]
The list of scripts:
1_generate_consensus_sequences.sh
1a_count_snps.R
1b_assess_dataset.R
1c_generate_sequence_lists.R
2_extract_mapped_reads.sh
2a_prepare_bbsplit_script.R
2b_collate_bbsplit_results.R
3a_prepare_phasing_script.R
3b_collate_phasing_stats.R
4_merge_sequence_lists.R
HybPhaser_Main_script.R
%post
export DEBIAN_FRONTEND=noninteractive
# install dependencies
apt update && apt install -y --no-install-recommends \
autoconf \
automake \
build-essential \
cmake \
gawk \
git \
libbz2-dev \
make \
openjdk-8-jre \
wget \
zlib1g-dev
## R packages
R -e 'install.packages("remotes", repos = "https://cloud.r-project.org/")'
R -e 'require(remotes); install_version("ape", version = "5.4", repos = "https://cloud.r-project.org/")'
R -e 'require(remotes); install_version("seqinr", version = "4.2-8", repos = "https://cloud.r-project.org/")'
R -e 'require(remotes); install_version("stringr", version = "1.4.0", repos = "https://cloud.r-project.org/")'
## BBMap scripts
URL=https://sourceforge.net/projects/bbmap/files/latest/download
wget "$URL"
tar -xzf download && rm download
## bcftools
BCF_VER=1.9
URL=https://github.com/samtools/bcftools/releases/download/"$BCF_VER"/bcftools-"$BCF_VER".tar.bz2
wget "$URL"
tar -xjf bcftools-"$BCF_VER".tar.bz2 && rm bcftools-"$BCF_VER".tar.bz2
cd bcftools-"$BCF_VER"
./configure --prefix=/usr
make
make install
cd .. && rm -r bcftools-"$BCF_VER"
## BWA
git clone https://github.com/lh3/bwa.git
cd bwa
make
mv bwa /usr/bin/
cd .. && rm -r bwa
## samtools
SAM_VER=1.9
URL=https://github.com/samtools/samtools/releases/download/"$SAM_VER"/samtools-"$SAM_VER".tar.bz2
wget "$URL"
tar -xjf samtools-"$SAM_VER".tar.bz2 && rm samtools-"$SAM_VER".tar.bz2
cd samtools-"$SAM_VER"
./configure --prefix=/usr
make
make install
cd .. && rm -r samtools-"$SAM_VER"
# clean-up
apt autoremove -y && apt clean all
# install HybPhaser scripts
#git clone https://github.com/LarsNauheimer/HybPhaser.git
# note: for any changes, use my git
git clone -b develop_b https://github.com/bmichanderson/HybPhaser.git
chmod 755 HybPhaser/*.sh
%environment
# Set up environmental variables within the container
export PATH="$PATH":/bbmap:/HybPhaser
%runscript
# This will be executed when the container is run (singularity run [container])
Rscript /HybPhaser/"$@"