My software notes

October 18, 2011

Agilent’s VnmrJ 3.2 implements NMRPipe

Filed under: NMRPipe and NMRview — kpwu @ 5:06 pm
Tags: , , ,

As just announced at the Agilent’s web blog “SPINSIGHTS”, the coming VnmrJ 3.2 will provide complete implementation of NMRPipe. This will be very useful for most of biomolecular NMR users.  I always run NMRPipe on the console linux to preview the 2D HSQC or some 3D data and direct compare to some data I already processed by NMRPipe for conveniency. Checking data in VnmrJ with 2-column view is not fun, honestly.

The blog article “Advanced Data Processing—Implementing NMRPipe Within VnmrJ 3.2” explains the details and also provide example figures.

Some images shown below are linked to the figures posted at the SPINSIGHTS.

April 20, 2011

Cube view of 3D NMR data

Filed under: NMRPipe and NMRview,softwares and scripts — kpwu @ 5:18 pm
Tags: , ,

Last week, I posted a blog article that we can make a cube of 3D NMR data but that scripts (at that time) can not draw the labels/axis values. I read the NMRPipe discussion forum today and realized on March 20, the author of NMRPipe has a modified version of nmrCube.tcl and is included in the new version of NMRPipe.

This new nmrCube.tcl now can draw labels as well as the tics/values of each dimension. Here is the example I use my HNCO data to show.

April 14, 2011

[NMRPipe]–making a 3D cube

Filed under: NMRPipe and NMRview,softwares and scripts — kpwu @ 1:37 pm
Tags: ,

***NOTE on April 20****

The nmrCube.tcl has been included in the new version of NMRPipe package and it can label axis, tics and tic values now.

New post is available to show to changes.

*************************

On Feb 18th, an user asked whether there are ways to make a 3D cube of NMR data at the NMRPipe discussion group at Yahoo. Frank Delaglio, the author of NMRPipe, provided a very very nice script to generate the cube. The script is pasted in this post and user can copy it, save it (e.g. nmrCube.tcl) and chmod a+x nmrCube.tcl to make it executable.

I have example pictures showing at here using my 15N-edited NOESY-Hsqc spectrum.

The default colors for background and foreground are black and white, respectively. nmrCube.tcl will draw multi-color peaks in the cube based on the 15N frequency. Here is the example:

I modify the script by changing the default colors (shown in red in the script at here) and run the script like this way:
/path/nmrCube.tcl -hi 5.0e+5 -colors red (fix height and color all peaks in red). The cube is then looked like this way:

So far, no ways for labeling axis and rotation.

===== copy the script and save it as nmrCube.tcl to run ==========

#!/bin/sh
# The next line restarts using nmrWish \
exec nmrWish “$0” — “$@”

set auto_path “[split $env(TCLPATH) :] $auto_path”
set ARGV [concat $argv0 $argv]
set ARGC [llength $ARGV]

if {[info exists env(NMRTXT)]} \
{
set tStr ” ($env(NMRTXT)/rgb.txt).”
} \
else \
{
set tStr “.”
}

if {[flagLoc $ARGV -help]} \
{
puts “Draw a Simple Static 3D Cube Display of NMRPipe-Format 3D Data:”
puts ” -in inName \[ft/test%03d.ft3\] 3D Spectrum to Draw.”
puts ” -hi hi \[1.0e+5\] Contour Height.”
puts “Spectral Orientation for Drawing :”
puts ” -xName xName \[X_AXIS\] Spectral Axis Name for Plot X-Axis.”
puts ” -yName yName \[Y_AXIS\] Spectral Axis Name for Plot Y-Axis.”
puts ” -zName zName \[Z_AXIS\] Spectral Axis Name for Plot Z-Axis.”
puts “Drawing Sizes:”
puts ” -cxSize cxSize \[400\] Plot X-Axis Size, Pixels.”
puts ” -czSize cySize \[400\] Plot Y-Axis Size, Pixels.”
puts ” -czSize czSize \[Auto\] Plot Z-Axis Size, Pixels.”
puts ” -xAdj xAdj \[16\] Window Horizontal Offset, Pixels.”
puts ” -yAdj yAdj \[32\] Window Vertical Offset, Pixels.”
puts “Drawing Colors:”
puts ” -colors cList \[red …\] List of Colors for Spectral
Drawing.”
puts ” -fgColor fg \[white\] Forground Color (for Box Outlines).”
puts ” -bgColor bg \[black\] Background Color.”
puts “Notes:”
puts ” 1. The graphic produced is a simple stack of fixed-sized 2D”
puts ” plots with a linear offset.”
puts ” 2. Use ‘-colors multi’ for spectral colors selected according”
puts ” to intensity rather than Z-Axis position.”
puts ” 3. See file ‘rgb.txt’ in the NMRPipe ‘nmrtxt’ directory for valid”
puts ” colors$tStr”
exit 0
}

