annotate gbsx_digest.sh @ 23:3b325560887b draft default tip

new version of gbsx: v1.2 with barcodeGenerator, demultiplex and digest
author koen
date Tue, 26 Jan 2016 07:56:34 -0500
parents 062399f3787f
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
22
062399f3787f new version of gbsx: v1.2 with barcodeGenerator, demultiplex and digest
koen
parents:
diff changeset
1 #!/usr/bin/env bash
062399f3787f new version of gbsx: v1.2 with barcodeGenerator, demultiplex and digest
koen
parents:
diff changeset
2
062399f3787f new version of gbsx: v1.2 with barcodeGenerator, demultiplex and digest
koen
parents:
diff changeset
3 #export PATH=$PATH:$(dirname $0)
062399f3787f new version of gbsx: v1.2 with barcodeGenerator, demultiplex and digest
koen
parents:
diff changeset
4 #BASEDIR=$(dirname $0)
062399f3787f new version of gbsx: v1.2 with barcodeGenerator, demultiplex and digest
koen
parents:
diff changeset
5
062399f3787f new version of gbsx: v1.2 with barcodeGenerator, demultiplex and digest
koen
parents:
diff changeset
6
062399f3787f new version of gbsx: v1.2 with barcodeGenerator, demultiplex and digest
koen
parents:
diff changeset
7 genome=$1
062399f3787f new version of gbsx: v1.2 with barcodeGenerator, demultiplex and digest
koen
parents:
diff changeset
8 length=$2
062399f3787f new version of gbsx: v1.2 with barcodeGenerator, demultiplex and digest
koen
parents:
diff changeset
9 enzyme_combination=$3
062399f3787f new version of gbsx: v1.2 with barcodeGenerator, demultiplex and digest
koen
parents:
diff changeset
10 dualEnzyme="0"
062399f3787f new version of gbsx: v1.2 with barcodeGenerator, demultiplex and digest
koen
parents:
diff changeset
11 min_size=$4
062399f3787f new version of gbsx: v1.2 with barcodeGenerator, demultiplex and digest
koen
parents:
diff changeset
12 max_size=$5
062399f3787f new version of gbsx: v1.2 with barcodeGenerator, demultiplex and digest
koen
parents:
diff changeset
13 digest_bed=$6
062399f3787f new version of gbsx: v1.2 with barcodeGenerator, demultiplex and digest
koen
parents:
diff changeset
14 digest_result=$7
062399f3787f new version of gbsx: v1.2 with barcodeGenerator, demultiplex and digest
koen
parents:
diff changeset
15
062399f3787f new version of gbsx: v1.2 with barcodeGenerator, demultiplex and digest
koen
parents:
diff changeset
16 awk 'BEGIN {n_seq=0;} /^>/ {if(n_seq%1==0){file=$1".fa"; sub(">","",file)} print >> file; n_seq++; print file >> "list.txt"; next;} { print >> file; }' < $genome
062399f3787f new version of gbsx: v1.2 with barcodeGenerator, demultiplex and digest
koen
parents:
diff changeset
17
062399f3787f new version of gbsx: v1.2 with barcodeGenerator, demultiplex and digest
koen
parents:
diff changeset
18 case "$enzyme_combination" in
062399f3787f new version of gbsx: v1.2 with barcodeGenerator, demultiplex and digest
koen
parents:
diff changeset
19 ApeKI)
062399f3787f new version of gbsx: v1.2 with barcodeGenerator, demultiplex and digest
koen
parents:
diff changeset
20 enzyme="ApeKI"
062399f3787f new version of gbsx: v1.2 with barcodeGenerator, demultiplex and digest
koen
parents:
diff changeset
21 cutsite="G^CWGC"
062399f3787f new version of gbsx: v1.2 with barcodeGenerator, demultiplex and digest
koen
parents:
diff changeset
22 ;;
062399f3787f new version of gbsx: v1.2 with barcodeGenerator, demultiplex and digest
koen
parents:
diff changeset
23 PstI)
062399f3787f new version of gbsx: v1.2 with barcodeGenerator, demultiplex and digest
koen
parents:
diff changeset
24 enzyme="PstI"
062399f3787f new version of gbsx: v1.2 with barcodeGenerator, demultiplex and digest
koen
parents:
diff changeset
25 cutsite="CTGCA^G"
062399f3787f new version of gbsx: v1.2 with barcodeGenerator, demultiplex and digest
koen
parents:
diff changeset
26 ;;
062399f3787f new version of gbsx: v1.2 with barcodeGenerator, demultiplex and digest
koen
parents:
diff changeset
27 EcoT22I)
062399f3787f new version of gbsx: v1.2 with barcodeGenerator, demultiplex and digest
koen
parents:
diff changeset
28 enzyme="EcoT22I"
062399f3787f new version of gbsx: v1.2 with barcodeGenerator, demultiplex and digest
koen
parents:
diff changeset
29 cutsite="ATGCA^T"
062399f3787f new version of gbsx: v1.2 with barcodeGenerator, demultiplex and digest
koen
parents:
diff changeset
30 ;;
062399f3787f new version of gbsx: v1.2 with barcodeGenerator, demultiplex and digest
koen
parents:
diff changeset
31 PasI)
062399f3787f new version of gbsx: v1.2 with barcodeGenerator, demultiplex and digest
koen
parents:
diff changeset
32 enzyme="PasI"
062399f3787f new version of gbsx: v1.2 with barcodeGenerator, demultiplex and digest
koen
parents:
diff changeset
33 cutsite="CC^CWGGG"
062399f3787f new version of gbsx: v1.2 with barcodeGenerator, demultiplex and digest
koen
parents:
diff changeset
34 ;;
062399f3787f new version of gbsx: v1.2 with barcodeGenerator, demultiplex and digest
koen
parents:
diff changeset
35 HpaII)
062399f3787f new version of gbsx: v1.2 with barcodeGenerator, demultiplex and digest
koen
parents:
diff changeset
36 enzyme="HpaII"
062399f3787f new version of gbsx: v1.2 with barcodeGenerator, demultiplex and digest
koen
parents:
diff changeset
37 cutsite="C^CGG"
062399f3787f new version of gbsx: v1.2 with barcodeGenerator, demultiplex and digest
koen
parents:
diff changeset
38 ;;
062399f3787f new version of gbsx: v1.2 with barcodeGenerator, demultiplex and digest
koen
parents:
diff changeset
39 MspI)
062399f3787f new version of gbsx: v1.2 with barcodeGenerator, demultiplex and digest
koen
parents:
diff changeset
40 enzyme="MspI"
062399f3787f new version of gbsx: v1.2 with barcodeGenerator, demultiplex and digest
koen
parents:
diff changeset
41 cutsite="C^CGG"
062399f3787f new version of gbsx: v1.2 with barcodeGenerator, demultiplex and digest
koen
parents:
diff changeset
42 ;;
062399f3787f new version of gbsx: v1.2 with barcodeGenerator, demultiplex and digest
koen
parents:
diff changeset
43 PstI-EcoT22I)
062399f3787f new version of gbsx: v1.2 with barcodeGenerator, demultiplex and digest
koen
parents:
diff changeset
44 dualEnzyme="1"
062399f3787f new version of gbsx: v1.2 with barcodeGenerator, demultiplex and digest
koen
parents:
diff changeset
45 enzyme="PstI"
062399f3787f new version of gbsx: v1.2 with barcodeGenerator, demultiplex and digest
koen
parents:
diff changeset
46 cutsite="CTGCA^G"
062399f3787f new version of gbsx: v1.2 with barcodeGenerator, demultiplex and digest
koen
parents:
diff changeset
47 enzyme2="EcoT22I"
062399f3787f new version of gbsx: v1.2 with barcodeGenerator, demultiplex and digest
koen
parents:
diff changeset
48 cutsite2="ATGCA^T";
062399f3787f new version of gbsx: v1.2 with barcodeGenerator, demultiplex and digest
koen
parents:
diff changeset
49 ;;
062399f3787f new version of gbsx: v1.2 with barcodeGenerator, demultiplex and digest
koen
parents:
diff changeset
50 PstI-MspI)
062399f3787f new version of gbsx: v1.2 with barcodeGenerator, demultiplex and digest
koen
parents:
diff changeset
51 dualEnzyme="1"
062399f3787f new version of gbsx: v1.2 with barcodeGenerator, demultiplex and digest
koen
parents:
diff changeset
52 enzyme="PstI"
062399f3787f new version of gbsx: v1.2 with barcodeGenerator, demultiplex and digest
koen
parents:
diff changeset
53 cutsite="CTGCA^G"
062399f3787f new version of gbsx: v1.2 with barcodeGenerator, demultiplex and digest
koen
parents:
diff changeset
54 enzyme2="MspI"
062399f3787f new version of gbsx: v1.2 with barcodeGenerator, demultiplex and digest
koen
parents:
diff changeset
55 cutsite2="C^CGG"
062399f3787f new version of gbsx: v1.2 with barcodeGenerator, demultiplex and digest
koen
parents:
diff changeset
56 ;;
062399f3787f new version of gbsx: v1.2 with barcodeGenerator, demultiplex and digest
koen
parents:
diff changeset
57 PstI-TaqI)
062399f3787f new version of gbsx: v1.2 with barcodeGenerator, demultiplex and digest
koen
parents:
diff changeset
58 dualEnzyme="1"
062399f3787f new version of gbsx: v1.2 with barcodeGenerator, demultiplex and digest
koen
parents:
diff changeset
59 enzyme="PstI"
062399f3787f new version of gbsx: v1.2 with barcodeGenerator, demultiplex and digest
koen
parents:
diff changeset
60 cutsite="CTGCA^G"
062399f3787f new version of gbsx: v1.2 with barcodeGenerator, demultiplex and digest
koen
parents:
diff changeset
61 enzyme2="TaqI"
062399f3787f new version of gbsx: v1.2 with barcodeGenerator, demultiplex and digest
koen
parents:
diff changeset
62 cutsite2="T^CGA"
062399f3787f new version of gbsx: v1.2 with barcodeGenerator, demultiplex and digest
koen
parents:
diff changeset
63 ;;
062399f3787f new version of gbsx: v1.2 with barcodeGenerator, demultiplex and digest
koen
parents:
diff changeset
64 SbfI-MspI)
062399f3787f new version of gbsx: v1.2 with barcodeGenerator, demultiplex and digest
koen
parents:
diff changeset
65 dualEnzyme="1"
062399f3787f new version of gbsx: v1.2 with barcodeGenerator, demultiplex and digest
koen
parents:
diff changeset
66 enzyme="SbfI"
062399f3787f new version of gbsx: v1.2 with barcodeGenerator, demultiplex and digest
koen
parents:
diff changeset
67 cutsite="CCTGCA^GG"
062399f3787f new version of gbsx: v1.2 with barcodeGenerator, demultiplex and digest
koen
parents:
diff changeset
68 enzyme2="MspI"
062399f3787f new version of gbsx: v1.2 with barcodeGenerator, demultiplex and digest
koen
parents:
diff changeset
69 cutsite2="C^CGG"
062399f3787f new version of gbsx: v1.2 with barcodeGenerator, demultiplex and digest
koen
parents:
diff changeset
70 ;;
062399f3787f new version of gbsx: v1.2 with barcodeGenerator, demultiplex and digest
koen
parents:
diff changeset
71 AsiSI-MspI)
062399f3787f new version of gbsx: v1.2 with barcodeGenerator, demultiplex and digest
koen
parents:
diff changeset
72 dualEnzyme="1"
062399f3787f new version of gbsx: v1.2 with barcodeGenerator, demultiplex and digest
koen
parents:
diff changeset
73 enzyme="AsiSI"
062399f3787f new version of gbsx: v1.2 with barcodeGenerator, demultiplex and digest
koen
parents:
diff changeset
74 cutsite="GCCGAT^CGC"
062399f3787f new version of gbsx: v1.2 with barcodeGenerator, demultiplex and digest
koen
parents:
diff changeset
75 enzyme2="MspI"
062399f3787f new version of gbsx: v1.2 with barcodeGenerator, demultiplex and digest
koen
parents:
diff changeset
76 cutsite2="C^CGG"
062399f3787f new version of gbsx: v1.2 with barcodeGenerator, demultiplex and digest
koen
parents:
diff changeset
77 ;;
062399f3787f new version of gbsx: v1.2 with barcodeGenerator, demultiplex and digest
koen
parents:
diff changeset
78 BssHII-MspI)
062399f3787f new version of gbsx: v1.2 with barcodeGenerator, demultiplex and digest
koen
parents:
diff changeset
79 dualEnzyme="1"
062399f3787f new version of gbsx: v1.2 with barcodeGenerator, demultiplex and digest
koen
parents:
diff changeset
80 enzyme="BssHII"
062399f3787f new version of gbsx: v1.2 with barcodeGenerator, demultiplex and digest
koen
parents:
diff changeset
81 cutsite="G^CGCGC"
062399f3787f new version of gbsx: v1.2 with barcodeGenerator, demultiplex and digest
koen
parents:
diff changeset
82 enzyme2="MspI"
062399f3787f new version of gbsx: v1.2 with barcodeGenerator, demultiplex and digest
koen
parents:
diff changeset
83 cutsite2="C^CGG"
062399f3787f new version of gbsx: v1.2 with barcodeGenerator, demultiplex and digest
koen
parents:
diff changeset
84 ;;
062399f3787f new version of gbsx: v1.2 with barcodeGenerator, demultiplex and digest
koen
parents:
diff changeset
85 FseI-MspI)
062399f3787f new version of gbsx: v1.2 with barcodeGenerator, demultiplex and digest
koen
parents:
diff changeset
86 dualEnzyme="1"
062399f3787f new version of gbsx: v1.2 with barcodeGenerator, demultiplex and digest
koen
parents:
diff changeset
87 enzyme="FseI"
062399f3787f new version of gbsx: v1.2 with barcodeGenerator, demultiplex and digest
koen
parents:
diff changeset
88 cutsite="GGCCGG^CC"
062399f3787f new version of gbsx: v1.2 with barcodeGenerator, demultiplex and digest
koen
parents:
diff changeset
89 enzyme2="MspI"
062399f3787f new version of gbsx: v1.2 with barcodeGenerator, demultiplex and digest
koen
parents:
diff changeset
90 cutsite2="C^CGG"
062399f3787f new version of gbsx: v1.2 with barcodeGenerator, demultiplex and digest
koen
parents:
diff changeset
91 ;;
062399f3787f new version of gbsx: v1.2 with barcodeGenerator, demultiplex and digest
koen
parents:
diff changeset
92 SalI-MspI)
062399f3787f new version of gbsx: v1.2 with barcodeGenerator, demultiplex and digest
koen
parents:
diff changeset
93 dualEnzyme="1"
062399f3787f new version of gbsx: v1.2 with barcodeGenerator, demultiplex and digest
koen
parents:
diff changeset
94 enzyme="SalI"
062399f3787f new version of gbsx: v1.2 with barcodeGenerator, demultiplex and digest
koen
parents:
diff changeset
95 cutsite="G^TCGAC"
062399f3787f new version of gbsx: v1.2 with barcodeGenerator, demultiplex and digest
koen
parents:
diff changeset
96 enzyme2="MspI"
062399f3787f new version of gbsx: v1.2 with barcodeGenerator, demultiplex and digest
koen
parents:
diff changeset
97 cutsite2="C^CGG"
062399f3787f new version of gbsx: v1.2 with barcodeGenerator, demultiplex and digest
koen
parents:
diff changeset
98 ;;
062399f3787f new version of gbsx: v1.2 with barcodeGenerator, demultiplex and digest
koen
parents:
diff changeset
99 ApoI)
062399f3787f new version of gbsx: v1.2 with barcodeGenerator, demultiplex and digest
koen
parents:
diff changeset
100 enzyme="ApoI"
062399f3787f new version of gbsx: v1.2 with barcodeGenerator, demultiplex and digest
koen
parents:
diff changeset
101 cutsite="R^AATTY"
062399f3787f new version of gbsx: v1.2 with barcodeGenerator, demultiplex and digest
koen
parents:
diff changeset
102 ;;
062399f3787f new version of gbsx: v1.2 with barcodeGenerator, demultiplex and digest
koen
parents:
diff changeset
103 BamHI)
062399f3787f new version of gbsx: v1.2 with barcodeGenerator, demultiplex and digest
koen
parents:
diff changeset
104 enzyme="BamHI"
062399f3787f new version of gbsx: v1.2 with barcodeGenerator, demultiplex and digest
koen
parents:
diff changeset
105 cutsite="G^GATCC"
062399f3787f new version of gbsx: v1.2 with barcodeGenerator, demultiplex and digest
koen
parents:
diff changeset
106 ;;
062399f3787f new version of gbsx: v1.2 with barcodeGenerator, demultiplex and digest
koen
parents:
diff changeset
107 MseI)
062399f3787f new version of gbsx: v1.2 with barcodeGenerator, demultiplex and digest
koen
parents:
diff changeset
108 enzyme="MseI"
062399f3787f new version of gbsx: v1.2 with barcodeGenerator, demultiplex and digest
koen
parents:
diff changeset
109 cutsite="T^TAA"
062399f3787f new version of gbsx: v1.2 with barcodeGenerator, demultiplex and digest
koen
parents:
diff changeset
110 ;;
062399f3787f new version of gbsx: v1.2 with barcodeGenerator, demultiplex and digest
koen
parents:
diff changeset
111 Sau3AI)
062399f3787f new version of gbsx: v1.2 with barcodeGenerator, demultiplex and digest
koen
parents:
diff changeset
112 enzyme="Sau3AI"
062399f3787f new version of gbsx: v1.2 with barcodeGenerator, demultiplex and digest
koen
parents:
diff changeset
113 cutsite="^GATC"
062399f3787f new version of gbsx: v1.2 with barcodeGenerator, demultiplex and digest
koen
parents:
diff changeset
114 ;;
062399f3787f new version of gbsx: v1.2 with barcodeGenerator, demultiplex and digest
koen
parents:
diff changeset
115 RBSTA)
062399f3787f new version of gbsx: v1.2 with barcodeGenerator, demultiplex and digest
koen
parents:
diff changeset
116 enzyme="RBSTA"
062399f3787f new version of gbsx: v1.2 with barcodeGenerator, demultiplex and digest
koen
parents:
diff changeset
117 cutsite="^TA"
062399f3787f new version of gbsx: v1.2 with barcodeGenerator, demultiplex and digest
koen
parents:
diff changeset
118 ;;
062399f3787f new version of gbsx: v1.2 with barcodeGenerator, demultiplex and digest
koen
parents:
diff changeset
119 RBSCG)
062399f3787f new version of gbsx: v1.2 with barcodeGenerator, demultiplex and digest
koen
parents:
diff changeset
120 enzyme="RBSCG"
062399f3787f new version of gbsx: v1.2 with barcodeGenerator, demultiplex and digest
koen
parents:
diff changeset
121 cutsite="^CG"
062399f3787f new version of gbsx: v1.2 with barcodeGenerator, demultiplex and digest
koen
parents:
diff changeset
122 ;;
062399f3787f new version of gbsx: v1.2 with barcodeGenerator, demultiplex and digest
koen
parents:
diff changeset
123 NspI)
062399f3787f new version of gbsx: v1.2 with barcodeGenerator, demultiplex and digest
koen
parents:
diff changeset
124 enzyme="NspI"
062399f3787f new version of gbsx: v1.2 with barcodeGenerator, demultiplex and digest
koen
parents:
diff changeset
125 cutsite="RCATG^Y"
062399f3787f new version of gbsx: v1.2 with barcodeGenerator, demultiplex and digest
koen
parents:
diff changeset
126 ;;
062399f3787f new version of gbsx: v1.2 with barcodeGenerator, demultiplex and digest
koen
parents:
diff changeset
127 AvaII)
062399f3787f new version of gbsx: v1.2 with barcodeGenerator, demultiplex and digest
koen
parents:
diff changeset
128 enzyme="AvaII"
062399f3787f new version of gbsx: v1.2 with barcodeGenerator, demultiplex and digest
koen
parents:
diff changeset
129 cutsite="G^GWCC"
062399f3787f new version of gbsx: v1.2 with barcodeGenerator, demultiplex and digest
koen
parents:
diff changeset
130 ;;
062399f3787f new version of gbsx: v1.2 with barcodeGenerator, demultiplex and digest
koen
parents:
diff changeset
131 esac
062399f3787f new version of gbsx: v1.2 with barcodeGenerator, demultiplex and digest
koen
parents:
diff changeset
132
062399f3787f new version of gbsx: v1.2 with barcodeGenerator, demultiplex and digest
koen
parents:
diff changeset
133 extraparameters="";
062399f3787f new version of gbsx: v1.2 with barcodeGenerator, demultiplex and digest
koen
parents:
diff changeset
134 if [ "$dualEnzyme" != "0" ];
062399f3787f new version of gbsx: v1.2 with barcodeGenerator, demultiplex and digest
koen
parents:
diff changeset
135 then
062399f3787f new version of gbsx: v1.2 with barcodeGenerator, demultiplex and digest
koen
parents:
diff changeset
136 extraparameters="-E $enzyme2 -D $cutsite2";
062399f3787f new version of gbsx: v1.2 with barcodeGenerator, demultiplex and digest
koen
parents:
diff changeset
137 fi
062399f3787f new version of gbsx: v1.2 with barcodeGenerator, demultiplex and digest
koen
parents:
diff changeset
138
062399f3787f new version of gbsx: v1.2 with barcodeGenerator, demultiplex and digest
koen
parents:
diff changeset
139 perl $GBSX_PATH/GBSX_digest.pl -f list.txt -l $length -d $cutsite -e $enzyme $extraparameters -n $min_size -m $max_size;
062399f3787f new version of gbsx: v1.2 with barcodeGenerator, demultiplex and digest
koen
parents:
diff changeset
140
062399f3787f new version of gbsx: v1.2 with barcodeGenerator, demultiplex and digest
koen
parents:
diff changeset
141 rm *.fa;
062399f3787f new version of gbsx: v1.2 with barcodeGenerator, demultiplex and digest
koen
parents:
diff changeset
142 rm list.txt;
062399f3787f new version of gbsx: v1.2 with barcodeGenerator, demultiplex and digest
koen
parents:
diff changeset
143
062399f3787f new version of gbsx: v1.2 with barcodeGenerator, demultiplex and digest
koen
parents:
diff changeset
144 if [ "$dualEnzyme" != "0" ];
062399f3787f new version of gbsx: v1.2 with barcodeGenerator, demultiplex and digest
koen
parents:
diff changeset
145 then
062399f3787f new version of gbsx: v1.2 with barcodeGenerator, demultiplex and digest
koen
parents:
diff changeset
146 cat "genome."$enzyme"."$enzyme2"."$length"nt.digest.bed" > $digest_bed;
062399f3787f new version of gbsx: v1.2 with barcodeGenerator, demultiplex and digest
koen
parents:
diff changeset
147 cat "genome."$enzyme"."$enzyme2"."$length"nt.digest_results" > $digest_result;
062399f3787f new version of gbsx: v1.2 with barcodeGenerator, demultiplex and digest
koen
parents:
diff changeset
148 else
062399f3787f new version of gbsx: v1.2 with barcodeGenerator, demultiplex and digest
koen
parents:
diff changeset
149 cat "genome."$enzyme"."$length"nt.digest.bed" > $digest_bed;
062399f3787f new version of gbsx: v1.2 with barcodeGenerator, demultiplex and digest
koen
parents:
diff changeset
150 cat "genome."$enzyme"."$length"nt.digest_results" > $digest_result;
062399f3787f new version of gbsx: v1.2 with barcodeGenerator, demultiplex and digest
koen
parents:
diff changeset
151 fi
062399f3787f new version of gbsx: v1.2 with barcodeGenerator, demultiplex and digest
koen
parents:
diff changeset
152
062399f3787f new version of gbsx: v1.2 with barcodeGenerator, demultiplex and digest
koen
parents:
diff changeset
153