FragIt / fragit-main

FragIt main repository
Other
25 stars 12 forks source link

formalCharges Issue #34

Open bhwl12 opened 4 years ago

bhwl12 commented 4 years ago

I got the error "Fragment xx, xx electron, charge 0, multiplicity 1" from GAMESS using the inp file generated by FragIt. To solve this problem, I modified the function _fixAtomsAndCharges in fragmentation.py as following:

def _fixAtomsAndCharges(self):
    ....
    # self.formalCharges = [0.0 for i in range(self.mol.NumAtoms())]
    # if charge_model.ComputeCharges(self.mol):
        # self.formalCharges = list(charge_model.GetPartialCharges())
        # else:
               # print("Info: FragIt [FRAGMENTATION] fragment charges are not available.")
    self.formalCharges = []
    for atom_id in range(self.mol.NumAtoms()):
        self.formalCharges.append(self.mol.GetAtomById(atom_id).GetFormalCharge())
    ....

This solved the charge problem, I'd like to know if this modification is correct. Thanks!

cstein commented 4 years ago

Dear @bhwl12

Thanks for the report. Do you have the possibility to upload an example .pdb file where this fails? :) The partial-charges are used due to some fragmentation problems, so I would like to add a potentially broken file. :) I hope this is possible

All the best

Casper

bhwl12 commented 4 years ago

Hi @cstein:

     Thank you for your reply.
     I uploaded the .pdb file where where this fails. Thanks!

Best, Yajun 4TLL_chain_D_renumber.pdb.txt

cstein commented 4 years ago

Thanks @bhwl12

Are you able to provide just a tad more information here? - like how did you run FragIt - what were the options and so on. Am trying to reproduce. If you can, are you able to upload the resulting .inp file as well?

cheers

Casper

bhwl12 commented 4 years ago

Hi @cstein:

I use the --use-config option to run FragIt. I uploaded the .inp file and myconfig.ini file. Thanks!

Best Yajun

4TLL_chain_D_renumber.inp.txt myconfig.ini.txt