Ideas for Sparky development
----------------------------

Read BMRB chemical shift lists (Yongbo Zhang)
---------------------------------------------
Do you have a python script to read in the bmrb
star format of chemical shift assignments?

1D spectrum display, labels, shifts (Carl Eric Olsen)
-----------------------------------------------------
I would suggest that facilities for including 1D spectra be included. In a
peak listing it would be convenient to have the shifts from 1D spectra
labeled, because those values are the most accurate and thus the best
for citing in publications.

Spin graph assigner pattern axes menus confusing (John Gehman)
--------------------------------------------------------------
  The "Pattern axes" menus are doing something confusing.  I had to
read the manual carefully to figure this out even though I wrote the
code!  Here's how Pattern axes menus work.  For the HNCO spectrum the
spin graph assigner is knows peak assignments matching the pattern "H
N C-1" where the -1 means the carbon assignment is for the preceding
residue.  Now Sparky knows your spectrum's axes are w1=N, w2=C and
w3=H so it can figure out the order to use them in to match the "H N
C-1" pattern.  But unfortunately the code is really stupid and gives
you a choice.  The only correct choice is HNC.  This is truly a
horrible user interface for which I apologize.  This says take the
spectrum H axis (w3) and use it to match the first entry in the "H N
C-1" pattern, use the spectrum N axis (w1) to match the second entry,
and the spectrum C axis (w2) to match the last part of the pattern.
For some other spectra there is more than one reasonable choice for
"Pattern axes".  For example in an HNHA there are two proton axes the
amide proton, and the alpha proton.  Sparky knows that two axes are
protons (say w1=H, w2=N, w3=H) but it doesn't know which H axis is the
alpha proton.  So here the "Pattern axes" menu entry really has to be
set right.  In this case the "Pattern axes" menu will contain "HNH
123" and "HNH 321" and the other possible permutations which are not
reasonable.

Fit chemical shift variations in spectrum sequence (Laurent Volpon)
-------------------------------------------------------------------
Calculate Kd from titration experiments by fitting chemical shift
perturbations.

Strip plot y-axis chemical shift display (Laurent Volpon)
---------------------------------------------------------
Want easy way to see ppm value at mouse position along y-axis
in strip plot.

Settable crosshair color (Steffen Graether)
-------------------------------------------
Crosshair currently hardcoded to white in uiview.cc.
This is invisible for spectrum windows with white background.

Show horz line across all strips in strip plot (Laurent Volpon)
---------------------------------------------------------------

Save strip plots in session file (Laurent Volpon)
-------------------------------------------------
Wants to get back the same strip plot display after restarting Sparky.

Put more integration details into manual (Michelle Matejkova)
-------------------------------------------------------------
Can copy details from my email to Michelle.

Support browsers other than Netscape for help (Micheal Massiah)
---------------------------------------------------------------
Want to use Safari on the Mac for Sparky help.  Maybe an environment
variable could specify the program to run with the URL so alternate
browsers could be used.

Chem shift, linewidths, spin graph printing (Karsten Siegmund)
--------------------------------------------------------------

when using sparky (which seems to be great for my needs in many ways),
I noticed that the documentation states:

> This has the strange behaviour that only the region being displayed on
> the screen is put into Postscript, not the whole plot. You need to
> adjust the screen window size to be able to get the printed output you
> want. This is a limitation of the Tk window system canvas printing
> capability. Multi-page output is also not supported.

