Xmipp2coord

From Relion
Revision as of 12:38, 26 March 2013 by Sjors Scheres (talk | contribs)
Jump to navigation Jump to search

  1. !/usr/bin/env csh

if ($# == 3 ) then

set xmdfile = $1
set tablename = $2
set downsample = $3
relion_star_printtable ${xmdfile} ${tablename} _micrograph _xcoor _ycoor | awk -F"/" '{print $NF}' | sort > tt.dat
foreach mic (`cat tt.dat | awk '{print $1}' | uniq`)
  set coordfile=`echo ${mic} | sed 's|.mrc|.coord|'`
  echo "Creating " $coordfile " ... "
  echo "        x         y      density" > ${coordfile}
  grep ${mic} tt.dat | awk -v"down=${downsample}" '{print down*$2, down*$3, "1.0"}' >> ${coordfile}
end
rm -f tt.dat
echo "Done!"

else

echo "Usage: " $0 "<input xmd file> <tablename> <downsamplefactor>"
echo "Run this script in the directory where all your mrc micrographs are"

endif