The NMRView peak picker, is fast but relatively simple, and this can lead to the inclusion of peaks that correspond to noise or artifacts. Instead of eliminating these during the initial identification of peak positions, NMRView provides a variety of routines for filtering out these peaks. Peaks can be deleted interactively via the GUI, both directly on the spectrum, and using the Peak Inspector or Peak Tables as described above. There also a variety of scripted procedures that are available for deleting peaks that are thinner, wider or less intense than specified criteria or are on the diagonal. Furthermore, simple Tcl scripts can be written by users to filter out peaks based on other criteria.
Here is a simple Tcl procedure (included in the standard NMRViewJ distribution) that deletes any peaks in a specified list whose intensity is below a specified threshold. The user could invoke this script by typing in the NMRView console ?Nv_PeakCutLow noesy 0.4?.
proc Nv_PeakCutLow {plist threshold} { set n [nv_peak n $plist] set ncut 0 foreachpeak iPeak $plist { set lvl [eval nv_peak elem int $plist.$iPeak] if {[ expr {abs($lvl)<$threshold} ] } { eval nv_peak delete $plist.$iPeak incr ncut } } puts "Cut $ncut of $n peaks" }
Two commands in the script are worth emphasizing. The foreachpeak
command loops over all the peaks in a specified list (setting the iPeak variable to the
peak number of each in turn). By using this command the user doesn?t need to worry about
the number of peaks in the list or whether there are gaps in the peak numbering. The
nv_peak elem command provides read and write access to all the
parameters that characterize a particular peak. In this example, the
nv_peak command is used to obtain the peak intensity, but all other
elements of each peak such as chemical shift, width, volume, assignment label, and
comments are accessible as well. Together these two commands can form the basis for
scripts that perform a wide variety of operations on peak lists.
A graphical interface to some of the builtin filtering commands is available via the menu item. Documentation coming.
![]() |