This is not actually true.
(It seems that Tk/Sparky limits how big the window-size can be adjusted
to the size of the screen as a maximum, so this it is impossible to print
all of the canvas if it's too big)

True is, that the whole canvas *can* be printed, but by default, only the
part visible in the window is printed - if larger portions are to be
printed, a height and/or width has to be given.

Perhaps you could consider changing the function postscript_cb

==============================================
def postscript_cb(canvas):

  path = save_file(canvas, 'Save Postscript', 'save_postscript')
  if path:
    canvas.postscript(file = path)

==============================================

in tkutil.py into

=============================================
def postscript_cb(canvas):

  path = save_file(canvas, 'Save Postscript', 'save_postscript')
  box = canvas.bbox('all')

  if box:
    (x0, y0, x1, y1) = box
    canvas_height = abs(y1 - y0)
    canvas_width  = abs(x1 - x0)
  else:
    canvas_height = 0
    canvas_width  = 0

  if path:
    canvas.postscript(file = path, height = canvas_height)
===========================================================

for the next version of sparky.
(I can create a diff if you wish, but the change is quite minor, so a
copy&paste is propably just as efficient.)

Allow slices to show spectrum diagonal (Dennis Veselkov)
--------------------------------------------------------
Want to show diagonal of 2D spectrum in slice panels.  Show diagonal
in both horz and vertical slices panels.

Make lines for 2D walk for DNA/RNA (Patrick Ladam)
--------------------------------------------------
I don't know if I may adress this to you but I just wanted to send
a suggestion for a new fonctionality in sparky. I have used
gifa for a long time and there is a nice feature in it I can't
seem to find in sparky (I very recently use it so maybe I missed it...)
This concerns the drawing of sequential nOesy walks on the spectrum
itself. I attach a png file so that you can see the output that
displays sequential H1'-to-Aromatic nOe , same can be done in
Ar-to-H2',H3'...This really is usefull to check out your seq.
assignments in different regions for Nucleic Acids. I guess
this would be helpfull too for proteins.

Ask for new path when save fails (John Gehman)
----------------------------------------------
John Gehman lost data when Sparky failed to save a "Save" file because it
could not open the path.  Sparky showed a dialog saying it couldn't save
it with an Ok button.  But it was not clear how to correct the problem.
That can't save dialog should probably allow entry of a new path.

Repackage Mac Sparky as Mac app
-------------------------------
Package it in a Sparky.app directory so it does not conflict with ~/Sparky
data directory.  On the Mac directory names are case insensitive.  Installing
Sparky in you home directory leads to a cryptic multiply defined symbols
error caused by loading spy.so twice.  Would be nice if Sparky.app could
be moved without messing with start-up script.  Look at how I did this for
Chimera.

Read XEASY peak lists (Kyoung-Seok)
-----------------------------------
This would facilitate automatic noesy assignment with CYANA.

Overlays in strip plots (Bradley Dickerson)
-------------------------------------------
Want to overlay cbcaconh onto all hncacb strips.  If source hncacb spectrum
has overlay could just duplicate it.  Would need to make C++ changes to
provide Python interface to overlays.

Sparky mailing list
-------------------
Have online archive of sparky@cgl.ucsf.edu.  And allow others to post
answers.

Peak lock from ornament dialog broken (Bradley Dickerson)
---------------------------------------------------------
Locking an ornament with the check button on the ornament properties
dialog (ot) only works if exactly one peak is selected.  If multiple
peaks are selected it does nothing.  The pk accelerator for locking
peaks handles multiple peaks.

Remember integration box or ellipse (Gaspard Huber)
---------------------------------------------------
I would like to integrate 2D spectra with one of the box or ellipse
integration options without any fitting, in SPARKY software.
Everything works, except that once I have integrated a peak, I did not find
any mean to see the size of the box or ellipse I used.
I think this should be useful to a later control of integration limits.

Escape | in Sparky file assignment names (Karsten Seidel)
---------------------------------------------------------
Karsten describes in a Sparky registration log comment that he was messed
up by using | in assignment names to divide ambiguous assignments.
Fix this for next release.

Chemical shift index plot (Yongbo Zhang)
----------------------------------------

Switched for aliased resonance display (Federica Castellani)
------------------------------------------------------------
Want to be able to turn of display of aliased resonances in resonance panels.

HNCO assignment guessing (Yongbo Zhang)
---------------------------------------
Has H and N assignments for HNCO from assignment guessing and HSQC assignments.
Wants to assign i-1 CO shift automatically if there is one peak on strip.

Depth scrollbar range doesn't update after shifting ppm axes (Kimmo Paakkonen)
------------------------------------------------------------------------------
Toggling show nucleus types fixes this.

Add Python routine for integrating peaks (Kimmo Paakkonen)
----------------------------------------------------------
Wants to automate peak integration for HSQC

Read XEASY peak and chemical shift lists (Vitaliy Ya. Gorbatyuk)
----------------------------------------------------------------
Chemical shifts could be read with no peak assignments for starting
an assignment of a related molecule in Sparky.

Peak selection by atom or residue (Vitaliy Ya. Gorbatyuk)
---------------------------------------------------------
I have been working with XEASY last year and I found it is useful to
select peaks by residue, residue number or atom name and so on.; Then
I can display a peak ("X") and a label of resonances of desirable
residue/residue number/atom name only which does not overload spectrum
in a crowded region.  As I found Sparky has different options of the
selection and can display peaks and labels only for all resonances. I
think it would be useful if Sparky has more flexible tool for
selection and displaying. In such a way people who got used to some
way working with different NMR software will switch easier to Sparky.

Separate peak info panel (Vitaliy Ya. Gorbatyuk)
------------------------------------------------
Have peak info panel that can be used with strip plots and display
in its own window.

Save strip matching information (Yongbo Zhang)
----------------------------------------------
Wants to save information about matching strips before it is possible
to make assignments.  It would be useful to be able to save
information on many walked backbone segments that have not yet been
assigned.  I don't know how this would be presented by a user
interface.  Maybe the "spin graph" Sparky extension could show
connected unassigned resonances and selecting a section of the spin
graph picture could display the relevant strips.

User specified color ranges (Alessandro Mascioni)
-------------------------------------------------
Want to specify new color ranges for spectrum contours.

Contour display optimization (Andrei Popescu)
---------------------------------------------
Wants contour display of large (300 Mb) 3D spectrum to be faster.
Maybe preload spectrum and precompute contours.  Contour computation
could take many minutes.  Might want to save precomputed contours in
a file.  Display of computed contours could be much faster.  Currently
takes 1 second for a 512 by 512 plane on 500 Mhz P3 with high levels.

Alias when synchronizing Views (Gwan-Su Yi)
-------------------------------------------
When view axes are synchronized and one view has larger ppm range then
the other, use aliasing so I don't try to show an out of bounds region
of a spectrum.

Change spectrum background color (Youlin Xia)
---------------------------------------------
Command to change spectrum background color.
Wanted for printing strip plots with white background.
Have second command to change all views to specified background color.

Show assignment distance in Chimera (Marco Tonelli)
---------------------------------------------------
Make the Chimera interface show the distance for selected assignment
or constraint lines.  The Midas emulator dist command will do this.
The command "dist sel" will show the distance between two selected atoms.

Multiple strip plot windows
---------------------------
Permit multiple strip plot windows.  Difficulty is strip plot accelerators
won't know which window to act on.

Change view name (Thomas Merritt)
---------------------------------
Be able to change view names in view settings dialog.
Especially helpful for Bruker files 2rr, 2rr:1, ....

Mac OS X port (Jacqueline McGourty)
-----------------------------------
Simplest would be to have X server running on Mac.
A port to native Mac Tk would likely require replacing some X calls.

Assignment guessing for 4D spectra (Alex Drohat)
------------------------------------------------
For a 4D 13C,13C NOESY want to have i,i,j,j assignment guessing to restrict
the protons and attached heavy atoms to be in the same residues.

Control crosshair correspondence between spectra (Alexander Alexandrovich)
--------------------------------------------------------------------------
Wants w3 axis in N15 noesy (H,H,N <-> w3,w2,w1) to control w2 axis in
N15 HSQC (H,N <-> w2,w1).  The current behaviour maps w2 in the noesy to w2
in the HSQC.  Maybe displaying two w2 HSQC crosshairs to show both
possibilities would be a good fix.  That would be a mess from one homonuclear
spectrum to another.  Probably better to allow user specified axis matching.

Show peak labels for all assigned peaks (Kazuo Kuwata)
------------------------------------------------------
The pl command brings up a dialog which only applies to one peak.
This is easy to do in Python.  Wrote a trial version labelpeaks.py.

Print 1D slices (Eric Paulson)
------------------------------
Print 1D slices without showing spectrum.

Tile plot for 2D spectrum (Jasmin Faraone Mennella)
---------------------------------------------------
  Specify a set of shifts and show tile plot of contoured regions around
all intersection points.

Copy contour levels, integration params, ... (Jasmin Faraone Mennella)
----------------------------------------------------------------------
  Command to copy all types of view settings from a view to one or more
other views.

Overlay strips (Markus Seifert)
-------------------------------

  Want to overlay one strip on other strips.  The contour overlays would
not align ppm scales as the current overlay mechanism does.
But I don't have the overlay capability.  It seems sensible to
make some modification to allow a ppm offset when doing a spectrum
overlay.  A Python interface to that capability could be provided.
Then some user interface to do the desired strip overlays would need
to be designed in Python.  I don't know how you would specify which
strips to overlay onto which other ones and how you would get rid of
those overlays when you no longer want them.  Maybe you just select
one strip and use a strip plot overlay command to overlay it on all
other strips.  And there would be a command to remove the strip plot
overlays.  Do you need to be able to slide one strip over the other or
can I just align the center vertical lines?  Would it be better to use
the "backpack" type interface?  You could have a command to put the
strip in your backpack.  Then you could select any view and overlay it
onto that view with vertical center lines aligned using another command.
I guess both interfaces would be handy.  Maybe the overlay should be
fixed when the underlying spectrum is scrolled?

AutoAssign interface import from file (Kimmo Paakkonen)
-------------------------------------------------------
Add ability for AutoAssign interface to read resonances from a file without
running AutoAssign.  On Windows I can't run AutoAssign because my code
uses os.fork().  I should separate the AutoAssign viewer from the controller.
Also I should use spawn() instead of fork() on Windows.

bruk2ucsf NC_proc parameter (Markus Seifert)
--------------------------------------------
NC_proc in proc file indicates scaling of data values.
Need to apply this to compare intensities from different spectra.

Strip plot add strips in sequence order (Grant Langdon)
-------------------------------------------------------
Have a checkbutton that controls whether adding strips for selected peaks
puts them at the end or inserts them in sequence order.  Probably would
want a command to sort the strips in sequence order as well.

Multicolumn menus (Grant Langdon)
---------------------------------
The View and Spectrum menus go off the bottom of the screen.
Tk 8.4a2 does not offer any automatic handling for long menus.
I have seen two solutions to this problem in other programs.
One is the more... button at the bottom.  The other is a menu
with a scrollbar.  Both of these are quite complex to implement.
They are generally implemented by the graphical user interface
toolkit.  Sparky uses Tcl/Tk and it has neither of these solutions.
Using the Tk multicolumn menu feature is somewhat painful to do
efficiently.  I looked into adding a maximum height option to Tk
menus and submitting it to the Tcl/Tk maintainers.  But it is not
a very adequate solution since there still can be too many menu
entries so they do not fit on the screen.

Eliminate Extension menu (Vladimir Likic)
------------------------
The Extension menu entries are implemented in Python and the File, View,
Peak menu entries are implemented in C++.  But the user doesn't care about
the implementation.  Python extensions would be easier to find under the
View and Peak top level menus.

Pointer mode toolbar with icons (Matt Fesinmeyer)
-------------------------------------------------
Says he would implement this but currently there is no Python interface
to set pointer mode.  Probably would also want Python notifier event when
mode changed so that toolbar could update when user pressed function key
to change pointer mode.

Default directories for extensions (Vladimir Likic)
----------------------------------
Would be useful if Read Peak List used ~/Sparky/Lists as default directory.
Other extensions also should use sensible default directories.

Autoscale slices to selected peak (Marco)
---------------------------------
Have mode for autoscaling slices to scale to max height of selected peaks.
Useful for seeing small peak integration fit next to a big peak.

Separate axis name from nucleus type (Grant)
------------------------------------
Allow spectrum axis names like CACB, CO, HN and have separate derived
nucleus type 1H, 13C, 15N.  Change all Sparky features to use the
appropriate one.

Slices along one axis (Grant)
---------------------
Be able to show slices just along the horizontal or just the vertical axis.
Would be useful for strip plots.

Restricted peak picking (Hunter Moseley, Dani Monleon)
-----------------------
Restrict the picking of 4D noesy-hsqc spectra (C13-H-H-C13, C13-H-H-N15,
or (N15-H-H-N15) using two 2D HSQC spectra.  

Incompatibility with _tkinter thread support
--------------------------------------------
Starting Sparky from Chimera causes a core dump if the _tkinter.so being used
was compiled with thread support (standard on Windows).  Sparky Tk event
dispatching is not compatible with _tkinter thread handling.  Making it
compatible would require replacing Sparky's winsystem-all.cc Tcl_DoOneEvent()
calls with a call to the Tkinter dooneevent function.  This could be setup
with a hook which would directly use Tcl_DoOneEvent() when Sparky is run
w/o Python.  Also it would require making C++ callbacks to Python in
python.cc instead invoke a Tkinter registered python function.  These steps
are necessary to avoid violating _tkinter.c assumptions used in maintaining
the Python interpretter and Tcl thread locks.  It might be useful for
extensions that launch another program (like AutoAssign) to be able to
start a second thread that waits for that program to complete.  Additional
threads would be limitted in what they can do because Sparky is not thread
safe so only one thread can use the Sparky interface.

Homo-dimers and multimers
-------------------------
Nick wants basic homo-dimer support.  Not clear what this requires.
Wants to be able to generate peak lists for Mardigras handling intra-
and inter-monomer assignments.  Not clear how to record whether an
assignment is intra- or inter-monomer or both.

Find unassigned resonances from NOESY plus model
------------------------------------------------
Choose an unassigned atom.  Find all nearby assigned atoms
and display strips for each to find resonance with which they all
have crosspeaks.  Strip plot should be generalized to show 2D spectra.

Separate non-NOE feature from distance.py
-----------------------------------------
This needs maximum signal/noise parameter.  Also should have switch
to exclude resonances with no peak assignments (for exchangeable protons
in a D2O spectrum).  It doesn't require the ppm tolerances.  And it is
basically different than all the other distance.py capabilities that
look at alternative assignments for a peak.

Better file selection dialog
----------------------------
Peak list and assignment distance pdb files should use multiple file
selection dialog.  Other places I use open or save dialog where not
appropriate because for 'open' file must exist and for save it must
not or confirmation of overwrite is requested.  And I can't select
a directory in AutoAssign interface.  The Tk file selection dialog is
junk.  I should look for an alternative implemented in Python for
Tkinter.

Slices should track crosshair from other view
---------------------------------------------
To compare the same slice in two views you now have to move the pointer
back and forth between them.  Would be better if slice in other view
followed crosshair from other view.  Also might be useful for peak info.
How about resonance panel highlighting, and scale crosshair position display?

Save dialog state if session file
---------------------------------
Need to cache dialog options like in chimera extension so I'm not always
retyping the same file paths.  Maybe make attached session data and use it
extensively.  Also I want to be typing the same paths less often.  So
if no reasonable default pdb path exists but user has specified a save
file path use the save file path as a first guess??

Strip plot slice display
------------------------
Add toggle button to strip plot that replaces spectrum views with
1-D slices.  1-D slices can be drawn on canvases occupying same
spaces as view windows.

Strip plot printing
-------------------
Reimplement spectrum printing with simple drawing primitives
and with flexibility to put multiple spectra on a page.

Realtime spectrum reprocessing
------------------------------
Locally reprocess spectrum and update contour plot in real time
to control trade off between resolution and sensitivity.  Multiply
by an exponential in the time domain with time constant controlled
by a slider.  Need to fourier transform to time domain, compose,
and then fourier transform back.  This is equivalent to doing a
convolution.  Need to define a range so I can do this locally.
That will be an input parameter (entry field).  Range will determine
cutoff of convolution function.  I'll need independent time constant
control and range control for each axis.

Write Python lint program
-------------------------
Ensuring the reliability of the Python part of Sparky is more difficult
than the C++ because I do not have the equivalent of compile time checking.
Because of the ability to modify everything at run-time in Python it looks
impossible to do useful checking rigorously.  Instead heuristics will be
needed to find functions that are being invoked.  I looked at kwpylint
by Aaron Waters but it appears to only do trivial heuristic checks like
whether a variable is ever used.  It would be a nice contribution to the
Python community in addition to helping me maintain my Python to write
a simple useful heuristic code checking program.  It should check whether
methods, member variables, local variables, ie references exist.  It
should check that the right number of function arguments are passed.
It would be great to try to type variable, arguments, return types and
look for inconsistent use.  Use the Python parser module.

Projects
--------

Interface automatic noesy assignment program CAR to Sparky.
Improve Sparky/Chimera interface.
Enhance AutoAssign interface for newer AutoAssign.

Requests
--------
Show in peak table peaks assigned in one spectrum but not other (Bill Bauer)
Change spectral width, spectrometer freq, ..., with ucsfdata (Vladimir)
Midas peak selection showing midas line is not in Python version

Things to test
--------------

Things to fix
-------------

Need an easy way to align two spectra.
View windows saved when not mapped don't have position remembered correctly

Write extension to produce correct peak lists for mardigras, dyana, amber, ...
Fix vnmr2ucsf problem with long lines.
Mardigras / Corma planning

Duplicate project - duplicates save files?
Display peak height on slices
pipe2ucsf provide error messages on bad input eg spectrometer freq = 0
Interrupt handling for Python.
Interactive font size choice.
Sparky icon?  Mini spectrum view?

Use GC cache to improve speed of cached contour display.
Transpose volume field in peak lists not updated.
Copied ornaments still shown as integrated with zero volume.
Command to align spectra by lining up assigned peaks (Patrick).

Application modal warning or quit dialog gets buried and Sparky appears hung.

Save sparky data as executable python?

Axis map choice as option menu.

Copy and paste from one peak to one peak ignores limits?

Do full cleanup on quit - file pointers and memory.
Eliminate project Unload(), mReset().

Use purify on spin to eliminate memory errors.

Set default color for labels (Shauna).

Add zero line on slices.
Don't display peak fit in slices if all zeros.
Show peak height in slice panels when pointer over peak.

Data being displayed outside z range.
If z is outside spectrum edge plane is displayed.  Should leave blank.

Pointer over peak should recenter reson panels (Patrick)

Status line on views to show when accelerators goofed up (Anwer).

Resonance list dialog (Patrick)
Peak list - show only peaks above diagonal (Alessandro).

Assignment format (eg. %a1-%a2-%a3) set in assignment options, effects
  labels, peak lists.  Peak list file output header needs format to be
  read by Nick's program:
	%a1-%a2-%a3    Frequency    Volume
			w1  w2  w3

User preferences saved in each save file instead of project
  -- most recent load overrides
View buttons

Add file info to open dialog.
Could put # of key strokes, mouse clicks into log file to measure use.
Make return key equivalent to clicking OK in dialogs.

Spreadsheet interface instead of ornament dialog.
Comment header files of view window code.
Find better way to produce vertical text.
Draw a data structure schematic.
Try PIPP assignment program

Tried
-----

Porting baseline program to SGIs
--------------------------------
Port baseline program to SGIs.  Tried compiling source on picasso but
found source code

	picasso:/oldLOCAL/src/nmr/baseline
	picasso:/oldLOCAL/src/nmr/libs/nmr for libcnmr
	picasso:/oldLOCAL/src/lib for libutil

were inconsistent.  All had been modified up to about 1994 while the
baseline binary on picasso was from Apr 1993.  Looks like baseline
modifications were intended to make it work with libcnmr and libutil
but was never completed.  Makefiles and 2 of 3 baseline source files
are not under RCS making restoration of older versions impossible.

Done
----

New shorter clearer Sparky license agreement
--------------------------------------------
Current license asks for machines you will use program on,
limits backups and has other unreasonable clauses.

Switch to passwords for license holders
---------------------------------------
Host name authentication increasing fails because of firewalls
and web cache machines.  Our web server sees the request for a
licensed Sparky distribution coming from these intervening machines.
These firewalls and caches are added without user knowing so the
problem arises from nowhere.

Spectrum region RMSD (Edward d'Auvergne)
----------------------------------------
Dialog to compute mean and rmsd for region of spectrum selected with mouse.

Strip plot scroll bar resize problem (Markus Seifert)
-----------------------------------------------------
zi in a strip does not result in rescaling scrollbar.

Removing overlays bug (Markus Seifert)
--------------------------------------
Selecting overlay from list and pressing remove is said to remove
wrong overlay sometimes -- usually the first one.

Step upfield/downfield commands  (Vladimir Likic)
-------------------------------
Add commands to move up or down one plane in a 3D spectrum.

Update Tkinter code distributed with Sparky
-------------------------------------------
Should update the Tkinter Python code and _tkinter.c used in the Sparky
distribution to what comes with Python 1.5.2.  This will require testing
of all Sparky extensions under the new Tkinter.
