Skip to content

Commit 76cbfdc

Browse files
author
Herbert Bernstein
committed
merge with Dale Kreitler's pa_sg_res_cut -- HJB
1 parent ae8571c commit 76cbfdc

File tree

2 files changed

+78
-11
lines changed

2 files changed

+78
-11
lines changed

README.md

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,27 @@
11
pa_sg_res
22
by Wuxian Shi, 13 Feb 2017
33
adapted to keyword arguments by H. J. Bernstein
4+
window args added by D. Kreitler
5+
merged with ps_sg_res_cut by H. J. Bernstein
46

5-
pa_sg_res [-r<reslow>] [-R<reshigh>] [-S<spacegroup>] [-i<infile>] [-o<outfile>] [-l<logfile>]
6-
"infile defaults to XDS_ASCII.HKL, oufile to aimless.mtz
7+
pa_sg_res [-1<first_frame>] [-N<frame_cutoff>] [-R<reslow>] [-r<reshigh>]
8+
[-S<spacegroup>] [-i<infile>] [-o<outfile>] [-l<logfile>]
9+
10+
-h produces a short help messaage< --help produces this help message
11+
12+
pa_sg_res is a bash shell script wrapper for aimless and pointless, for
13+
the downstream processing of fast_dp output. This script allows for trimming
14+
integrated reflection files (from XDS) based on resolution and frame number
15+
in addition to spacegroup assignment/enforcement.
16+
17+
Caveat: The impact of crystal misalignment and/or unreliable indexing in the
18+
first few frames of data collection may still be present even if those frames
19+
are excluded from pointless/aimless. In such cases re-running fast_dp is
20+
recommended.
21+
22+
Input arg variables match those of fast_dp (where overlap occurs)
23+
Input arg variables changed to match pa_sg_res_cut (N for f, swap r and R)
24+
25+
infile defaults to XDS_ASCII.HKL, outfile to aimless.mtz
26+
logfile in pa_sg_res.log
727

pa_sg_res

Lines changed: 56 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,11 @@
33
# pa_sg_res
44
# By Wuxian Shi, 13 Feb 2017
55
# 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
711

812
tempfiles=( )
913
cleanup() {
@@ -46,16 +50,39 @@ tempfiles+=( "/tmp/aimless$$.log" )
4650

4751
if [ XX$1 == "XX--help" ]
4852
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
5172
exit -1
5273
fi
5374

54-
while getopts ":r:R:S:h:o:l:" opt; do
75+
while getopts "1:f:N:R:r:S:ho:l:" opt; do
5576
case $opt in
56-
r) reslow="$OPTARG"
77+
1) first_frame="$OPTARG"
78+
;;
79+
f) frame_cutoff="$OPTARG"
80+
;;
81+
N) frame_cutoff="$OPTARG"
5782
;;
58-
R) reshigh="$OPTARG"
83+
R) reslow="$OPTARG"
84+
;;
85+
r) reshigh="$OPTARG"
5986
;;
6087
S) spacegroup="$OPTARG"
6188
;;
@@ -66,8 +93,11 @@ while getopts ":r:R:S:h:o:l:" opt; do
6693
l) logfile="$OPTARG"
6794
;;
6895
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
71101
exit -1
72102
;;
73103
\?) echo "Invalid option -$OPTARG" >&2
@@ -97,6 +127,7 @@ if [ "${spacegroup}XX" == "XX" ]
97127
spacegroup_arg=${spacegroup}
98128
fi
99129

130+
100131
resolution_arg="resolution low $reslow high $reshigh"
101132
if [ "${reslow}XX" == "XX" ]
102133
then
@@ -108,7 +139,21 @@ if [ "${reslow}XX" == "XX" ]
108139
elif [ "${reshigh}XX" == "XX" ]
109140
then
110141
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
112157

113158

114159

@@ -118,6 +163,8 @@ lla
118163

119164
aimless hklin /tmp/pa_sg_res_pointless$$.mtz hklout $outfile << eof | tee /tmp/aimless$$.log
120165
$resolution_arg
166+
$frame_cutoff_arg
167+
$first_frame_arg
121168
onlymerge
122169
eof
123170

0 commit comments

Comments
 (0)