Hi,
I have a number of .xtc files (more than 1000). I would like to attach all these files. For this purpose, I have written a Python code to read the files and I used trjcat command. But at each level, it asks me to write “c” or “l” to attach them. I need to enter “c”. how can I change the command to do it continuously without asking for “c”?
This is the python code:
import subprocess
# Define the range of indices for the .xtc files
start_index = 1
end_index = 1000 # Adjust this to the last index of the files
# List of .xtc files to concatenate
xtc_files = [f"md{i}.xtc" for i in range(start_index, end_index+1)]
# Construct the trjcat command
command = ['gmx', 'trjcat', '-f'] + xtc_files + ['-o', 'combined_2.xtc', '-cat', 'yes', '-settime', 'yes']
# Run the trjcat command
subprocess.run(command)