-
Notifications
You must be signed in to change notification settings - Fork 0
/
test_pipeline_chipseq.sh
executable file
·74 lines (63 loc) · 2.85 KB
/
test_pipeline_chipseq.sh
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
#!/usr/bin/env bash
# Create module command alias
module() { source /opt/module.sh $@; }
export -f module
export IS_TEST=TRUE
export WASHU_ROOT="/washu"
export PYTHONPATH="$WASHU_ROOT:$PYTHONPATH"
##################
# Pipeline tests #
##################
echo "Check tools available by module load"
# samtools are installed to py3.5 as a dependency
#which samtools &>/dev/null && { echo "ERROR samtools: HIDE until module load samtools"; exit 1; }
which bedtools &>/dev/null && { echo "bedtools: HIDE until module load bedtools2"; exit 1; }
which fastqc &>/dev/null && { echo "ERROR java: HIDE until module load fastqc"; exit 1; }
which java &>/dev/null && { echo "ERROR java: HIDE until module load java"; exit 1; }
which R &>/dev/null && { echo "ERROR R: HIDE until module load R"; exit 1; }
which Rscript &>/dev/null && { echo "ERROR Rscript: HIDE until module load R"; exit 1; }
which bowtie &>/dev/null && { echo "ERROR bowtie: HIDE until module load bowtie"; exit 1; }
which bowtie2 &>/dev/null && { echo "ERROR bowtie2: HIDE until module load bowtie2"; exit 1; }
which fastq-dump &>/dev/null && { echo "ERROR fastq-dump: HIDE until module load sratoolkit"; exit 1; }
#echo "Check tools required by other scripts"
which macs2 &>/dev/null || { echo "ERROR: macs2 not found"; exit 1; }
which SICER.sh &>/dev/null || { echo "ERROR: SICER.sh not found"; exit 1; }
which rseg &>/dev/null || { echo "ERROR: rseg not found"; exit 1; }
which bedGraphToBigWig &>/dev/null || { echo "ERROR: bedGraphToBigWig not found"; exit 1; }
which bedClip &>/dev/null || { echo "ERROR: bedClip not found"; exit 1; }
which bigWigAverageOverBed &>/dev/null || { echo "ERROR: bigWigAverageOverBed not found"; exit 1; }
echo "Check downloaded files"
if [[ ! -f ~/picard.jar ]]; then
echo "ERROR: Picard tools not found! Download: <http://broadinstitute.github.io/picard/>"
fi
if [[ ! -d ~/phantompeakqualtools ]]; then
echo "ERROR: Phantompeakqualtools not found! Download: <https://github.com/kundajelab/phantompeakqualtools>"
fi
if [[ ! -f ~/span.jar ]]; then
echo "ERROR: SPAN not found! Download: <https://research.jetbrains.org/groups/biolabs/tools/span-peak-analyzer>"
fi
echo "Extract test data"
if [[ ! -d ~/washu_test_data ]]; then
tar -xf ~/washu_test_data.tar.gz --directory ~
fi
cp -r ~/washu_test_data/fastq ~/
cp -r ~/washu_test_data/index ~/
echo "Prepare regions for RSEG"
if [[ ! -d ~/fastq_bams ]]; then
mkdir -p ~/fastq_bams
ln -sf ~/index/hg19/deadzones-k36-hg19.bed ~/fastq_bams/deadzones-k36-hg19.bed
fi
# Limit parallelism level for tests
export WASHU_PARALLELISM=2
echo "Run tests"
module load bedtools2
module load samtools
module load fastqc
module load java
python -m pytest test/pipeline/test_pipeline_chipseq.py
echo "Copy results to /out"
mkdir -p /washu/out
cp -r ~/fastq* /washu/out
cp -r ~/index* /washu/out
cp -r ~/signals* /washu/out
cp -r ~/pipeline_std* /washu/out