﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	version	resolution	keywords	cc	blockedby	blocking	notify_on_close	platform	project
17602	color different chain using terminal and looping	jg0428@…	Eric Pettersen	"{{{
Dear ChimeraX team,

I am working at Princeton University. I am trying to export hundreds of proteins from .cif file, label different chain with different color and maybe different sequence also labeled with various colors. Since doing them one by one is time tidious. I am trying to write a script to run one by one automatically. But apparently there is some issue with color code. Then I try to switch to one protein to see if the color code is working or not. But it looks like there is still problems, can't it be operated in terminal to label different chain colors or specific sequence colors? How to modify this to make it work?

single_protein.sh

#!/bin/bash

# Path to ChimeraX executable
chimera_path=""/Applications/ChimeraX-1.9.app/Contents/MacOS/ChimeraX""

# Specify the path to your CIF file
input_file=""/Users/jg0428/Desktop/40_PDB_exported_structure/Sudan_ZDHHC17.cif""

# Output directory for results
output_dir=""/Users/jg0428/Desktop/40_PDB_Output""

""$chimera_path"" --cmd ""open \""$input_file\""; wait 5; color /A ribbons hotpink; color /B ribbons forestgreen; save \""$output_dir/Sudan_ZDHHC17_test.png\"" supersample 3; close session; exit""

ChimeraX_batch.sh

#!/bin/bash

# Path to ChimeraX executable
chimera_path=""/Applications/ChimeraX-1.9.app/Contents/MacOS/ChimeraX""

# Input directory containing .cif files
input_dir=""/Users/jg0428/Desktop/40_PDB_exported_structure""

# Output directory for results
output_dir=""/Users/jg0428/Desktop/40_PDB_Output""

# Loop over each .cif file in the input directory
for input_file in ""$input_dir""/*.cif; do
    # Get the base name of the file without extension
    base=$(basename ""$input_file"" .cif)

    # Run ChimeraX commands for each file
    ""$chimera_path"" --cmd ""open \""$input_file\"";wait 2;show chains;color hotpink chain A;color forestgreen chain B;movie record;turn y 1 300;wait 120;movie stop;movie encode bitrate 10000 output \""$output_dir/$base.mp4\"";save \""$output_dir/$base.png\"" supersample 3;save \""$output_dir/$base.cxs\"";close session;exit;""
done

Best,
Jinchao
}}}
"	defect	closed	normal		Command Line		not a bug						all	ChimeraX
