1) To turn on hack_elec, you should include a line for hack_elec in your weights file. Normally what I do is copy minirosetta_database/scoring/weights/score12_full.wts (or whatever starting weights file you want) to the local directory and then add in a line for hack_elec setting it to the value that I want. You would then just use the “-score:weights
As far as which value you should use, that’s a little bit more tricky. Ideally you’d have a test set of similar runs with known solutions, and then you’d find the value of hack_elec which would give you the best results on the test set. That’s probably overkill for you. So what I’d recommend is to do several runs of your protocol with varying hack_elec weights (I’d probably start with values in the 0.25 to 0.5 range), and see how the different values affect the results. If the results don’t vary much, the weight is not that critical. If the results vary, you’ll need to use your scientific intuition to determine which values give the more realistic results.
2) The if ( …. ) continue lines are there to prevent wasting time on the calculation of the hack_elec term for certain residues. Virtual residues don’t have any real atoms, so they shouldn’t have any columbic energy associated with them – we can skip them. On the other hand, polymeric residues (like protein amino acids) do have real atoms, and so should be included in the calculation of the energy. The exclude_protein_protein_hack_elec-dependent exclusion happens elsewhere in the code.
Your calcium residue is neither a virtual residue nor a polymeric one, so none of the checks you posted would matter for it.