Repository navigation
Expand file tree
/
Copy pathtest_ERR039477.sh
More file actions
executable file
·96 lines (86 loc) · 3.16 KB
/
Copy pathtest_ERR039477.sh
File metadata and controls
executable file
·96 lines (86 loc) · 3.16 KB
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
#! /bin/bash
# look for minia binary. In devel mode, it's in ../build/bin directory.
# In production mode, it's in ../bin directory.
if [ -f "../bin/minia" ]
then
bindir="../bin"
elif [ -f "../build/bin/minia" ]
then
bindir="../build/bin"
else
echo "could not find a compiled Minia binary"
exit 1
fi
################################################################################
# we download a sample bank from EBI
################################################################################
# if wget is not installed, you may use "curl -O ..."
DATA_SAMPLE="ftp://ftp.sra.ebi.ac.uk/vol1/fastq/ERR039/ERR039477/ERR039477.fastq.gz"
WGET_PATH=`which wget`
rm -f ERR039477.fastq.gz #needed otherwise wget will not overwrite and write to ERR039477.fastq.gz.1 instead
echo ">>> Retrieving data sample: ${DATA_SAMPLE}"
if [ ! -z "$WGET_PATH" ] ; then
echo " using '$WGET_PATH'..."
if [ $SILENT_MODE=="true" ] ; then
wget --quiet ${DATA_SAMPLE}
else
wget ${DATA_SAMPLE}
fi
else
CURL_PATH=`which curl`
if [ ! -z "$CURL_PATH" ] ; then
echo " using '$CURL_PATH'..."
if [ $SILENT_MODE=="true" ] ; then
curl --silent -O ${DATA_SAMPLE}
else
curl -O ${DATA_SAMPLE}
fi
else
echo " /!\ error: unable to find 'wget' or 'curl'"
exit 1
fi
fi
echo "size and MD5 of ERR039477.fastq.gz :"
ls -l ERR039477.fastq.gz
md5sum ERR039477.fastq.gz
################################################################################
# we launch minia; note that we use only one thread (no real time issues with
# potential different results)
################################################################################
$bindir/minia -nb-cores 1 -in ERR039477.fastq.gz -nb-glue-partitions 100
################################################################################
# we check the result
################################################################################
MD5SUM_PATH=`which md5sum`
if [ ! -z "$MD5SUM_PATH" ] ; then
# Linux
md5sum ERR039477.fastq.contigs.fa > ERR039477.check
else
# OSX: 'md5 -r' is equivalent to Linux md5sum
md5 -r ERR039477.fastq.contigs.fa > ERR039477.check
fi
# 'diff' cannot be used: md5sum produces a single space between value and file
# name whereas md5 produces two spaces...
# diff ./ERR039477.md5 ./ERR039477.check
# anyway we compare against a bunch of hashes
# one for gatb-ci debian gcc 4.7, one for macos gcc 4.2
SCRIPTDIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
REF_CHKSUM_FILE="$SCRIPTDIR/ERR039477.md5"
CHKSUM=`cut -d ' ' -f 1 ERR039477.check`
if [ `grep $CHKSUM $REF_CHKSUM_FILE | wc -l` == "1" ]; then
echo "TEST OK"
else
echo "some debug: current_checksum: $CHKSUM"
head -n 4 ERR039477.fastq.contigs.fa
tail -n 4 ERR039477.fastq.contigs.fa
wc -l ERR039477.fastq.contigs.fa
echo $bindir/minia -nb-cores 1 -in ERR039477.fastq.gz
ls -l ERR039477.fastq.gz
ls -l $bindir/minia
echo "TEST KO"
exit 1
fi
################################################################################
# clean up
################################################################################
rm -f ERR039477.fastq.contigs.fa ERR039477.fastq.gz ERR039477.fastq.h5 ERR039477.check