mccullaghlab / Coarse-grained-Charge-Fitting

Code used for paper
MIT License
0 stars 0 forks source link

Coarse-grained charge fitting of the graphene-like molecule #1

Open yel21 opened 2 years ago

yel21 commented 2 years ago

Dear developers, 

I attempted to calculate coarse-grained partial charges for graphene-like molecules using a Python script. 

Initially, my atomistic model comprises ~ 40 atoms and, after coarse-graining, the system comprises 14 atoms.  

I created both atomistic and CG models. Initial partial charges of CG were obtained simply by summing the partial charges of the atoms that belong to the CG bead. However, when I ran the charge fitting, I got the following error: 

opt_cg_charges_3.py:153: RuntimeWarning: invalid value encountered in true_divide temp /= np.linalg.norm(temp) Step: 1 Residual = nan position delta = nan Step: 2 Residual = nan position delta = nan Step: 3 Residual = nan position delta = nan Step: 4 Residual = nan position delta = nan Step: 5 Residual = nan position delta = nan Step: 6 Residual = nan position delta = nan Step: 7 Residual = nan position delta = nan Step: 8 Residual = nan position delta = nan Step: 9 Residual = nan position delta = nan Step: 10 Residual = nan position delta = nan Current CG positions and charges: X Y Z Charge nan nan nan nan nan nan nan nan nan nan nan nan nan nan nan nan nan nan nan nan nan nan nan nan nan nan nan nan nan nan nan nan nan nan nan nan nan nan nan nan nan nan nan nan nan nan nan nan nan nan nan nan nan nan nan nan

The example systems run perfectly. Maybe you could help me solve this problem? 

Best wishes, 

Victor

mccullaghlab commented 2 years ago

Hi Victor,

Would you mind sending me the input files that you used and I will take a look?

Thanks. Martin

yel21 commented 2 years ago

Dear Martin, 

Sorry for the delay in responding. 

I have a couple of questions. 

1) I found that NaN in the output of the python is related to the situation in which a one all-atom atom is fed into the CG bead.  I attached a zip file with the files that were used in the folder "inf." NaN first appeared on the bead of number 14. Is it possible to rewrite a Python script to calculate the CG charge of a particle when the atom is coarse-grained to the CG bead? 

2) However, when I map my coarse-grained model in such a case that in one CG bead, 2 or more atoms are placed and the CG model optimization procedure starts, I obtained some distortion of the chemical structure of my CG system. This is opposite to an example of lysine, where the three-CG-bead system reached a state in which each coarse-grained bead did not change its position. These files are in the folder "dist" in the zip archive that is attached to the message. Is it possible for my system to get a stable position for CG beads upon optimization and not cause such significant changes in the chemical structure of CG model? 

Best wishes, sys.zip

Victor