I think the following bash script will do the conversion. You need to edit out everything but the FSC you want, and also remove all the comments from the file, save this as a new file, then give it as the first argument to the script, with the desired output.xml as the output. This will use the partFSC column :-
I think the following bash script will do the conversion. You need to edit out everything but the FSC you want, and also remove all the comments from the file, save this as a new file, then give it as the first argument to the script, with the desired output.xml as the output. This will use the partFSC column :-
-------------------------------
#!/bin/bash
readarray all_lines < $1
one=1
echo '<fsc title="" xaxis="Resolution (A-1)" yaxis="Correlation Coefficient">' > $2
echo ' <coordinate>' >> $2
echo ' <x>0.0</x>' >> $2
echo ' <y>1.0</y>' >> $2
echo ' </coordinate>' >> $2
## now loop through the above array
for i in "${all_lines[@]}"
do
resolution=`echo $i | awk '{print $2}'`
spatial_freq=`calc -p 1/$resolution | cut -d'~' -f2`
fsc=`echo $i | awk '{print $5}'`
echo ' <coordinate>' >> $2
echo " <x>$spatial_freq</x>" >> $2
echo " <y>$fsc</y>" >> $2
echo " </coordinate>" >> $2
done
echo '</fsc>' >> $2
Dear Tim,
The output is given below. It is not giving a proper output. Can you please check
I am using the following command " script input.txt output.xml"
<fsc title="" xaxis="Resolution (A-1)" yaxis="Correlation Coefficient">
<coordinate>
<x>0.0</x>
<y>1.0</y>
</coordinate>
<coordinate>
<x>calc -p 1/</x>
<y></y>
</coordinate>
</fsc>
do you have calc installed?
if you just type calc in the terminal does it work?
if you just type calc in the terminal does it work?
It says command not found
Managed to convert using e2procxml.py program
Ok, for future reference - I think the above script should work if you install calc.