Skip to content

Commit

Permalink
Updated chem_shift_by_residue api method and csviewer.
Browse files Browse the repository at this point in the history
  • Loading branch information
smelandr committed Jan 10, 2017
1 parent 79e961e commit eae82f0
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
10 changes: 5 additions & 5 deletions nmrstarlib/csviewer.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,8 @@ def __init__(self, from_path, aminoacids=None, atoms=None, filename=None, csview
"""CSViewer initializer.
:param str from_path: Path to single NMR-STAR file or BMRB id.
:param list aminoacids: List of atom types, e.g. 'ALA', 'GLY', 'SER', etc. Leave as `None` to include everything.
:param list atoms: List of atom types, e.g. 'CA', 'CB', 'HA', etc. Leave as `None` to include everything.
:param list or tuple aminoacids: List of atom types, e.g. 'ALA', 'GLY', 'SER', etc. Leave as `None` to include everything.
:param list or tuple atoms: List of atom types, e.g. 'CA', 'CB', 'HA', etc. Leave as `None` to include everything.
:param str filename: Output filename chemical shifts graph to be saved.
:param str csview_format: `svg`, `png`, `pdf`. See http://www.graphviz.org/doc/info/output.html for all available formats.
:param str nmrstarversion: Version of NMR-STAR format to use for look up chemichal shifts loop.
Expand Down Expand Up @@ -79,15 +79,15 @@ def csview(self, view=False):
edges = []

for seq_id in chemshifts_dict:
aaname = "{}_{}".format(chemshifts_dict[seq_id]["AACode_3"], seq_id)
label = '"{{{}|{}}}"'.format(seq_id, chemshifts_dict[seq_id]["AACode_3"])
aaname = "{}_{}".format(chemshifts_dict[seq_id]["AA3Code"], seq_id)
label = '"{{{}|{}}}"'.format(seq_id, chemshifts_dict[seq_id]["AA3Code"])
color = 8
aanode_entry = " {} [label={}, fillcolor={}]".format(aaname, label, color)
nodes.append(aanode_entry)
currnodename = aaname

for atomtype in chemshifts_dict[seq_id]:
if atomtype in ["AACode3", "Seq_ID"]:
if atomtype in ["AA3Code", "Seq_ID"]:
continue
else:
atname = "{}_{}".format(aaname, atomtype)
Expand Down
2 changes: 1 addition & 1 deletion nmrstarlib/nmrstarlib.py
Original file line number Diff line number Diff line change
Expand Up @@ -439,7 +439,7 @@ def chem_shifts_by_residue(self, aminoacids=None, atoms=None, nmrstarversion="3"
if list(self[saveframe][ind][0]) == chemshifts_loop:
chemshifts_dict = OrderedDict()
for entry in self[saveframe][ind][1]:
residueid = int(entry[aminoacid_seq_id])
residueid = entry[aminoacid_seq_id]
chemshifts_dict.setdefault(residueid, OrderedDict())
chemshifts_dict[residueid][u"AA3Code"] = entry[aminoacid_code]
chemshifts_dict[residueid][u"Seq_ID"] = residueid
Expand Down

0 comments on commit eae82f0

Please sign in to comment.