Package Bio :: Package NMR :: Module xpktools :: Class Peaklist
[hide private]
[frames] | no frames]

Class Peaklist

source code

object --+
         |
        Peaklist

Provide access to header lines and data from a nmrview xpk file.

Header file lines and file data are available as attributes.

Parameters

infn : str
The input nmrview filename.

Attributes

firstline : str
The first line in the header.
axislabels : str
The axis labels.
dataset : str
The label of the dataset.
sw : str
The sw coordinates.
sf : str
The sf coordinates.
datalabels : str
The labels of the entries.
data : list
File data after header lines.

Examples

>>> from Bio.NMR.xpktools import Peaklist
>>> peaklist = Peaklist('../Doc/examples/nmr/noed.xpk')
>>> peaklist.firstline
'label dataset sw sf '
>>> peaklist.dataset
'test.nv'
>>> peaklist.sf
'{599.8230 } { 60.7860 } { 60.7860 }'
>>> peaklist.datalabels
' H1.L  H1.P  H1.W  H1.B  H1.E  H1.J  15N2.L  15N2.P  15N2.W  15N2.B  15N2.E  15N2.J  N15.L  N15.P  N15.W  N15.B  N15.E  N15.J  vol  int  stat '
Instance Methods [hide private]
 
__init__(self, infn)
x.__init__(...) initializes x; see x.__class__.__doc__ for signature
source code
 
residue_dict(self, index)
Return a dict of lines in `data` indexed by residue number or a nucleus.
source code
 
write_header(self, outfn)
Write header lines from input file to handle outfn.
source code

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, infn)
(Constructor)

source code 
x.__init__(...) initializes x; see x.__class__.__doc__ for signature

Overrides: object.__init__
(inherited documentation)

residue_dict(self, index)

source code 

Return a dict of lines in `data` indexed by residue number or a nucleus.

The nucleus should be given as the input argument in the same form as it appears in the xpk label line (H1, 15N for example)

Parameters

index : str
The nucleus to index data by.

Returns

resdict : dict
Mappings of index nucleus to data line.

Examples

>>> from Bio.NMR.xpktools import Peaklist
>>> peaklist = Peaklist('../Doc/examples/nmr/noed.xpk')
>>> residue_d = peaklist.residue_dict('H1')
>>> sorted(residue_d.keys())
['10', '3', '4', '5', '6', '7', '8', '9', 'maxres', 'minres']
>>> residue_d['10']
['8  10.hn   7.663   0.021   0.010   ++   0.000   10.n   118.341   0.324   0.010   +E   0.000   10.n   118.476   0.324   0.010   +E   0.000  0.49840 0.49840 0']