Skip to content

Commit

Permalink
Create subvolume fixed and cleaned
Browse files Browse the repository at this point in the history
  • Loading branch information
nikhilbiyani committed Dec 10, 2015
1 parent 3f101c2 commit 5f38c0c
Show file tree
Hide file tree
Showing 5 changed files with 157 additions and 69 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ source ${proc_2dx}/2dx_extend_map.com volume.map extended.map
echo "# IMAGE: extended.map <MAP: final map 3D, 2x2 unit cells>" >> LOGS/${scriptname}.results
#
if ( ${calculate_subvolume}x != "0x" ) then
source ${proc_2dx}/2dx_create_subvolume.com extended.map ${realcell} ${ALAT} 3D_sub.map
source ${proc_2dx}/2dx_create_subvolume.com ${calculate_subvolume} extended.map ${realcell} ${ALAT} 3D_sub.map
#
echo "# IMAGE-IMPORTANT: 3D_sub.map <MAP: 3D sub map>" >> LOGS/${scriptname}.results
#
Expand Down
4 changes: 2 additions & 2 deletions kernel/2dx_merge/scripts-merge3D/2dx_sharpenRefinedMap.script
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ if(${sharpening_algo} == "1") then
\rm -f ${bead_model_sub_map}
#
if ( ${calculate_subvolume}x != "0x" ) then
source ${proc_2dx}/2dx_create_subvolume.com ${bead_model_extended_map} ${realcell} ${ALAT} ${bead_model_sub_map}
source ${proc_2dx}/2dx_create_subvolume.com ${calculate_subvolume} ${bead_model_extended_map} ${realcell} ${ALAT} ${bead_model_sub_map}
#
echo "# IMAGE-IMPORTANT: ${bead_model_sub_map} <Bead model sub map>" >> LOGS/${scriptname}.results
endif
Expand Down Expand Up @@ -226,7 +226,7 @@ if(${sharpening_algo} != "0" || ${if_bfactor_sharpen} == "y") then
\rm -f ${sharpened_sub_map}
#
if ( ${calculate_subvolume}x != "0x" ) then
source ${proc_2dx}/2dx_create_subvolume.com ${sharpened_extended_map} ${realcell} ${ALAT} ${sharpened_sub_map}
source ${proc_2dx}/2dx_create_subvolume.com ${calculate_subvolume} ${sharpened_extended_map} ${realcell} ${ALAT} ${sharpened_sub_map}
#
echo "# IMAGE-IMPORTANT: ${sharpened_sub_map} <Sharpened sub map>" >> LOGS/${scriptname}.results
endif
Expand Down
4 changes: 2 additions & 2 deletions kernel/config/2dx_master.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -3789,12 +3789,12 @@ set npo_line2 = "MODE BELOW 0 DASHED 1 0.15 0"
# LABEL: Calculate Sub-Volume also?
# LEGEND: Switch, deciding if a smaller sub-volume should also be calculated. The details of the selection of the sub-volume have to be adjusted directly within the calling script. There are a few possible sub-scripts available. Choose one, or adjust one to your special needs.
# EXAMPLE: calculate_subvolume = "n"
# TYPE: Drop_Down_Menu "0=No;1=Yes, Sub-Volume Type 1 (MloK1);2==Yes, Sub-Volume Type 2 (CitS);3=Yes, Sub-Volume Type 3 (Alex);4=Yes, Sub-Volume Type 4 (Aqp);5=Yes, Sub-Volume Type 5 (ClC);6=Yes, Sub-Volume Type 6 (FhuA);7=Yes, Sub-Volume Type 7"
# TYPE: Drop_Down_Menu "0=No;1=Sub-Volume Type 1 (MloK1);2=Sub-Volume Type 2 (CitS);3=Sub-Volume Type 3 (Aqp);4=Sub-Volume Type 4(ClC);5=Sub-Volume Type 5 (FhuA)"
# HELP: http://2dx.org/documentation/2dx-software/parameters/Subvolume
# INHERITABLE_UPON_INIT: NO
# SYNC_WITH_UPPER_LEVEL: NO
# USERLEVEL: SIMPLE
set calculate_subvolume = "4"
set calculate_subvolume = "0"
#
# LABEL: Mask Sub-Volume with PDB file (Does not yet work)?
# LEGEND: Switch, deciding if the obtained sub-volue should be masked so that only the densities within a certain radius of a specified PDB file should be kept.
Expand Down
214 changes: 151 additions & 63 deletions kernel/proc/2dx_create_subvolume.com
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,20 @@
# 2dx_create_subvolume.com
# A script to create a subvolume from a ccp4 map (extended map)
# Usage:
# 2dx_create_subvolume.com <input_extended_map> <real_cell> <ALAT> <output_map>
# 2dx_create_subvolume.com <subvolume_type> <input_extended_map> <real_cell> <ALAT> <output_map>
#
# Example Usage:
# 2dx_create_subvolume.com input_extended.map 131,131 200 input_sub.map
# 2dx_create_subvolume.com 1 input_extended.map 131,131 200 input_sub.map
#
########################################################################
#-----------------------------------------------------------------------
# Prepare input and parameters
########################################################################
#-----------------------------------------------------------------------
#
set input_map = "${1}"
set realcell = "${2}"
set ALAT = "${3}"
set output_map = "${4}"
set calculate_subvolume = "${1}"
set input_map = "${2}"
set realcell = "${3}"
set ALAT = "${4}"
set output_map = "${5}"
#
set split = ($realcell:as/,/ /)
set cellx = $split[1]
Expand All @@ -27,83 +28,170 @@ set ALATm1 = `echo ${ALAT} | awk '{ s = $1 - 1 } END {print s}'`
#
set input_name = "`echo ${input_map} | cut -d'.' -f1`"
#
if ( ${calculate_subvolume}x != "0x" ) then
#
#
#############################################################################
# Set the Rotational and Translational properties for various subvolume types
#############################################################################
#
#
#
if ( ${calculate_subvolume}x == "1x" ) then
#------------------------------------------------------------------------
${proc_2dx}/linblock "Creating subvolume of ccp4 map ${input_map}."
${proc_2dx}/linblock "Creating subvolume with type MLOK1 for map ${input_map}."
#------------------------------------------------------------------------
set full_cell_map = "${input_name}_full_cell.map"
set maprot_rota = "0.0 0.0 45.0"
set maprot_trans = "0.0 -20.0 0.0"
#
\rm -f ${full_cell_map}
set middlex = "0.45"
set middley = "0.45"
set diam = "0.82"
#
set limxmin = `echo ${middlex} ${diam} | awk '{ s = $1 - ( $2 / 2.0 ) } END { print s }'`
set limxmax = `echo ${middlex} ${diam} | awk '{ s = $1 + ( $2 / 2.0 ) } END { print s }'`
set limymin = `echo ${middley} ${diam} | awk '{ s = $1 - ( $2 / 2.0 ) } END { print s }'`
set limymax = `echo ${middley} ${diam} | awk '{ s = $1 + ( $2 / 2.0 ) } END { print s }'`
set limzmin = "0.0"
set limzmax = "1.0"
#
endif
#
#
#
if ( ${calculate_subvolume}x == "2x" ) then
#------------------------------------------------------------------------
${proc_2dx}/linblock "MAPMASK - to produce map which covers full unit cell"
${proc_2dx}/linblock "Creating subvolume with type CITS for map ${input_map}."
#------------------------------------------------------------------------
${bin_ccp4}/mapmask mapin ${input_map} mapout ${full_cell_map} << eof
XYZLIM CELL
END
eof
set maprot_rota = "0.0 0.0 22.5"
set maprot_trans = "18.0 0.0 0.0"
set limxmin = "0.03"
set limxmax = "0.97"
set limymin = "0.1"
set limymax = "0.625"
set limzmin = "0.0"
set limzmax = "1.0"
#
endif
#
#
#
if ( ${calculate_subvolume}x == "3x" ) then
#------------------------------------------------------------------------
${proc_2dx}/linblock "MAPROT - to rotate volume for sub-volume preparation"
${proc_2dx}/linblock "Creating subvolume with type AQP for map ${input_map}."
#------------------------------------------------------------------------
set maprot_rota = "0.0 0.0 45.0"
set maprot_trans = "0.0 0.0 0.0"
set limxmin = "0.4"
set limxmax = "0.99"
set limymin = "0.4"
set limymax = "0.99"
set limzmin = "0.0"
set limzmax = "1.0"
#
set rot_map = "${input_name}_rotated.map"
#
echo ${rot_map}
#
\rm -f ${rot_map}
endif
#
#
#
if ( ${calculate_subvolume}x == "4x" ) then
#------------------------------------------------------------------------
${proc_2dx}/linblock "Creating subvolume with type CLC for map ${input_map}."
#------------------------------------------------------------------------
set maprot_rota = "0.0 0.0 52.5"
set maprot_trans = "70.0 -10.0 0.0"
set limxmin = "0.17"
set limxmax = "0.71"
set limymin = "0.05"
set limymax = "0.92"
set limzmin = "0.0"
set limzmax = "1.0"
#
set ALAT2 = `echo ${ALAT} | awk '{ s = $1 / 2.0 } END { print s }'`
endif
#
#
#
if ( ${calculate_subvolume}x == "5x" ) then
#------------------------------------------------------------------------
${proc_2dx}/linblock "Creating subvolume with type FHUA for map ${input_map}."
#------------------------------------------------------------------------
set maprot_rota = "0.0 0.0 0.0"
set maprot_trans = "0.0 0.0 0.0"
set limxmin = "-0.25"
set limxmax = "1.0"
set limymin = "-1.0"
set limymax = "0.25"
set limzmin = "-0.25"
set limzmax = "0.07"
#
${bin_ccp4}/maprot mapin ${full_cell_map} wrkout ${rot_map} << eot
endif
#
#
#
#
echo ":Rotating with: ${maprot_rota}"
echo ":Translating with: ${maprot_trans}"
echo ":Limits are: ${limxmin} to ${limxmax}, ${limymin} to ${limymax}, ${limzmin} to ${limzmax}"
#
#
#
#
############################################################################
# PREPARING VOLUMES
############################################################################
set full_cell_map = "${input_name}_full_cell.map"
#
\rm -f ${full_cell_map}
#
#------------------------------------------------------------------------
${proc_2dx}/linblock "MAPMASK - to produce map which covers full unit cell"
#------------------------------------------------------------------------
${bin_ccp4}/mapmask mapin ${input_map} mapout ${full_cell_map} << eof
XYZLIM CELL
END
eof
#
#------------------------------------------------------------------------
${proc_2dx}/linblock "MAPROT - to rotate volume for sub-volume preparation"
#------------------------------------------------------------------------
#
set rot_map = "${input_name}_rotated.map"
#
echo ${rot_map}
#
\rm -f ${rot_map}
#
set ALAT2 = `echo ${ALAT} | awk '{ s = $1 / 2.0 } END { print s }'`
#
${bin_ccp4}/maprot mapin ${full_cell_map} wrkout ${rot_map} << eot
MODE FROM
CELL WORK ${realcell} ${ALAT} 90.0 90.0 ${realang}
GRID WORK ${cellx} ${celly} ${ALAT}
XYZLIM 0 ${cellxm1} 0 ${cellym1} 0 ${ALATm1}
SYMM WORK 1
AVER
ROTA POLAR 0.0 0.0 45.0
TRANS 0.0 -20.0 0.0
ROTA POLAR ${maprot_rota}
TRANS ${maprot_trans}
eot
#
#
#------------------------------------------------------------------------
${proc_2dx}/linblock "MAPAMSK - to cut sub-volume"
#------------------------------------------------------------------------
#
# 0.7071 = 1/sqrt(2)
set middlex = "0.45"
set middley = "0.45"
set diam = "0.82"
#
set limxmin = `echo ${middlex} ${diam} | awk '{ s = $1 - ( $2 / 2.0 ) } END { print s }'`
set limxmax = `echo ${middlex} ${diam} | awk '{ s = $1 + ( $2 / 2.0 ) } END { print s }'`
set limymin = `echo ${middley} ${diam} | awk '{ s = $1 - ( $2 / 2.0 ) } END { print s }'`
set limymax = `echo ${middley} ${diam} | awk '{ s = $1 + ( $2 / 2.0 ) } END { print s }'`
#
echo ":Limits are ${limxmin} to ${limxmax}, ${limymin} to ${limymax}"
#
set processed_sub_map = "${input_name}_sub.map"
#
\rm -f ${processed_sub_map}
#
#
${bin_ccp4}/mapmask mapin ${rot_map} mapout ${processed_sub_map} << eof
#
#
#------------------------------------------------------------------------
${proc_2dx}/linblock "MAPAMSK - to cut sub-volume"
#------------------------------------------------------------------------
#
set processed_sub_map = "${input_name}_sub.map"
#
\rm -f ${processed_sub_map}
#
${bin_ccp4}/mapmask mapin ${rot_map} mapout ${processed_sub_map} << eof
AXIS X,Y,Z
scale factor 1
xyzlim ${limxmin} ${limxmax} ${limymin} ${limymax} 0.0 1.0
xyzlim ${limxmin} ${limxmax} ${limymin} ${limymax} ${limzmin} ${limzmax}
pad -100
SYMM 1
END
eof
#
#
#
\rm -f ${full_cell_map}
\rm -f ${rot_map}
\mv -f ${processed_sub_map} ${output_map}
#
endif

#############################################################################

#
#
\rm -f ${full_cell_map}
\rm -f ${rot_map}
\mv -f ${processed_sub_map} ${output_map}
#
2 changes: 1 addition & 1 deletion kernel/proc/2dx_refineMergedMap_sub.com
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ echo "# IMAGE-IMPORTANT: ${back_projected_extended_map} <Back-Projected extended
\rm -f ${back_projected_sub_map}
#
if ( ${calculate_subvolume}x != "0x" ) then
source ${proc_2dx}/2dx_create_subvolume.com ${back_projected_extended_map} ${realcell} ${ALAT} ${back_projected_sub_map}
source ${proc_2dx}/2dx_create_subvolume.com ${calculate_subvolume} ${back_projected_extended_map} ${realcell} ${ALAT} ${back_projected_sub_map}
#
echo "# IMAGE-IMPORTANT: ${back_projected_sub_map} <Back-Projected sub map>" >> LOGS/${scriptname}.results
#
Expand Down

0 comments on commit 5f38c0c

Please sign in to comment.