Xmipp2coord: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
No edit summary |
||
Line 1: | Line 1: | ||
<code> | <code> | ||
#!/usr/bin/env csh | #!/usr/bin/env csh | ||
# | # | ||
# | # | ||
if ($# == 3 ) then | 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 | else | ||
echo "Usage: " $0 "<input xmd file> <tablename> <downsamplefactor>" | |||
echo "Run this script in the directory where all your mrc micrographs are" | |||
endif | endif | ||
</code> | </code> |
Revision as of 12:38, 26 March 2013
#!/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