set inName ft/test%03d.ft3
set hi 1.0e+5

set tMargin 40
set bMargin 120
set lMargin 40
set rMargin 120

set cxSize 400
set cySize 400
set czSize Auto

set xAdj 16
set yAdj 32

set bgColor white #was black
set fgColor black # was white
set colorA black # was white
set colorS white # was black

set xName X_AXIS
set yName Y_AXIS
set zName Z_AXIS

set colorList {red orange yellow green blue cyan orchid}

getArgD $ARGV -in inName
getArgD $ARGV -hi hi

getArgD $ARGV -xName xName
getArgD $ARGV -yName yName
getArgD $ARGV -zName zName

getArgD $ARGV -tMargin tMargin
getArgD $ARGV -bMargin bMargin
getArgD $ARGV -rMargin rMargin
getArgD $ARGV -lMargin lMargin

getArgD $ARGV -cxSize cxSize
getArgD $ARGV -cySize cySize
getArgD $ARGV -czSize czSize

getArgD $ARGV -xAdj xAdj
getArgD $ARGV -yAdj yAdj

getArgD $ARGV -bgColor bgColor
getArgD $ARGV -fgColor bgColor
getArgD $ARGV -colorA colorA
getArgD $ARGV -colorS colorS

getListArgD $ARGV -colors colorList

#
#———————————————————-

wm geom . +$xAdj+$yAdj
wm title . $inName

#
# Check input and its number of planes:

set thisName [format $inName 1]

if {![file exists $thisName]} \
{
puts stderr “Error Finding 3D Input $inName”
exit 1
}

set error [rdFDATA $thisName fdata]

if {$error} \
{
puts stderr “Error Reading Header from 3D Input $inName”
exit 1
}

set dimCount [getParmI $fdata FDDIMCOUNT NULL_DIM]
set zSize [getParmI $fdata NDSIZE CUR_ZDIM]

if {$dimCount != 3 || $zSize < 1} \
{
puts stderr “3D Drawing Error: Data is not 3D.”
exit 1
}

#
# Create the graphics area:

if {![strcasecmp $czSize Auto]} {set czSize [expr int(0.25*($cxSize + $cySize))]}

set wxSize [expr $bMargin + $lMargin + $cxSize + $czSize]
set wySize [expr $tMargin + $bMargin + $cySize + $czSize]

canvas .c -width $wxSize -height $wySize -border 0
pack .c -in . -side top -expand 1 -fill both

button .q -text Quit -command exit
pack .q -in . -side top -expand 1 -fill x

update

.c create pixmap 0 0 -width $wxSize -height $wySize -win 1

#
# Draw the planes:

set nC [llength $colorList]

if {!$nC} \
{
set colorList white
set nC 1
}

set cxn [expr 1 + $wxSize – $rMargin]
set cx1 [expr 1 + $cxn – $cxSize]

set cyn $tMargin
set cy1 [expr $cyn + $cySize – 1]

set iz 1

set xOff [expr int(double($czSize)*($zSize – $iz)/($zSize – 1))]
set yOff [expr int(double($czSize)*($zSize – $iz)/($zSize – 1))]

set tx1 [expr $cx1 – $xOff]
set txn [expr $cxn – $xOff]

set ty1 [expr $cy1 + $yOff]
set tyn [expr $cyn + $yOff]

drawRec -win 1 -x 0% 100% -y 0% 100% -fg $bgColor
drawBox -win 1 -x $cx1 $cxn -y $cy1 $cyn -fg $fgColor

drawLine -win 1 -x $tx1 $cx1 -y $ty1 $cy1 -fg $fgColor
drawLine -win 1 -x $txn $cxn -y $ty1 $cy1 -fg $fgColor

