-
Notifications
You must be signed in to change notification settings - Fork 0
/
mouse_fetch_and_upload.sh
executable file
·91 lines (79 loc) · 1.41 KB
/
mouse_fetch_and_upload.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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
#!/bin/bash
#
DEFAULTRELEASE=5.2.2
while getopts r:b:a:k: option
do
case "${option}"
in
r)
RELEASE=${OPTARG}
;;
b)
AWSBUCKET=${OPTARG}
;;
a)
AWSACCESS=${OPTARG}
;;
k)
AWSSECRET=${OPTARG}
;;
esac
done
if [ -z "$RELEASE" ]
then
RELEASE=${ALLIANCE_RELEASE}
fi
if [ -z "$RELEASE" ]
then
RELEASE=${DEFAULTRELEASE}
fi
if [ -z "$AWSBUCKET" ]
then
if [ -z "${AWS_S3_BUCKET}" ]
then
AWSBUCKET=agrjbrowse
else
AWSBUCKET=${AWS_S3_BUCKET}
fi
fi
if [ -z "$AWSACCESS" ]
then
AWSACCESS=${AWS_ACCESS_KEY}
fi
if [ -z "$AWSSECRET" ]
then
AWSSECRET=${AWS_SECRET_KEY}
fi
CHROMOSOME=(
'4'
'5'
'6'
'7'
'8'
'9'
'10'
'11'
'12'
'13'
'14'
'15'
'16'
'17'
'18'
'19'
'MT'
'X'
'Y'
'3'
'2'
'1'
)
for CHROM in "${CHROMOSOME[@]}" ; do
echo "fetching chrom $CHROM files"
wget -q https://download.alliancegenome.org/variants/MGI/MGI.vep.$CHROM.vcf.gz
wget -q https://download.alliancegenome.org/variants/MGI/MGI.vep.$CHROM.vcf.gz.tbi
AWS_ACCESS_KEY_ID=$AWSACCESS AWS_SECRET_ACCESS_KEY=$AWSSECRET aws s3 cp --quiet --acl public-read MGI.vep.$CHROM.vcf.gz s3://$AWSBUCKET/docker/$RELEASE/MGI/mouse/VCF/MGI.vep.$CHROM.vcf.gz
AWS_ACCESS_KEY_ID=$AWSACCESS AWS_SECRET_ACCESS_KEY=$AWSSECRET aws s3 cp --quiet --acl public-read MGI.vep.$CHROM.vcf.gz.tbi s3://$AWSBUCKET/docker/$RELEASE/MGI/mouse/VCF/MGI.vep.$CHROM.vcf.gz.tbi
rm MGI.vep.$CHROM.vcf.gz
rm MGI.vep.$CHROM.vcf.gz.tbi
done