Print the shifts in individual atom positions: Difference between revisions
Jump to navigation
Jump to search
(Created page with 'This can be done with one command line (albeit a rather long one). Below is the code with (remove backslashes if pasting as a single line) grep 'ATOM\|HETATM' file1.pdb file2.p…') |
No edit summary |
||
Line 16: | Line 16: | ||
awk 'BEGIN {FIELDWIDTHS = "4 1 3 1 1 5 9"} {printf "%s %s %s %s %s\n", $3,$5,$6,$1,$7;}' | awk 'BEGIN {FIELDWIDTHS = "4 1 3 1 1 5 9"} {printf "%s %s %s %s %s\n", $3,$5,$6,$1,$7;}' | ||
Back to [[Useful scripts (aka smart piece of code)]] |
Revision as of 16:30, 10 December 2010
This can be done with one command line (albeit a rather long one). Below is the code with (remove backslashes if pasting as a single line)
grep 'ATOM\|HETATM' file1.pdb file2.pdb | \
grep -v REMARK | \
cut -d: -f 2 | \
cut -c 13-54 | \
sort | \
awk 'BEGIN {FIELDWIDTHS = "14 28"; pt=""} {if(pt==$1) print pr,$2; pt=$1; pr=$0;}' | \
awk 'BEGIN {FIELDWIDTHS = "14 4 8 8 8 5 8 8 8"} {printf "%s %8.4f\n",$1,sqrt(($3-$7)^2+($4-$8)^2+($5-$9)^2);}' | \
awk 'BEGIN {FIELDWIDTHS = "4 1 3 1 1 5 9"} {printf "%s %s %s %s %s\n", $3,$5,$6,$1,$7;}'