How to use a perl script to process the MD-generated .xtd file in order to obtain the proportions of the three solvation structures—SSIP, CIP, and AGG—in an electrolyte system.

Hello everyone,

I have obtained the MD result file (.xtd) using the Forcite module. I would like to use a script to calculate the proportions of the three solvation structures—SSIP, CIP, and AGG—in my system.

My rough idea for the script is as follows: first, define the necessary variables; then specify the starting frame, ending frame, and step size for the calculation. Next, extract the starting frame and save it as an .xsd file. For the .xsd file, the analysis would proceed as follows: in my system, which contains Li⁺ and FSI⁻, search within a certain cutoff distance to determine how many Li⁺ ions coordinate with the O or N atoms of each FSI⁻. If the number is 0, the FSI⁻ molecule is considered to be in the SSIP structure; if it is 1, it is in the CIP structure; if it is 2 or more, it is in the AGG structure.

By repeating this process from the starting frame to the ending frame according to the step size, we can then count the total number of SSIP, CIP, and AGG structures.

I hope my description is clear, and I would be truly grateful if you could help me with this. I have attached my .xtd and .xms files for your reference, so that you can test the script.

Answers 3
JL
JL 2026-01-28

Hi,

 

That’s a very interesting system you’ve got.  One way to achieve what you desired is through integrating RDF (Radial distribution function) for coordination number, in conjunction with scripting.  Possible approach follows:

  1. Pick the first frame.  Pick one FSI⁻ molecule at a time.  Make the S atom a set, then all Li+ ions the other set.  Run RDF analysis between the two sets.  Integrate the RDF plot for the ‘Total (S-Li)’ plot, out to the first coordination sphere (ca. 3.75 A).  You may want to perform this step manually, first, through the MS Visualizer, to familiarize yourself with the procedure.  You can then go through each and every other FSI⁻ molecules in the frame, and run your statistics accordingly.
  2. Step through your trajectory as desired, by repeating step 1.

Hope it helps,

Jian-jie

JD
JD 2026-02-02

Hi Y Y, 

Here (screenshot) is the radial distribution function for the single-framed trajectory (you did not provide the .trj file, so it is only 1 frame). Here we can see the first solvation shell is between 1.7A and 2.8A. By integrating the area under this curve, as Jian-Jie suggests, you could extract the average number of lithium ions around the O and N atoms of FSI. But it would not be possible to break that down further into the distribution of SSIP, CIP, and AGG structures. For that you would need to write a script to do a more custom analysis. 

 

If you want to write a script, maybe you could use the CalculateCloseContact function. Here is how you could do it:

my $fsi_atoms = $doc->UnitCell->Sets("O+N-FSI-");
$fsi_atoms->CalculateCloseContacts([ 
	DistanceCriterionMode	=> "Absolute",
	MaxAbsoluteDistance	=> 2.8,
	ExclusionMode		=> "Set"
	]);
comment imagecomment image
CM
CM 2026-02-04

I first though myself that Jian-Jie's procedure may not work because I oversaw this:
Pick one FSI⁻ molecule at a time.

In the mean time I think it should work.

As it is "just" counting it is perhaps sufficient to have a look at the highest value for g(r) for the first solvation shell. One has to have a look at  the SSIP configuration and how g(r) really looks for them