-
Notifications
You must be signed in to change notification settings - Fork 0
/
build_with_tabix.sh
executable file
·79 lines (60 loc) · 1.68 KB
/
build_with_tabix.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
#!/bin/bash
# this is a simple test script for tabix indexing gff
set -e
RELEASE=280
while getopts r:s:a:k: option
do
case "${option}"
in
r)
RELEASE=${OPTARG}
;;
s)
SPECIES=${OPTARG}
;;
a)
AWSACCESS=${OPTARG}
;;
k)
AWSSECRET=${OPTARG}
;;
esac
done
if [ -z "$RELEASE" ]
then
RELEASE=${WB_RELEASE}
fi
if [ -z "$SPECIES" ]
then
SPECIES=${WB_SPECIES}
fi
if [ -z "$AWSACCESS" ]
then
AWSACCESS=${AWS_ACCESS_KEY}
fi
if [ -z "$AWSSECRET" ]
then
AWSSECRET=${AWS_SECRET_KEY}
fi
if [ -z "$AWSBUCKET" ]
then
if [ -z "${AWS_S3_BUCKET}" ]
then
AWSBUCKET=agrjbrowse
else
AWSBUCKET=${AWS_S3_BUCKET}
fi
fi
echo $PATH
#wget ftp://ftp.wormbase.org/pub/wormbase/releases/WS280/species/c_elegans/PRJNA13758/c_elegans.PRJNA13758.WS280.annotations.gff3.gz
#gzip -d c_elegans.PRJNA13758.WS280.annotations.gff3.gz
wget http://sgd-archive.yeastgenome.org/sequence/S288C_reference/genome_releases/S288C_reference_genome_R64-3-1_20210421.tgz
tar zxvf S288C_reference_genome_R64-3-1_20210421.tgz
gzip -d S288C_reference_genome_R64-3-1_20210421/saccharomyces_cerevisiae_R64-3-1_20210421.gff.gz
head -n `grep -n "##FASTA" S288C_reference_genome_R64-3-1_20210421/saccharomyces_cerevisiae_R64-3-1_20210421.gff | cut -d: -f1` S288C_reference_genome_R64-3-1_20210421/saccharomyces_cerevisiae_R64-3-1_20210421.gff > yeast.gff
perl -pi -e 's/\t\.\t0\t\./\t.\t.\t./' yeast.gff
gt gff3 -tidy -sortlines -retainids yeast.gff > yeast.tidy.gff
bgzip yeast.tidy.gff
tabix yeast.tidy.gff.gz
aws s3 cp --acl public-read yeast.tidy.gff.gz s3://agrjbrowse/test/yeast/yeast.tidy.gff.gz
aws s3 cp --acl public-read yeast.tidy.gff.gz.tbi s3://agrjbrowse/test/yeast.tidy.gff.gz.tbi