Skip to content

Instantly share code, notes, and snippets.

@quantixed
Created January 17, 2024 10:24
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 quantixed/72f8a42ca3e995c3dd8b53a79de44970 to your computer and use it in GitHub Desktop.
Save quantixed/72f8a42ca3e995c3dd8b53a79de44970 to your computer and use it in GitHub Desktop.
shell script to open each pdb file in a file tree, colour by chain and take a raytraced image
#!/bin/zsh
# Find all *.pdb files recursively
find . -name "*.pdb" | while read -r file; do
# Extract the filename without extension
filename=$(basename "$file" .pdb)
# Extract the name of the directory
dirname=$(dirname "$file")
# Concatenate the directory name and the filename, separated by an underscore
output="${dirname}_${filename}"
# Run the pymol command
pymol -qc "$file" -d "util.cbc; ray 1280, 1024; png ${output}.png; quit"
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment