-
Notifications
You must be signed in to change notification settings - Fork 1
/
prepareMISOReducers.sh
executable file
·58 lines (36 loc) · 2.19 KB
/
prepareMISOReducers.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
#!/bin/bash
if [ $# -lt 1 ]; then
echo $0 MISOSettingFile
exit
fi
MISOSettingFile=$1
source ${MISOSettingFile}
if [ -e $transcrriptExonStringMap ]; then
echo transcrriptExonStringMap "existed as" $transcrriptExonStringMap
else
echo make transcript exon string from gff
makeTranscriptExonStringFromGff.py ${transcriptGff} > ${transcrriptExonStringMap}
fi
cat $rawEbedFile | tr " " "\t" > $rawEbedFile.tabbed
Splidar.Splicing.matchEventToTranscript.py $rawEbedFile.tabbed $transcriptEbed > ${event2TranscriptMap}
cuta.py -f4 $rawEbedFile.tabbed | awk '($0!~/track/){split($0,a,"."); printf("%s",a[1]); for(i=2;i<length(a);i++){ printf(".%s",a[i]);} printf("\n"); }' | tr "." ":" | tr "_" "@" | tr "/" ":" | sort | uniq > $rawEbedFile.tabbed.colonID
cat ${event2TranscriptMap} | tr "." ":" | tr "/" ":" | tr "_" "@" > ${event2TranscriptMap}.colon
joinu.py -1 2 -2 1 ${event2TranscriptMap}.colon ${transcrriptExonStringMap} > ${event2TranscriptMap}.exonString
stickColValues.py --printlino 10000 --internalfs , ${event2TranscriptMap}.exonString 1 > ${event2TranscriptMap}.exonString.col
cuta.py -f3 ${event2TranscriptMap}.exonString | sort | uniq > chroms.00
chroms=( `cat chroms.00` )
for chrom in ${chroms[@]}; do
echo "working on chrom $chrom"
awk -v FS="\t" -v OFS="\t" -v chrom=$chrom '($3==chrom)' ${event2TranscriptMap}.exonString > ${event2TranscriptMap}.exonString.$chrom
wc -l ${event2TranscriptMap}.exonString.$chrom
stickColValues.py --printlino 10000 --internalfs , ${event2TranscriptMap}.exonString.$chrom 1 > ${event2TranscriptMap}.exonString.$chrom.col
done
echo "now combine all chromosomes"
ls ${event2TranscriptMap}.exonString.*.col
cat ${event2TranscriptMap}.exonString.*.col > ${event2TranscriptMap}.exonString.col
rm ${event2TranscriptMap}.exonString.*.col
cuta.py -f4 $rawEbedFile.tabbed | tr "." ":" | tr "_" "@" | tr "/" ":" | grep ":" > $rawEbedFile.tabbed.colonID
cuta.py -f1 ${event2TranscriptMap}.exonString.col > ${event2TranscriptMap}.exonString.col.colonID
subtractSets.py $rawEbedFile.tabbed.colonID ${event2TranscriptMap}.exonString.col.colonID > ${event2TranscriptMap}.exonString.col.notmapped.colonID
rm ${event2TranscriptMap}.exonString.col.colonID
rm $rawEbedFile.tabbed.colonID