for {set iz $zSize} {$iz >= 1} {incr iz -1} \
{
set xOff [expr int(double($czSize)*($zSize – $iz)/($zSize – 1))]
set yOff [expr int(double($czSize)*($zSize – $iz)/($zSize – 1))]
set ic [expr int(double($nC)*($zSize – $iz)/($zSize – 1))]

if {$ic > $nC – 1} {set ic [expr $nC – 1]}
set color [lindex $colorList $ic]

set tx1 [expr $cx1 – $xOff]
set txn [expr $cxn – $xOff]

set ty1 [expr $cy1 + $xOff]
set tyn [expr $cyn + $xOff]

readROI -ndim 2 -roi 1 -in $inName \
-x $xName 0% 100% -y $yName 0% 100% -dz $zName $iz 0

defineCell -win 1 -cell 1 -x $tx1 $txn -y $ty1 $tyn
defineCell -win 1 -cell 1 -x $tx1 $txn -y $ty1 $tyn

drawROI -win 1 -cell 1 -roi 1 -win 1 \
-hi $hi -bg None -fg None -nobox -color1 $color -color2 $color

update
}

drawLine -win 1 -x $tx1 $cx1 -y $tyn $cyn -fg $fgColor
drawLine -win 1 -x $txn $cxn -y $tyn $cyn -fg $fgColor
drawBox -win 1 -x $tx1 $txn -y $ty1 $tyn -fg $fgColor

update

November 2, 2007

NMRView NvJ 8.0a7 now available (solves Leopard arrow key problem)

Filed under: NMRPipe and NMRview — kpwu @ 1:02 pm

Bruce Johnson just released the latest version of NMRViewJ.

— original message in the mailing list—–

Some Leopard users have noted that the Up/Down/Left/Right  keys no
longer work for moving up down planes in 3D/4D spectra.

This is now fixed in nvjinstall8_0_a7.jar

Note this should also fix a  similar problem that users of non-
English localized version operating systems.

For script writers, here is why this broke:

When you setup key bindings you can give a “%K” argument for the
script that will be executed.  For example,

bind Spectrum <Down> “NvNavigate %W %K”

When you click the down arrow key in a window the NvNavigate
procedure will receive two arguments, the name of the window (from
the %W arg) and the text associated with the key you pressed.  In
previous Mac versions (and other operating systems) pressing the Down
key would send the string “Down”.  In Mac OS 10.5, this key now sends
the Unicode character that corresponds to a down arrow (and similarly
for Up, Left and Right).  In the NvNavigate code, I explicitly test
what key has been pressed by looking for the text Up, Down, Left or
Right.  This test now fails because the argument is the unicode
character (not the corresponding words).

I’ve fixed this by changing the bindings to:

bind Spectrum <Down> “NvNavigate %W Down”

This should also fix the problem if you’re using, for example, a
French localized operating system.

I haven’t had much time to look for other Leopard problems.  The only
other thing I’ve noticed is that by default the Middle Mouse button
is set to activate Dashboard.  You can turn this off in the Expose/
Spaces system preferences dialog.

cheers,

Bruce

October 19, 2007

snapshots of Olivia

Filed under: NMRPipe and NMRview — kpwu @ 10:27 am

Finally, I installed Olivia (v1.14.2) on my linux machine instead of Macbook. Snapshot of the 2D HSQC spectrum viewing in Olivia is posted.

olivia-mang4.jpg

July 9, 2007

NMRViewJ 8.0a1 is released

Filed under: NMRPipe and NMRview — kpwu @ 1:27 pm

Here is a snapshot I took. The system is Fedora core6. I also installed NVj8 on my MacBook Pro, it works well,too.

For more details, please look the official release note of NMRViewJ 8.
nmrview8

March 14, 2007

NMRViewJ 7.0.10 is out!

Filed under: NMRPipe and NMRview — kpwu @ 6:15 pm

Copy news from NMRViewJ mailing list:
Enjoy using it ^_^
——-
As previously mentioned, I’ve been working almost entirely on moving
NvJ to support BMRB STAR version 3 so as to have better support in
NvJ for features like RunAbout.  I’m nearly, but not quite, done with
the transition.  While working on this I have fixed a few bugs so I
thought I would provide a release now.

I think I’ve got everything in this version to start moving ahead
with RunAbout with the STAR3 code, but I’ve got some testing to do
before I’d say it’s really ready.  I expect to do some testing over
the next few days and have another version available by Monday.  I’ve
got a personal deadline to have a new version of the video on using
RunAbout to assign Ubiquitin ready by then so I’ll be working hard on
it.

There is one more pernicious bug that occasionally manifests itself
with the error that some command, which you know exists, doesn’t
exist.  I think I know the cause of this and hope to stomp it before
Monday as well.

I’ve also done some updating of the One Moon Web site.  The NvJ
section of the home page now lists the latest version of NvJ so you
can tell at a glance if you’re running the latest.  More improvements
are on their way.

Listed below are the changes in this version.

Bruce

