REFERENCE DATA SET: Difference between revisions

From XDSwiki
Jump to navigation Jump to search
No edit summary
m use the word "pseudo" in the description so the article can more easily be found
 
(3 intermediate revisions by the same user not shown)
Line 1: Line 1:
Sometimes one wants to use a REFERENCE_DATA_SET which was not itself written out by XDS or XSCALE.
Sometimes one wants to use a REFERENCE_DATA_SET which was not itself written out by XDS or XSCALE, but was created by a different program. Since it is then not a true XDS_ASCII format file, we could call this a pseudo XDS_ASCII file.


For a file to be accepted as a REFERENCE_DATA_SET by XDS, it must minimally look like:
For a file to be accepted as a REFERENCE_DATA_SET by XDS, it must minimally look like:
Line 26: Line 26:
calc col I-model = col F-model col F-model *
calc col I-model = col F-model col F-model *
write I-model.mtz col I-model
write I-model.mtz col I-model
quit
EOF
EOF
echo dump to ASCII format:
echo dump to ASCII format:
Line 45: Line 46:
<pre>
<pre>
!FORMAT=XDS_ASCII
!FORMAT=XDS_ASCII
!UNIT_CELL_CONSTANTS= 78 78 78 90 90 90 ! fill in correct values
!SPACE_GROUP_NUMBER= 199                ! fill in correct spacegroup number
!NUMBER_OF_ITEMS_IN_EACH_DATA_RECORD=  5
!NUMBER_OF_ITEMS_IN_EACH_DATA_RECORD=  5
!ITEM_H=1
!ITEM_H=1
Line 60: Line 63:
...
...
!END_OF_DATA
!END_OF_DATA
</pre>
Such a file can be obtained e.g. with
<pre>
#!/bin/bash
echo square amplitudes:
sftools <<EOF
read $1
select col FOBS = present
calc col IOBS = col FOBS col FOBS *
calc col SIGIOBS = col FOBS col SIGFOBS *
calc col SIGIOBS = col SIGIOBS 2 *
write $1.mtz col IOBS SIGIOBS
EOF
echo dump to ASCII format:
mtzdump hklin $1.mtz > temp.hkl <<EOF
nref 10000000
end
EOF
echo prepare XDS_ASCII.HKL:
echo \!FORMAT=XDS_ASCII > $1.hkl
echo \!UNIT_CELL_CONSTANTS=$(grep -A1 dataset$ temp.hkl|tail -1) >> $1.hkl
echo \!SPACE_GROUP_NUMBER=$(awk '/Space group/{gsub(/\)/,"");print $7}' temp.hkl) >> $1.hkl
echo \!ITEM_H=1  >> $1.hkl
echo \!ITEM_K=2  >> $1.hkl
echo \!ITEM_L=3  >> $1.hkl
echo \!ITEM_IOBS=4  >> $1.hkl
echo \!ITEM_SIGMA\(IOBS\)=5  >> $1.hkl
echo \!END_OF_HEADER  >> $1.hkl
echo pick reflection info from temp.hkl:
awk '/LIST OF REFLECTIONS/,/<B><FONT COLOR=/' temp.hkl | tail -n +4 | head -n -1 | awk '{print $0,1}' >> $1.hkl
echo \!END_OF_DATA  >> $1.hkl
echo $1.hkl is now ready to be used as XDS_ASCII.HKL
rm temp.hkl $1.mtz
</pre>
</pre>

Latest revision as of 18:56, 16 June 2025

Sometimes one wants to use a REFERENCE_DATA_SET which was not itself written out by XDS or XSCALE, but was created by a different program. Since it is then not a true XDS_ASCII format file, we could call this a pseudo XDS_ASCII file.

For a file to be accepted as a REFERENCE_DATA_SET by XDS, it must minimally look like:

!FORMAT=XDS_ASCII
!END_OF_HEADER
   1   0   4  48445. 983.361   
   1   0   5 2124.59 283.825  
   1   0   6  17955. 493.356   
   1   0   7  19328. 510.718   
   1   0   8  87172. 3437.40   
