forked from eyscott/Equine_lncRNA
-
Notifications
You must be signed in to change notification settings - Fork 1
/
11_uniq_exp.sh
46 lines (40 loc) · 2.4 KB
/
11_uniq_exp.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
cp inputs/backmapping_stats/allTissues_isoformTPM allTrans_allTissues_isoformTPM
tail -n+2 inputs/backmapping_stats/intergenic_allTissues_isoformTPM >> allTrans_allTissues_isoformTPM
head -n+1 allTrans_allTissues_isoformTPM > lncRNA_allTissues_isoformTPM
awk -F"\t" '{print $4}' lncRNA_final.bed | grep -Fwf - allTrans_allTissues_isoformTPM >> lncRNA_allTissues_isoformTPM
targets=()
for target in BrainStem Cerebellum Embryo.ICM Embryo.TE Muscle Retina Skin SpinalCord;do targets+=($target);done
##print no of gene/isoform expressed, expressed uniqely, not expressed uniquely
mkdir -p uniqExp_lncRNA
cutoff=0.1 ## run with cutoff=0or5
i=0
n=${#targets[@]}
echo "## no of gene/isoform expressed, expressed uniqely, not expressed uniquely" > tissueSpecificSummary_cutoff.$cutoff
while [ $i -lt $n ];do
echo ${targets[$i]}
#cat allTissues_geneTPM | awk -v x=$((i+2)) -v c=$cutoff '$x>c' | wc -l
cat lncRNA_allTissues_isoformTPM | awk -v x=$((i+2)) -v c=$cutoff '$x>c' | wc -l
#cat allTissues_geneTPM > tempGene;
cat lncRNA_allTissues_isoformTPM > tempIsoform;
for x in `seq 2 $((n+1))`;do
#if [ $x -eq $((i+2)) ];then awk -v x=$x -v c=$cutoff '$x>c' tempGene > tempGene2; else awk -v x=$x -v c=$cutoff '$x<=c' tempGene > tempGene2;fi
if [ $x -eq $((i+2)) ];then awk -v x=$x -v c=$cutoff '$x>c' tempIsoform > tempIsoform2; else awk -v x=$x -v c=$cutoff '$x<=c' tempIsoform > tempIsoform2;fi
#mv tempGene2 tempGene;
mv tempIsoform2 tempIsoform;done
#cat tempGene | wc -l;
cat tempIsoform | wc -l;
#mv tempGene uniqExp_lncRNA/${targets[$i]}.gene.expressed_uniqely_cutoff.$cutoff;
mv tempIsoform uniqExp_lncRNA/${targets[$i]}.isoform.expressed_uniqely_cutoff.$cutoff;
#cat allTissues_geneTPM > tempGene;
cat lncRNA_allTissues_isoformTPM > tempIsoform;
for x in `seq 2 $((n+1))`;do
#if [ $x -eq $((i+2)) ];then awk -v x=$x -v c=$cutoff '$x<=c' tempGene > tempGene2; else awk -v x=$x -v c=$cutoff '$x>c' tempGene > tempGene2;fi
if [ $x -eq $((i+2)) ];then awk -v x=$x -v c=$cutoff '$x<=c' tempIsoform > tempIsoform2; else awk -v x=$x -v c=$cutoff '$x>c' tempIsoform > tempIsoform2;fi
#mv tempGene2 tempGene;
mv tempIsoform2 tempIsoform;done
#cat tempGene | wc -l;
cat tempIsoform | wc -l;
#mv tempGene uniqExp_lncRNA/${targets[$i]}.gene.notExpressed_uniqely_cutoff.$cutoff;
mv tempIsoform uniqExp_lncRNA/${targets[$i]}.isoform.notExpressed_uniqely_cutoff.$cutoff;
((i+=1))
done >> tissueSpecificSummary_cutoff.$cutoff