Skip to content
Snippets Groups Projects
Commit 45776811 authored by Tobias Schmidt's avatar Tobias Schmidt
Browse files

improve warning when using LoadPDB incorrectly

parent b1a9e58a
No related branches found
No related tags found
No related merge requests found
...@@ -137,8 +137,11 @@ def LoadPDB(filename, restrict_chains="", no_hetatms=None, ...@@ -137,8 +137,11 @@ def LoadPDB(filename, restrict_chains="", no_hetatms=None,
return val1 return val1
if isinstance(profile, str): if isinstance(profile, str):
prof=profiles[profile].Copy() prof=profiles[profile].Copy()
else: elif isinstance(profile, IOProfile):
prof=profile.Copy() prof=profile.Copy()
else:
raise TypeError('profile must be of type string or IOProfile, '+\
'instead of %s'%type(profile))
if dialect not in (None, 'PDB', 'CHARMM',): if dialect not in (None, 'PDB', 'CHARMM',):
raise ValueError('dialect must be PDB or CHARMM') raise ValueError('dialect must be PDB or CHARMM')
prof.calpha_only=_override(prof.calpha_only, calpha_only) prof.calpha_only=_override(prof.calpha_only, calpha_only)
...@@ -208,8 +211,11 @@ def SavePDB(models, filename, dialect=None, pqr=False, profile='DEFAULT'): ...@@ -208,8 +211,11 @@ def SavePDB(models, filename, dialect=None, pqr=False, profile='DEFAULT'):
models=[models] models=[models]
if isinstance(profile, str): if isinstance(profile, str):
profile=profiles[profile].Copy() profile=profiles[profile].Copy()
else: elif isinstance(profile, IOProfile):
profile.Copy() profile.Copy()
else:
raise TypeError('profile must be of type string or IOProfile, '+\
'instead of %s'%type(profile))
profile.dialect=_override(profile.dialect, dialect) profile.dialect=_override(profile.dialect, dialect)
writer=PDBWriter(filename, profile) writer=PDBWriter(filename, profile)
writer.SetIsPQR(pqr) writer.SetIsPQR(pqr)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment