Skip to content

Commit

Permalink
update multicomponent
Browse files Browse the repository at this point in the history
  • Loading branch information
Patrick Li committed Jun 13, 2024
1 parent 2d5b7cd commit a85032e
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions autosolvate/multicomponent.py
Original file line number Diff line number Diff line change
Expand Up @@ -190,8 +190,8 @@ def __init__(self, folder = WORKING_DIR, cube_size = 54, closeness = 2.0, charge
def add_solute(self, xyzfile:str, name="", residue_name="", charge=0, spinmult=1, number = 1, **kwargs):

#use the first three letters of the xyzfile name as the residue name
if not residue_name and len(xyzfile.split(".")[0]) >= 3:
residue_name = xyzfile.split(".")[0][:3].upper()
if not residue_name and len(xyzfile.split(".")[0].split("/")[-1]) >= 3:
residue_name = xyzfile.split(".")[0].split("/")[-1][:3].upper()

molecule = Molecule(xyzfile, charge=charge, multiplicity=spinmult, folder = self.folder, name = name, residue_name=residue_name)

Expand All @@ -212,8 +212,9 @@ def add_solute(self, xyzfile:str, name="", residue_name="", charge=0, spinmult=1
def add_solvent(self, xyzfile:str, name="", residue_name="", charge=0, spinmult=1, number = 200, **kwargs):

#use the first three letters of the xyzfile name as the residue name
if not residue_name and len(xyzfile.split(".")[0]) >= 3:
residue_name = xyzfile.split(".")[0][:3].upper()
if not residue_name and len(xyzfile.split(".")[0].split("/")[-1]) >= 3:
#get the file name from the absolute path
residue_name = xyzfile.split(".")[0].split("/")[-1][:3].upper()

molecule = Molecule(xyzfile, charge=charge, multiplicity=spinmult, folder = self.folder, name = name, residue_name=residue_name)

Expand Down

0 comments on commit a85032e

Please sign in to comment.