Swarm-CG icon indicating copy to clipboard operation
Swarm-CG copied to clipboard

Virtual Sites

Open phthalimid opened this issue 8 months ago • 0 comments

I tried to use a virtual site but ran into difficulties. In the .itp file, I labelled the site with a 'v' in front of the type:

[...] [ moleculetype ] ; molname nrexcl FLN 1

[ atoms ] ; id type resnr residue atom cgnr charge mass 1 TC5 0 FLN B0 1 0.00000 49.5 2 TC5 0 FLN B1 2 0.00000 49.5 3 vSC5e 0 FLN B2 3 0.00000 0 4 TC5 0 FLN B3 4 0.00000 49.5 5 TC5 0 FLN B4 5 0.00000 49.5 6 TN6a 0 FLN B5 6 0.00000 36

[bonds] ; i j funct length 6 3 1 0.225 25000 [...]

Then, I removed the bead from the .ndx file, because Swarm-CG asked me to. The, it recognised the virtual site, but crashed when calling "map_aa2cg_traj":

Command line: /home/nannthom/anaconda3/envs/swarmcg/bin/scg_evaluate -aa_tpr swarmCG_data/aa_topol.tpr -aa_traj swarmCG_data/aa_traj.xtc -cg_map swarmCG_data/cg_map.ndx -cg_itp swarmCG_data/cg_model.itp -cg_tpr swarmCG_data/cg_topol.tpr -cg_traj swarmCG_data/cg_traj.xtc

+---------------------------------------------------------------------------------------------+ | PRE-PROCESSING | +---------------------------------------------------------------------------------------------+

Reading Coarse-Grained (CG) ITP file Found 5 beads Found 1 virtual sites Found 4 constraints groups Found 1 bonds groups Found 0 angles groups Found 2 dihedrals groups

Reading All Atom (AA) trajectory Found 5001 frames

Mapping the trajectory from AA to CG representation Interpretation: Center of Mass (COM) Traceback (most recent call last): File "/home/nannthom/anaconda3/envs/swarmcg/bin/scg_evaluate", line 8, in sys.exit(main()) File "/home/nannthom/anaconda3/envs/swarmcg/lib/python3.9/site-packages/swarmcg/evaluate_model.py", line 237, in main run(ns) File "/home/nannthom/anaconda3/envs/swarmcg/lib/python3.9/site-packages/swarmcg/evaluate_model.py", line 125, in run scg.map_aa2cg_traj(ns) File "/home/nannthom/anaconda3/envs/swarmcg/lib/python3.9/site-packages/swarmcg/swarmCG.py", line 1357, in map_aa2cg_traj traj[ts.frame] = ns.mda_beads_atom_grps[bead_id].center( KeyError: 5

Looks like a bug to me.

phthalimid avatar Jul 09 '25 03:07 phthalimid