3
3
# pa_sg_res
4
4
# By Wuxian Shi, 13 Feb 2017
5
5
# adapted to keyword arguments by H. J. Bernstein
6
- #
6
+ # window args added by D. Kreitler
7
+ # merged with ps_sg_res_cut by H. J. Bernstein
8
+ if [ " $CCP4 " XX == XX ]; then
9
+ . /usr/local/crys-local/ccp4-7.0/bin/ccp4.setup-sh
10
+ fi
7
11
8
12
tempfiles=( )
9
13
cleanup () {
@@ -46,16 +50,39 @@ tempfiles+=( "/tmp/aimless$$.log" )
46
50
47
51
if [ XX$1 == " XX--help" ]
48
52
then
49
- echo " pa_sg_res [-r<reslow>] [-R<reshigh>] [-S<spacegroup>] [-i<infile>] [-o<outfile>] [-l<logfile>]" >&2
50
- echo " infile defaults to XDS_ASCII.HKL, oufile to aimless.mtz" >&2
53
+ echo " pa_sg_res [-1<first_frame>] [-N<frame_cutoff>] [-R<reslow>] [-r<reshigh>]" >&2
54
+ echo " [-S<spacegroup>] [-i<infile>] [-o<outfile>] [-l<logfile>]" >&2
55
+ echo " " >&2
56
+ echo " -h produces a short help messaage< --help produces this help message" >&2
57
+ echo " " >&2
58
+ echo " pa_sg_res is a bash shell script wrapper for aimless and pointless, for" >&2
59
+ echo " the downstream processing of fast_dp output. This script allows for trimming" >&2
60
+ echo " integrated reflection files (from XDS) based on resolution and frame number" >&2
61
+ echo " in addition to spacegroup assignment/enforcement." >&2
62
+ echo " " >&2
63
+ echo " Caveat: The impact of crystal misalignment and/or unreliable indexing in the" >&2
64
+ echo " first few frames of data collection may still be present even if those frames" >&2
65
+ echo " are excluded from pointless/aimless. In such cases re-running fast_dp is" >&2
66
+ echo " recommended." >&2
67
+ echo " " >&2
68
+ echo " Input arg variables match those of fast_dp (where overlap occurs)" >&2
69
+ echo " Input arg variables changed to match pa_sg_res_cut (N for f, swap r and R)" >&2
70
+ echo " " >&2
71
+ echo " infile defaults to XDS_ASCII.HKL, outfile to aimless.mtz" >&2
51
72
exit -1
52
73
fi
53
74
54
- while getopts " :r:R:S:h:o :l:" opt; do
75
+ while getopts " 1:f:N:R:r:S:ho :l:" opt; do
55
76
case $opt in
56
- r) reslow=" $OPTARG "
77
+ 1) first_frame=" $OPTARG "
78
+ ;;
79
+ f) frame_cutoff=" $OPTARG "
80
+ ;;
81
+ N) frame_cutoff=" $OPTARG "
57
82
;;
58
- R) reshigh=" $OPTARG "
83
+ R) reslow=" $OPTARG "
84
+ ;;
85
+ r) reshigh=" $OPTARG "
59
86
;;
60
87
S) spacegroup=" $OPTARG "
61
88
;;
@@ -66,8 +93,11 @@ while getopts ":r:R:S:h:o:l:" opt; do
66
93
l) logfile=" $OPTARG "
67
94
;;
68
95
h)
69
- echo " pa_sg_res [-r<reslow>] [-R<reshigh>] [-S<spacegroup>] [-i<infile>] [-o<outfile>] [-l<logfile>]" >&2
70
- echo " file defaults to XDS_ASCII.HKL" >&2
96
+ echo " pa_sg_res [-1<first_frame>] [-N<frame_cutoff>][-R<reslow>] [-r<reshigh>] \\ " >&2
97
+ echo " [-S<spacegroup>] [-i<infile>] [-o<outfile>] [-l<logfile>]" >&2
98
+ echo " infile defaults to XDS_ASCII.HKL" >&2
99
+ echo " -h produces this message" >&2
100
+ echo " --help produces a longer messages" >&2
71
101
exit -1
72
102
;;
73
103
\? ) echo " Invalid option -$OPTARG " >&2
@@ -97,6 +127,7 @@ if [ "${spacegroup}XX" == "XX" ]
97
127
spacegroup_arg=${spacegroup}
98
128
fi
99
129
130
+
100
131
resolution_arg=" resolution low $reslow high $reshigh "
101
132
if [ " ${reslow} XX" == " XX" ]
102
133
then
@@ -108,7 +139,21 @@ if [ "${reslow}XX" == "XX" ]
108
139
elif [ " ${reshigh} XX" == " XX" ]
109
140
then
110
141
resolution_arg=" resolution low $reslow "
111
- fi
142
+ elif (( $(echo "${reslow} < ${reshigh} " | bc - l) )) ; then
143
+ resolution_arg=" resolution low $reshigh high $reslow "
144
+ fi
145
+
146
+ frame_cutoff_arg=" exclude batch $frame_cutoff TO 1000000"
147
+ if [ " ${frame_cutoff} XX" == " XX" ]
148
+ then
149
+ frame_cutoff_arg=${frame_cutoff}
150
+ fi
151
+
152
+ first_frame_arg=" exclude batch 1 to $first_frame "
153
+ if [ " ${first_frame} XX" == " XX" ]
154
+ then
155
+ first_frame_arg=${first_frame}
156
+ fi
112
157
113
158
114
159
118
163
119
164
aimless hklin /tmp/pa_sg_res_pointless$$ .mtz hklout $outfile << eof | tee /tmp/aimless$$ .log
120
165
$resolution_arg
166
+ $frame_cutoff_arg
167
+ $first_frame_arg
121
168
onlymerge
122
169
eof
123
170
0 commit comments