-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathexample_create_formatted_gff3.sh
More file actions
executable file
·40 lines (27 loc) · 1.09 KB
/
example_create_formatted_gff3.sh
File metadata and controls
executable file
·40 lines (27 loc) · 1.09 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
#!/bin/sh
## Example shell script to convert GTF/GFF to Flybase-style GFF3
# Variables to set
## Path to Event Analysis install. This is the folder containing "docs", "src", run_buildAnnotations.sh, etc.
EVENTDIR=/path/to/event_analysis
## Path to GTF/GFF file to convert
GFF=/path/to/mygtf.gtf
## Output GFF path and name. Make sure this ends with ".gff"
GFFOUT=/path/to/mygff3.converted.gff
SCRIPTS=${EVENTDIR}/src
##
# Checking if a gff.db file exists, and if not then create one
echo "Checking if user-supplied GTF/GFF file has a pre-generated database file"
if [ ! -e ${GFF}.db ]
then
echo "No database file found! Generating..."
python $SCRIPTS/make_gff_db.py --gff $GFF
echo "Database generated!"
else
echo "Database file found! Skipping generation."
fi
# Convert user-supplied GTF/GFF file into GFF3 format
echo "Converting user-supplied GTF/GFF to GFF3 format"
python $SCRIPTS/convertGTF2GFF3.py --input $GFF --output ${GFFOUT}
sort -k1,1 -k4n -k5n ${GFFOUT} > ${TMPDIR}/temp.gff
mv ${TMPDIR}/temp.gff ${GFFOUT}
python $SCRIPTS/make_gff_db.py --gff ${GFFOUT}