Make orientational distribution plot.csh: Difference between revisions

From Relion
Jump to navigation Jump to search
(Created page with "<code> #!/usr/bin/env csh set rootname=$1 set iter=$2 set scale_sphere_size = 10 set modelstar=${rootname}_it0${iter}_model.star set samplstar=${rootname}_sampling.star set opt...")
 
No edit summary
Line 1: Line 1:
<code>
<code>
#!/usr/bin/env csh
#!/usr/bin/env csh
set rootname=$1
set rootname=$1
set iter=$2
set iter=$2


set scale_sphere_size = 10
set scale_sphere_size = 10


set modelstar=${rootname}_it0${iter}_model.star
set modelstar=${rootname}_it0${iter}_model.star
set samplstar=${rootname}_sampling.star
set samplstar=${rootname}_sampling.star
set optstar=${rootname}_it0${iter}_optimiser.star
set optstar=${rootname}_it0${iter}_optimiser.star


set nrclasses = `grep _rlnNrClasses ${modelstar}|awk '{print $2}'`
set nrclasses = `grep _rlnNrClasses ${modelstar}|awk '{print $2}'`
set radius = `grep _rlnParticleDiameter ${optstar} | awk '{print $2/2}'`
set radius = `grep _rlnParticleDiameter ${optstar} | awk '{print $2/2}'`
relion_star_printtable ${samplstar} data_sampling_directions | awk '{i++; print i, $0}' > tmp0
relion_star_printtable ${samplstar} data_sampling_directions | awk '{i++; print i, $0}' > tmp0
set iclass = 0
set iclass = 0
while ($iclass < $nrclasses)
while ($iclass < $nrclasses)
@ iclass++
  @ iclass++
relion_star_printtable ${modelstar} data_model_pdf_orient_class_${iclass} | awk '{i++; print i, $0}' > tmp1
  relion_star_printtable ${modelstar} data_model_pdf_orient_class_${iclass} | awk '{i++; print i, $0}' > tmp1
join tmp0 tmp1 |  awk '{print $1,6,$2,$3,0,0,0,$4}' > tmp2
  join tmp0 tmp1 |  awk '{print $1,6,$2,$3,0,0,0,$4}' > tmp2
set bildfile=${rootname}_it0${iter}_class${iclass}_orientdist.bild
  set bildfile=${rootname}_it0${iter}_class${iclass}_orientdist.bild
xmipp_angular_distribution_show -ang tmp2 -bild ${bildfile} -wcol 5 -r ${scale_sphere_size} -R ${radius}
  xmipp_angular_distribution_show -ang tmp2 -bild ${bildfile} -wcol 5 -r ${scale_sphere_size} -R ${radius}
echo "written: " ${bildfile}
  echo "written: " ${bildfile}
end
end
rm -f tmp0 tmp1 tmp2
rm -f tmp0 tmp1 tmp2
echo "done! Use UCSF Chimera to visualise the BILD files (you may need to change the origins of your maps in the Volume Viewer window"
echo "done! Use UCSF Chimera to visualise the BILD files (you may need to change the origins of your maps in the Volume Viewer window"


</code>
</code>

Revision as of 15:46, 16 February 2012

#!/usr/bin/env csh
set rootname=$1
set iter=$2
set scale_sphere_size = 10
set modelstar=${rootname}_it0${iter}_model.star
set samplstar=${rootname}_sampling.star
set optstar=${rootname}_it0${iter}_optimiser.star
set nrclasses = `grep _rlnNrClasses ${modelstar}|awk '{print $2}'`
set radius = `grep _rlnParticleDiameter ${optstar} | awk '{print $2/2}'`
relion_star_printtable ${samplstar} data_sampling_directions | awk '{i++; print i, $0}' > tmp0
set iclass = 0
while ($iclass < $nrclasses)
 @ iclass++
 relion_star_printtable ${modelstar} data_model_pdf_orient_class_${iclass} | awk '{i++; print i, $0}' > tmp1
 join tmp0 tmp1 |  awk '{print $1,6,$2,$3,0,0,0,$4}' > tmp2
 set bildfile=${rootname}_it0${iter}_class${iclass}_orientdist.bild
 xmipp_angular_distribution_show -ang tmp2 -bild ${bildfile} -wcol 5 -r ${scale_sphere_size} -R ${radius}
 echo "written: " ${bildfile}
end
rm -f tmp0 tmp1 tmp2
echo "done! Use UCSF Chimera to visualise the BILD files (you may need to change the origins of your maps in the Volume Viewer window"