* Many changes to allow compatability with the new BMRB STAR format
(version 3.x)
NvJ will still read and write STAR 2 files.  New STAR3 code has
not been made
available in menu form yet as it is still a work in progress.

* When vectors are extracted and displayed any existing phase in the
Vector display window is
applied to them (thanks to Mike Summers).

* A residue library with residues using the IUPAC naming convention
is now in reslib_iu.
This is not yet used automatically, but you could copy it over to
reslib to use it.

* Peaks are now folded to display properly if their chemical shift is
outside the range of the
displayed spectrum.  (This doesn’t permanently change their
chemical shifts, just displays
them properly.

* A new “nv_win wait” command has been added.  Sometimes you want to
ensure that a window has
been completely drawn before doing something else in the script.
“nv_win wait” will not return
until drawing is complete.

* Bug in crosshair display is fixed.  Sometimes the black crosshair
would be displayed but was
not selectable.

* nvj batchfile now will take a command line arguments to specify
files  to be loaded during startup.
Files will be loaded in a manner consistent with their extension
(.nv, .str, .tcl).
Filenames should appear after –files on the command line:
./nvj –files mystarfile.str hsqc.nv hnco.nv startup.tcl

* Sequence display code changes so that if a residue is not standard
then draw an X for the single letter code

March 1, 2007

Run NMRPipe/NMRDraw on a Windows XP PC?

Filed under: NMRPipe and NMRview — kpwu @ 5:34 pm

Yes, there is an exciting news from NMRPipe Yahoo discussion forum.
NMRPipe author, Dr. Frank Delaglio announced an e-mail about the information. The email content is pasted in this blog article. See blow:

——————————————————————————————

Dear Colleagues,

Exciting news, we have an experimental version of NMRPipe
for Windows XP Professional Edition (HUZZAH!!!) This new
version is posted with the others at the NMRPipe download site.

This implementation of NMRPipe requires that users first install
Microsoft Services for UNIX 3.5, and an X11 graphics server.

Some more details follow, taken from the install README file …

Cheerful Regards,

big FD

————

———————————————-

NMRPipe for Windows XP Pro (Interix/SFU 3.5)

NOTE WELL: this is an EXPERIMENTAL release of NMRPipe for Windows XP
Pro which makes use of Microsoft Windows “Services for UNIX” (SFU
3.5). According to Microsoft, there are aspects of the installation and
use of SFU 3.5 that can effect system usability and security. So,
for the time being, we recommend that only users who are familiar
with both UNIX and PC system management try this release.

BACKGROUND: Microsoft currently provides a Windows-based UNIX
environment (Interix), called “Services for UNIX” (SFU). At the
time of this writing, SFU 3.5 can be downloaded at no charge from
the Microsoft web site. This download provides a comprehensive UNIX
environment that can be installed under Windows XP Professional Edition.

Information on Windows Services for UNIX Version 3.5:

http://www.microsoft.com/technet/interopmigration/unix/sfu/default.mspx

SFU 3.5 Download:

http://www.microsoft.com/downloads/details.aspx?familyid=896C9688-601B-44F1-81A4-02878FF11778&displaylang=en

There is now an experimental version of NMRPipe for Windows XP which
REQUIRES that users FIRST install Microsoft Services for UNIX 3.5,
and a suitable X11 graphics server with the needed fonts. The steps
involved follow, with more details below:

1. Download and install Microsoft SFU 3.5 from the Microsoft web site.

2. Install and run a PC X11 graphics server.

3. From the SFU “C-shell” window, start an “xterm” terminal
window. In order to use the “xterm” command, you will
might first have to set the DISPLAY environment variable
manually; later on, this can be established automatically
via “.cshrc”. To set the DISPLAY manually, type:

setenv DISPLAY 127.0.0.1:0

4. In the “xterm” terminal window, follow the usual “install.com”
procedure for installing NMRPipe. If desired, you can include
the special option “+sfu” to customize the SFU UNIX environment
and create a default home directory and “.cshrc” automatically:

./install.com /dev/fs/C/nmr +sfu /dev/fs/C/frank

5. Once NMRPipe is installed, commands and programs should
generally be executed from an “xterm” terminal window,
although most will work equally well from the SFU “C-shell”
window.

WHICH VERSIONS OF WINDOWS ARE SUPPORTED?

This version of NMRPipe can only be used on systems where SFU 3.5
can be installed. According to information from Microsoft, SFU 3.5
requires Windows XP Professional Edition, and can also be used
with certain other versions of Windows, such as Windows 2000 Service
Pack 4. You can also search the web for specific information and
tips on installing SFU 3.5 on various systems.

X11 GRAPHICS SERVER FOR WINDOWS

In order to use the graphical components of NMRPipe, an X11
graphics server must be running, and it must provide the lucida
and open look fonts as used by “nmrDraw”. There are several
commercial X11 graphics servers which run on Windows-based PCs:
including those from “www.starnet.com” and “www.hummingbird.com”.

For building and testing this version of NMRPipe, we used the
Xming X11 graphics server and Xming-fonts package. If you use
this, be sure to download and install BOTH the server and the fonts
package … it’s also a nice idea to MAKE a little DONATION to the
author of this useful software:

http://www.straightrunning.com/XmingNotes/

February 8, 2007

3D strips from nmrPipe package

Filed under: NMRPipe and NMRview — kpwu @ 9:11 pm

the following descriptions are kinda from nmrPipe discussion group (at yahoo.com)
(http://tech.groups.yahoo.com/group/nmrpipe/message/732)

USAGE:
scroll.tcl -tab 2d-hn.tab (default name: hn.tab) \
-in ft/test%03d.ft3 -nlev 0 (no negative levels) \
-hi 33000 (height cutoff of displayed contours)

** more details: do “scroll.tcl -help”
** scroll.tcl is for screen viewing, for print out, you can use stripPlot.tcl to genenerate .ps files.

This is a sample figure I use scroll.tcl to generate a CBCACONH 3D strips of my target protein:
(click to see full figure, which is over the width of your screen)
strips

January 26, 2006

Varian CRINEPT FID

Filed under: NMRPipe and NMRview — kpwu @ 3:50 am

Read from NMRPipe mailing list at Yahoo groups. A guy said the varian version crinept type TROSY has to be process into two files after process, like IPAP type experiment. Although I had processed a CRINEPT type TROSY obtained from Bruker 800MHz, I never know to do such seperation. Moreover, there are some special tips to know for processing such FID, I paste the scripts provided by the poster who said Frank Degladio gave him the script.

———– script starts at next line————

#!/bin/csh

var2pipe -in ./fid -noaswap  \
-xN              2050  -yN               128  \
-xT              1025  -yT                64  \
-xMODE        Complex  -yMODE      Rance-Kay  \
-xSW        13008.130  -ySW         3000.000  \
-xOBS         899.804  -yOBS          91.187  \
-xCAR           4.815  -yCAR         118.438  \
-xLAB              HN  -yLAB             N15  \
-ndim               2  -aq2D          States  \
-out ./test.fid -verb -ov

nmrPipe -in test.fid \
| nmrPipe -fn COADD -cList 1 0 -axis Y -time \
| nmrPipe  -fn SOL                                    \
| nmrPipe  -fn SP -off 0.5 -end 0.98 -pow 2 -c 0.5    \
| nmrPipe  -fn ZF -auto                               \
| nmrPipe  -fn FT                                     \
| nmrPipe  -fn PS -p0 120  -p1 0.0 -di                \
| nmrPipe  -fn EXT -left -sw -verb                    \
| nmrPipe  -fn TP                                     \
| nmrPipe  -fn SP -off 0.5 -end 0.98 -pow 1 -c 0.5    \
| nmrPipe  -fn ZF -auto                               \
| nmrPipe  -fn FT -neg                                     \
| nmrPipe  -fn PS -p0 90 -p1 0 -di                     \
-verb -ov -out A.ft2

nmrPipe -in test.fid \
| nmrPipe -fn COADD -cList 0 1 -axis Y -time \
| nmrPipe  -fn SOL                                    \
| nmrPipe  -fn SP -off 0.5 -end 0.98 -pow 2 -c 0.5    \
| nmrPipe  -fn ZF -auto                               \
| nmrPipe  -fn FT                                     \
| nmrPipe  -fn PS -p0 120  -p1 0.0 -di                \
| nmrPipe  -fn EXT -left -sw -verb                    \
| nmrPipe  -fn TP                                     \
| nmrPipe  -fn SP -off 0.5 -end 0.98 -pow 1 -c 0.5    \
| nmrPipe  -fn ZF -auto                               \
| nmrPipe  -fn FT -neg                                     \
| nmrPipe  -fn PS -p0 0 -p1 0 -di                     \
-verb -ov -out B.ft2

addNMR -in1 A.ft2 -in2 B.ft2 -out A+B.ft2 -add -c1 1.0 -c2 1.0
addNMR -in1 A.ft2 -in2 B.ft2 -out A-B.ft2 -sub -c1 1.0 -c2 1.0

——————– end ———————————————-

Next Page »

Blog at WordPress.com.