You are here

Render a molecule from command line using VMD

export name="1hjm"
export tachyon="/usr/local/lib/vmd/tachyon_LINUX"

Create script using VMD

The result


ct10="axes location off"
ct15="display projection orthographic"
ct20="mol modstyle 0 0 NewCartoon"
ct30="mol modcolor 0 0 Structure"
ct35="scale by 1.5"
ct40="render Tachyon $name"

Assemble commands using indirect references and expansion

command=""
for t in ${!ct*}
do
eval command_line=\$$t
command="$command$command_line\n"
done

Pass the script into vmd and tachyon

printf "$command" | vmd -f ~/data/pdb/1HJM.pdb -size 800 800 -dispdev text -eofexit
${tachyon} -auto_skylight 0.8 ${name} -o ${name}.tga
# ${tachyon} -rescale_lights 0.4 -add_skylight 0.7 ${name} -o ${name}.tga -aasamples 8
convert ${name}.tga -transparent black ${name}.png