-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrun
86 lines (63 loc) · 2.01 KB
/
run
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
#!/bin/bash
function usage(){
echo -e 'run -h -s [file]
-h help
-s seqence_file (the same file that was used on searching genes pages:
http://genome.crg.es/geneid.html
http://genes.mit.edu/GENSCAN.html
http://exon.biology.gatech.edu/GeneMark/hmmchoice.html )
All result from sites listed above shoud be placed in the "files" folder (see "files/example").
Result files are:
-resut.csv: contains columns (separator is tab):
WHICH_METHOD +\- WHERE_IS_START WHERE_IS_STOP Matching_in_other_methods
-if some genes was found by all methods then in folder "result" you will find files generated by using blastx (nr database) on input seqence_file.
AUTHOR & OWNER: ALEKSANDER MUĆK
Plans for the future:
-to add automatic method_result_file dowload from sites listed above.'
exit
}
while getopts "hs:" opt; do
case $opt in
h)
usage
;;
s)
seq=$OPTARG
;;
\?)
usage
;;
esac
done
if [ $OPTIND -eq 1 ];
then
echo "Seqence_file is necessary!"
usage
fi
rm -rf result && mkdir result
rm -rf temp && mkdir temp
mkdir temp/clear
mkdir temp/result
#Cleaning method_result_file to a readable form for python.
while read genefile;
do
if [ $genefile == "example" ] ; then
:
elif grep -iq geneid files/$genefile ; then
cut -f4,5,7 files/$genefile| grep .| python edit_genedit.py > temp/clear/Geneid
elif grep -iq genscan files/$genefile; then
sed 's/^ \+//g' files/$genefile| grep '^[0-9]' | sed 's/ \+/\t/g' | cut -f1,3,4,5| sed 's/\.[0-9]\+//g' > temp/clear/Genescan
else
sed 's/^ \+//g' files/$genefile| grep '^[0-9]' | sed 's/ \+/\t/g' | cut -f1,3,5,6 > temp/clear/Genmark
fi
done < <(ls files)
python final.py $seq
#web_blast dowloaded from
#https://blast.ncbi.nlm.nih.gov/Blast.cgi?CMD=Web&PAGE_TYPE=BlastDocs&DOC_TYPE=DeveloperInfo
while read resultfile;
do
echo "Searching for match in NCBI..."
perl web_blast blastx nr temp/result/$resultfile > result/NCBI_$resultfile.txt
echo "DONE"
done < <(ls temp/result)
echo "OK"