...
...
!END_OF_DATA

The columns do not have a specified width, and are separated by a blank (Fortran's free format). Additional columns besides h k l I sigI will be ignored. Anomalous data in that file will be treated as required by the setting of FRIEDEL'S_LAW in XDS.INP.

Please note that the REFERENCE_DATA_SET will only be used if SPACE_GROUP_NUMBER > 0, and proper UNIT_CELL_CONSTANTS are specified in XDS.INP !

Such a file, which I would call "fake XDS_ASCII" can be obtained with a little effort. As an example, the following assumes existence of a MTZ file refine.mtz containing column F-model:

echo square model amplitudes:
sftools <<EOF
read refine.mtz
select col F-model = present
calc col I-model = col F-model col F-model *
write I-model.mtz col I-model
quit
EOF
echo dump to ASCII format:
mtzdump hklin I-model.mtz > temp.hkl <<EOF
nref 10000000
end
EOF
echo prepare I-model.hkl:
echo \!FORMAT=XDS_ASCII > I-model.hkl
echo \!END_OF_HEADER   >> I-model.hkl
echo pick reflection info from temp.hkl:
awk '/LIST OF REFLECTIONS/,/<B><FONT COLOR=/' temp.hkl | tail -n +4 | head -n -1 | awk '{print $0,1}' >> I-model.hkl
echo \!END_OF_DATA   >> I-model.hkl
echo I-model.hkl is now ready to be used as REFERENCE_DATA_SET
rm temp.hkl I-model.mtz

For use with XSCALE, the file must look like e.g.:

!FORMAT=XDS_ASCII
!UNIT_CELL_CONSTANTS= 78 78 78 90 90 90 ! fill in correct values
!SPACE_GROUP_NUMBER= 199                ! fill in correct spacegroup number
!NUMBER_OF_ITEMS_IN_EACH_DATA_RECORD=   5
!ITEM_H=1
!ITEM_K=2
!ITEM_L=3
!ITEM_IOBS=4
!ITEM_SIGMA(IOBS)=5
!END_OF_HEADER
   1   0   4  48445. 983.361   
   1   0   5 2124.59 283.825  
   1   0   6  17955. 493.356   
   1   0   7  19328. 510.718   
   1   0   8  87172. 3437.40   
...
...
!END_OF_DATA

Such a file can be obtained e.g. with

#!/bin/bash
echo square amplitudes:
sftools <<EOF
read $1
select col FOBS = present
calc col IOBS = col FOBS col FOBS *
calc col SIGIOBS = col FOBS col SIGFOBS *
calc col SIGIOBS = col SIGIOBS 2 *
write $1.mtz col IOBS SIGIOBS
EOF
echo dump to ASCII format:
mtzdump hklin $1.mtz > temp.hkl <<EOF
nref 10000000
end
EOF
echo prepare XDS_ASCII.HKL:
echo \!FORMAT=XDS_ASCII > $1.hkl
echo \!UNIT_CELL_CONSTANTS=$(grep -A1 dataset$ temp.hkl|tail -1) >> $1.hkl
echo \!SPACE_GROUP_NUMBER=$(awk '/Space group/{gsub(/\)/,"");print $7}' temp.hkl) >> $1.hkl
echo \!ITEM_H=1   >> $1.hkl
echo \!ITEM_K=2   >> $1.hkl
echo \!ITEM_L=3   >> $1.hkl
echo \!ITEM_IOBS=4   >> $1.hkl
echo \!ITEM_SIGMA\(IOBS\)=5   >> $1.hkl
echo \!END_OF_HEADER   >> $1.hkl
echo pick reflection info from temp.hkl:
awk '/LIST OF REFLECTIONS/,/<B><FONT COLOR=/' temp.hkl | tail -n +4 | head -n -1 | awk '{print $0,1}' >> $1.hkl
echo \!END_OF_DATA   >> $1.hkl
echo $1.hkl is now ready to be used as XDS_ASCII.HKL
rm temp.hkl $1.mtz