Skip to content

Commit

Permalink
handle case where no sapce group record in PDB file
Browse files Browse the repository at this point in the history
  • Loading branch information
minhuanli committed Mar 22, 2024
1 parent 2a0da7b commit 0cea477
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion SFC_Torch/io.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,11 @@ def __init__(self, data):
self.cra_name,
self.res_id,
) = hier2array(structure)
self.spacegroup = gemmi.SpaceGroup(structure.spacegroup_hm)
try:
self.spacegroup = gemmi.SpaceGroup(structure.spacegroup_hm)
except:
self.spacegroup = gemmi.SpaceGroup("P 1")
print("No valid spacegroup in the file, set as P 1", flush=True)
self.cell = structure.cell

# Save the pdb headers, exclude the CRYST1 line
Expand Down

0 comments on commit 0cea477

Please sign in to comment.