Skip to content
Snippets Groups Projects
Commit 410a489b authored by Rafal Gumienny's avatar Rafal Gumienny
Browse files

fix: SCHWED-3121 Use calpha_only fron LoadPDB and LoadMMCIF

parent 489e84b2
No related branches found
No related tags found
No related merge requests found
......@@ -491,11 +491,7 @@ def _ReadStructureFile(path, c_alpha_only=False, fault_tolerant=False,
"""
def _Select(entity):
calpha_message = "Selecting only C-alpha atoms"
selection_message = "Selecting %s" % selection
if c_alpha_only:
ost.LogInfo(calpha_message)
entity = entity.Select("aname=CA")
if selection:
ost.LogInfo(selection_message)
entity = entity.Select(selection)
......@@ -505,7 +501,10 @@ def _ReadStructureFile(path, c_alpha_only=False, fault_tolerant=False,
if not os.path.isfile(path):
raise IOError("%s is not a file" % path)
try:
entity = LoadPDB(path, fault_tolerant=fault_tolerant)
entity = LoadPDB(
path,
fault_tolerant=fault_tolerant,
calpha_only=c_alpha_only)
if not entity.IsValid():
raise IOError("Provided file does not contain valid entity.")
entity.SetName(os.path.basename(path))
......@@ -516,7 +515,8 @@ def _ReadStructureFile(path, c_alpha_only=False, fault_tolerant=False,
tmp_entity, cif_info = LoadMMCIF(
path,
info=True,
fault_tolerant=fault_tolerant)
fault_tolerant=fault_tolerant,
calpha_only=c_alpha_only)
if len(cif_info.biounits) == 0:
tbu = MMCifInfoBioUnit()
tbu.id = 'ASU of ' + entity.pdb_id
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment