-
Notifications
You must be signed in to change notification settings - Fork 4
/
FAIR_script_session2.sh
65 lines (54 loc) · 1.68 KB
/
FAIR_script_session2.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
##------------------------------------------------------------------------------
## FAIR script
## Author: T. Denecker & C. Toffano-Nioche
## Affiliation: I2BC
## Aim: A workflow to process RNA-Seq.
## Organism: O. tauri
## Date: Jan 2019
## Step :
## 1- Create tree structure
## 2- Download data from SRA
##------------------------------------------------------------------------------
echo "=============================================================="
echo "Creation of tree structure"
echo "=============================================================="
mkdir Project
mkdir Project/samples
mkdir Project/annotations
mkdir Project/bowtie2
mkdir Project/fastqc
mkdir Project/genome
mkdir Project/graphics
mkdir Project/htseq
mkdir Project/reference
mkdir Project/samtools
echo "=============================================================="
echo "Download data from SRA"
echo "=============================================================="
cd Project/samples
IFS=$'\n' # make newlines the only separator
for j in $(tail -n +2 ../../conditions.txt)
do
# Get important information from the line
access=$( echo "${j}" | cut -f6 )
id=$( echo "${j}" | cut -f1 )
md5=$( echo "${j}" | cut -f7 )
echo "--------------------------------------------------------------"
echo ${id}
echo "--------------------------------------------------------------"
# Download file
wget ${access} # wget method
# Get md5 of downloaded file
md5_local="$(md5sum ${id}.fastq.gz | cut -d' ' -f1)"
echo ${md5_local}
# Test md5
if [ "${md5_local}" == "${md5}" ]
then
echo "Done"
else
echo "Nope"
exit 1
fi
done
cd ../..
exit 0