Skip to content

Commit 111d151

Browse files
authored
Merge pull request nf-core#606 from MaxUlysse/submodule
add test data as a submodule
2 parents 1e4d57c + ab57c1e commit 111d151

8 files changed

Lines changed: 68 additions & 17 deletions

File tree

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ Annotation/
22
Preprocessing/
33
References/
44
Reports/
5-
Sarek-data/
65
VariantCalling/
76
work/
87
.*swp

.gitmodules

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[submodule "Sarek-data"]
2+
path = Sarek-data
3+
url = https://github.com/SciLifeLab/Sarek-data.git

Sarek-data

Submodule Sarek-data added at d717855

doc/INSTALL_BIANCA.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,11 @@ All Reference files are already stored in `bianca`.
2020

2121
# Clone the repository
2222
> git clone https://github.com/SciLifeLab/Sarek.git
23+
24+
# If you want to include the test data, you should use --recursive
25+
> git clone --recursive https://github.com/SciLifeLab/Sarek.git
26+
27+
# Go to the newly created directory
2328
> cd Sarek
2429

2530
# It is also possible to checkout a specific version using
@@ -28,6 +33,20 @@ All Reference files are already stored in `bianca`.
2833
# Use our script to make an archive to send to bianca
2934
> ./scripts/makeSnapshot.sh
3035

36+
# Or you can also include the test data in this archive using git-archive-all
37+
# Install pip
38+
> curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py
39+
> python get-pip.py
40+
41+
# If it fails due to permission, you could consider using
42+
> python get-pip.py --user
43+
44+
# Install git-archive-all using pip
45+
> pip install git-archive-all
46+
# If you used --user before, you might want to do that here too
47+
> pip install git-archive-all --user
48+
> ./scripts/makeSnapshot.sh --include-test-data
49+
3150
# You will get this message in your terminal
3251
Wrote Sarek-[snapID].tar.gz
3352

doc/TESTS.md

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,16 +7,13 @@ One simple bash script is available, which will pull the Sarek-data repository a
77

88
Such tests are used in our Continuous Integration with Travis. You can perform the same tests to familiarize yourself with the workflow.
99

10-
### Testing with Singularity
10+
## Testing with Singularity
1111
For testing with Docker, just replace `singularity` with `docker` in every occurence.
1212
```bash
13-
# Dowload Sarek
14-
git clone https://github.com/SciLifeLab/Sarek Sarek-test
13+
# Dowload Sarek and the test data
14+
git clone --recursive https://github.com/SciLifeLab/Sarek Sarek-test
1515
cd Sarek-test
1616

17-
# Dowload Sarek test data
18-
git clone https://github.com/SciLifeLab/Sarek-data
19-
2017
# Build the references for the test data
2118
nextflow run buildReferences.nf --outDir References/smallGRCh37 \
2219
--refDir Sarek-data/reference --genome smallGRCh37 --tag latest \
@@ -77,6 +74,13 @@ nextflow run annotate.nf --tools snpEFF,VEP \
7774
nextflow run runMultiQC.nf -profile singularity
7875
```
7976

77+
## Testing on a secure cluster
78+
On a secure cluster as bianca, with no internet access, you will need to download and transfer Sarek and the test data first.
79+
80+
Follow the [installation guide for `bianca`](https://github.com/SciLifeLab/Sarek/blob/master/doc/INSTALL_BIANCA.md).
81+
82+
And then start the test at the `Build the references for the test data` step.
83+
8084
## Usage
8185

8286
Four optional arguments are supported:

lib/SarekUtils.groovy

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -208,12 +208,12 @@ class SarekUtils {
208208

209209
// Sarek ascii art
210210
static def sarek_ascii() {
211-
println " ____ _____ _ "
212-
println " .' _ `. / ____| | | "
213-
println " / |\\`-_ \\ | (___ __ _ _ __ ___| | __ "
214-
println "| | \\ `-| \\___ \\ / _` | '__/ __| |/ / "
215-
println " \\ | \\ / ____) | (_| | | | __| < "
216-
println " `|____\\' |_____/ \\__,_|_| \\___|_|\\_\\ "
211+
println " ____ _____ _ "
212+
println " .' _ `. / ____| | | "
213+
println " / |\\`-_ \\ | (___ ___ _ __ __ | | __"
214+
println "| | \\ `-| \\___ \\/__ \\| ´__/ _\\| |/ /"
215+
println " \\ | \\ / ____) | __ | | | __| < "
216+
println " `|____\\' |_____/\\____|_| \\__/|_|\\_\\"
217217
}
218218

219219
}

scripts/makeSnapshot.sh

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,30 @@
11
#!/bin/bash
22
set -euo pipefail
3+
4+
TEST=false
35
NAME=Sarek-$(git describe --tags)
4-
git archive HEAD --prefix=$NAME/ | gzip > $NAME.tar.gz
6+
7+
while [[ $# -gt 0 ]]
8+
do
9+
key="$1"
10+
case $key in
11+
-i|-t|--include-test-data)
12+
TEST=true
13+
shift # past argument
14+
;;
15+
*) # unknown option
16+
shift # past argument
17+
;;
18+
esac
19+
done
20+
21+
if [[ $TEST == false ]]
22+
then
23+
echo "Archiving Sarek without test data"
24+
git archive HEAD --prefix=$NAME/ | gzip > $NAME.tar.gz
25+
else
26+
echo "Archiving Sarek with test data"
27+
git-archive-all --prefix=$NAME/ --force-submodules $NAME.tar.gz
28+
fi
29+
530
echo "Wrote $NAME.tar.gz"

scripts/test.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,10 +62,10 @@ function clean_repo() {
6262
# Build references only for smallGRCh37
6363
if [[ $GENOME == smallGRCh37 ]] && [[ $TEST != BUILDCONTAINERS ]] && [[ BUILD ]]
6464
then
65-
if [[ ! -d Sarek-data ]]
65+
if [[ -z "$(ls -A Sarek-data)" ]]
6666
then
67-
echo "$(tput setaf 1)Cloning Sarek-data repository$(tput sgr0)"
68-
git clone https://github.com/SciLifeLab/Sarek-data.git
67+
git submodule init
68+
git submodule update
6969
fi
7070
if [[ ! -d References ]]
7171
then

0 commit comments

Comments
 (0)