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