Skip to content

Instantly share code, notes, and snippets.

@jmbr
Created January 26, 2022 03:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jmbr/2c86ebc308c82c713ed966ae896158c2 to your computer and use it in GitHub Desktop.
Save jmbr/2c86ebc308c82c713ed966ae896158c2 to your computer and use it in GitHub Desktop.
Protein (PDB) viewer written in AWK
#!/usr/bin/awk -f
BEGIN {
gnuplot = "gnuplot -p";
print "set terminal wxt noraise" | gnuplot;
print "set view equal xyz" | gnuplot;
print "set linetype 1 linecolor palette z linewidth 5" | gnuplot;
print "unset tics" | gnuplot;
print "unset border" | gnuplot;
print "unset colorbox" | gnuplot;
print "splot '-' notitle with lines" | gnuplot;
}
$1 == "ATOM" && $3 == "CA" {
printf "%f %f %f\n", $7, $8, $9 | gnuplot;
}
END {
print "e\n" | gnuplot;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment