The Ribosome Builder Project
A software project to simulate the ribosome

Developer Log - willkn

2004-04-27

Created development page for the project home page. Continuing to read the Autotools book to learn about the GNU make process.

Found crashing bug while mapping a sequence from E. coli to 1fka.A in release version: Runtime error R6025: pure virtual function call.

This occurred running the following script: 'script run C:\PROJ\RBO\lua\SeqMap_16S_Ecoli_1fka.lua'

In updating the makefiles in the project, I tried substituting the hardcoded path separator with a macro, but MS Tools are so brain-dead that they get too confused in parsing it ("\\"). Will just have to hardcode the backslash separator for all paths.

Finished changes in makefiles, can now build relative to the src directory. Also added the option to specify a different build path, but that is not tested yet. Also added the option to specify a different install path, but also not tested.

The intent of the reorganization is to be able to define a module in CVS, called 'src' that can be checked out, and then the user can cd into the src dir, type 'nmake /f makefile.win' and build from there. Also, all recursive makefiles are designed to build from their local path, independently of a recursive call.

A second intent is to have the 'src' module be independent of the 'pdb' and 'exp' modules. The 'src' module contains all the files needed to build, install and run a working core application.

Then, there can be a higher-level makefile at the rbuilder dir level, which can do a (build/install/dist) and incrementally use the 'src', 'pdb', and 'exp' modules, as found.

After a little more thought, I will rename 'src' to 'bas'. The 'bas' module contains code for the basic functionality of the program. This seems less confusing than 'src', because other modules such as 'exp' can contain source code (lua scripting code) as well. Also, 'bas' can be thought of as a complement to 'exp' (expansion, experiments, etc.).

2004-04-28

Applied astyle with --style=ansi to all .cpp and .h files in rbuilder code. Did brief test and the program compiles and runs.

Did first submission of code to sf CVS: imported 'bas' module. Did test checkout, build, install and run of bas module on ribo4. It works.

Checked out bas module on beryllium (Mandrake Linux 8.1, Kernel 2.4.8, gcc ver. 2.96). Created first working Makefile for lib/qhull.

Created linux porting progress table for project home page.

Did bug fix and quick release of ver 0.3.1.

2004-04-29

Added history logging to CVS, prior to creating first tag of release 0.3.1. Created first tag on 'bas' module: 'Release-0_3_1'. Tried to list tag info using the cvs history command, but couldn't get it. Spent an hour researching tags, history and logging info in CVS. Looked at CVSROOT files on a number of other sf projects (pymol, python, gaim, astyle, Scumm), didn't see any 'history' files or tag logging info.

Added 'LogHistory=TMAR' to rbuilder CVSROOT/config file, but there is no history file and couldn't find any documentation of what all the flag meanings are for 'TOEFWUPCGMAR'. I guess I will just have to keep track of tags in my own files for now.

Imported 'exp' module from 'exp-0.1.13.zip'. Arg, forget to add 'exe' to cvswrappers! The exe files in exp/tools simply failed to go in. I'll just leave them out of the CVS module for now.

Imported 'pdb' module from 'pdb-0.1.13.zip'.

In doing further development of the Win32 version on ribo4, I'm experimenting with moving the working copies of 'exp' and 'pdb' INTO the 'bas' working directory, so that they will function as up-to-date checked out versions that are used by a running version of the program that has been installed into the 'bas' directory itself. I will create a .cvsignore file in 'bas' to ignore the 'exp' and 'pdb' directories, as well as other files copied to the 'bas' directory during the install. I don't think this should cause any problems. It allows me to have separate modules at the top level in the CVS repository that can be checked out independently, and also located in a suitable nested manner on the local host. I just have to remember to go into the 'exp' and 'pdb' directories explicitly to do any needed updates. I have seen references to doing things with nested modules and aliases with the 'modules' file in CVSROOT, but I don't see a need to do that at this time.

Fixed path separators in VC60 project workspace file in bas/app/rbq/mak. Added VC60 project files to build htsrv and dependency libs (now name 'mmlibs' to distinguish them from the app-specific libs rbqUtil.lib, rbqLua.lib, frameWk.lib). 'frameWk' should really be renamed 'rbqFramewk'.

Also added an rbq_Install VC60 project, so the entire thing can now be built, installed and run from the IDE, eliminating the old batchfile install step.

Added ssh keys and figured out how to get ssh authentication for cvs working on GNU/Linux. It was nearly all straightforward:

The only hangup was that the default protocol on the host was RSA1. Trying 'export CVS_RSH='ssh -2'' didn't work, or using an alias. Finally, found out that the way to go is to create ~/.ssh/config file with 'Protocol 2' line. Then it worked.

2004-04-30

Started on scripts to do unit testing of rbq - lua api functions. Made tst, tst/rbqlua subdirs in 'bas'. Immediately noticed that astyle format has broken the current html doc script app/rbq/tools/doctools/rbq_lua_doc.pl because the extern C { bracket caused all the rbq_XXX funcs to be indented. This is fairly easily fixed by trimming ws at start of line.

Tested VC IDE full build of program on inga, found that rbq.opt file is also needed. I considered adding it to CVS, but it is a binary file and has undesired hardcoded paths in it, typical of poor tool design. Instead, I'll just post text instructions on the build.html page to add the Executable and Working Dir to the rbq_Install settings. Done.

Create scripts listFuncs.pl and utReport.pl in app/rbq/tst/rbqlua. HTML report of progress of unit test definition added to web page docs.

2004-05-01

Updated developer page on project web pages, with info about rbqlua, linux porting, contributors.

Fixed bug in project makefiles: made sure /F switch preceded all makefile.win files because new linux Makefile broke qhull build.

Added intra-doc hrefs for rbq_XXX lua funcs in app/rbq/tools/doctools/rbq_lua_doc.pl script.

Created first rbqlua unit test app/rbq/tst/rbqlua/funcs/rbq_InsPdbFile.

2004-05-02

Updated app/rbq/tst/rbqlua/utReport to include information about existing unit tests (creation date, authors).

Redesigned TestUtil.lua functions to better support test cases. Added test driver to run all rbq-lua unit tests.

Added source and include folders for low-level libs in mmlibs project in VC IDE project workspace.

Added support to glob directories from filespec in wkFileUtils::GetFilenames() and rbq_GetFile(), rbq_GetTotalFiles().

2004-05-03

After adding the 2nd case to the 1st rbqlua unit test, I find that the current implementation of the script processor causes all script execution to fail if an invalid parameter is given in a call to one of the rbq_XXX API functions. This is desirable in certain situations because it gives a stack dump of the lua functions in the app status window. However, it is not desirable for unit testing because it halts all subsequent script execution by the test driver. So I'm adding an option to simply report a bad parameter instead of doing a 'lua_error()'. Probably call it 'enableLuaError()'. Done.

Added second test case to rbqlua unit test rbq_InsPdbFile, which called the function with a missing parameter, after disabling lua_error(), and it worked. The error was reported to app stdout, but termination of lua execution was bypassed, allowing the script to continue running.

2004-05-04

Added test case 3 to rbqlua unit test rbq_InsPdbFile. Added new unit test for rbq_DeletePdbObject. It works. Created rbqlua ut rbq_GetTotalPdbs. It works. Updated rbqlua ut progress page on web.

Next: write ut for rbq_OpenPdbFile() and add code to bypass 'save current doc' dialog.

An interesting press release at Syrrx (http://www.syrrx.com) leads me to think about the possibility that x-ray crystallography could be accelerated past the current bottleneck of trying to get molecules to form good crystals. Syrrx received a grant for a proposal to develope nanoscale structural frameworks that may provide better conditions for the formation of hard-to-crystallize molecules (such as membrane proteins). Should this prove successful, one can envision a whole new field devoted to the design of such structural frameworks, where a framework is customized to support the crystallization of a particular target molecule. More info on the Syrrx grant is located in the project brief at NIST

2004-05-05

Added another unit test script, 'rbq_OpenPdbFile'. This required adding an option to bypass the 'save current doc' dialog that pops up in the main window when the current document with unsaved data is closing. Also added extra logging and checks to the previous unit test scripts. All 4 scripts run and pass.

After noticing a bug in the movie code, and doing a fix, tried to run the mRNA wrap demo and found that the program is not picking up script run request files in the input directory after they are submitted there by htsrv. Found the bug: because of the change to 'wkFileUtil::GetFilenames()', the '.' directory is now being returned. I was going to make the default exclude arg to GetFilenames() be the A_SUBDIR, but I changed my mind for some reason. Oh, it was because I didn't want to include <io.h> in the wkFileUtils.h header file.

After looking, it seems like the input dir filescan is the only other place in the code that uses GetFilenames(), so I'll just put the exclude subdirs param there. Fixed. Movie export also works.

In addition to the rbqlua unit tests, should probably create tests to check browser interface and run demos.

Created another unit test: rbq_GetPdbName(), added more cases to previous tests. Created another unit test: rbq_GetPdbIndexFromName().

possible order of next unit test definitions:
rbq_GetPdbFileName(), rbq_GetObjectIndexFromName(),
rbq_GetTotalChainsInPdb(), chain data access functions,
res access
atom access
object access
selection ops
geom ops:
rbq_GetPdbBoxCenter(), rbq_GetPdbMassCenter(), rbq_GetPdbTransformMatrix()

Started 'app objects' page in whitepaper.

2004-05-06


Created unit test: rbq_GetPdbFileName().
Created unit test: rbq_GetTotalChainsInPdb().
Created unit test: rbq_GetChainDescrip().

Created a menu item to run a sub-set of unit tests (so the user doesn't have to keep running through the entire list each time, just to verify a few new tests).

Created unit test: rbq_GetChainName().

2004-05-07


Created unit test: rbq_GetChainIndex().
Created unit test: rbq_GetTotalResiduesInChain().
Created unit test: rbq_GetResidueName().
Created unit test: rbq_GetResidueIndex().


Created unit test: rbq_GetTotalAtomsInResidue().

next: rbq_GetTotalInterResidueBonds().

Created guide for writing unit tests.

2004-05-08

Found the first serious bug in the unit tests with rbq_GetInterResidueBond(), as I suspected it might. The problem is in the CRbqPdbMol::GetInterResBondIndexList() function, it tries to be helpful by letting the iRes and jRes parameters be in either order of (prevRes, curRes) or (curRes, prevRes). However, this creates a mismatch with the return result, which is always (iAtom, jAtom) where iAtom is always in curRes and jAtom atom is always in prevRes, so iAtom may belong to either iRes or jRes, depending on the order. I need to look through the project log and code to see why I allowed this ambiguity and see what it will take to get rid of it.

In looking through the code, this particular function appears only to be used in the following rbq_XXX lua api functions:

In turn, rbq_GetInterResidueBond() is only called once in the lua code, inside of its wrapper getInterResidueBond() in _PdbUtil.lua. Finally, getInterResidueBond() does not appear to be called by any other lua code.

Next, rbq_GetTotalInterResidueBonds() is called also called just once by its wrapper getTotalInterResidueBonds() in _PdbUtil.lua. Finally, getTotalInterResidueBonds() does not appear to be called by any other lua code. Which is strange.

Perhaps I was just trying to make it a general-purpose function. If so, it needs to be redefined to avoid the ambiguity. Done. Added swap code in CRbqPdbMol::GetInterResBondIndexList( iChain, iRes, jRes ), and some additional specifications in the rbq_XXX functions.

All current 18 rluts run and pass.

2004-05-09

Continuing with unit tests for pdb functions, found an inconsistency in function names between rbq_GetAtomIndex() and the lua lib wrapper func getAtomIndexFromFull(). Currently, another lua lib function has the expected wrapper name 'getAtomIndex()', but this function is distinctly different in parameter and return signature. It should be renamed, but I will need to do another usage check to head off possible bugs resulting from such a change. I think this misonomer function is actually fairly extensively used. Yes, it is, and in some demos, but now is the time to make the change, with a fairly good replacement name, getResAtomIndex().

Changes were made in the following scripts:

Changes in the corresponding func getAtomIndexFromFullName() => getAtomIndex():

The corresponding function rbq_GetAtomName(), and its PdbUtil.lua wrapper getAtomName(), are also misnamed because they actually return just the PDB atom name, with spaces. This is inconsistent with rbq_GetPdbName(), rbq_GetChainName(), and rbq_GetResidue(). Might as well rename this function now, to rbq_GetAtomPdbName(), and create a new function rbq_GetAtomName(), with the consistent behavior.

After a little more thought, the new name should be 'getAtomParName()' where 'Par' stands for 'PDB ATOM record', as this allows for an associate function 'getAtomPartName()', which returns the PDB ATOM record 'trimmed' name. Done.

2004-05-10

Did a 'cvs log' on bas module and it is hanging up on pdb subdir. Don't understand why.

Fixed doxygen target in top-level makefile in bas module.

Added independent c-o-m calculations to unit test rbq_GetPdbMassCenter()

2004-05-11

Finished what is hopefully the final draft of the Ribosome Builder paper for JMGM journal.

Finally learned to use the '-d' option with update in cvs to get new directories.

2004-05-13

Started on a more complex unit test for composite function rbq_GetForceObjProperty(). Finished initial version, it works.

Noticed a drawing bug where selecting the background in the graphics window causes part of chain 1tra.a to be drawn with a light brown color.

2004-05-14

Got wi-fi on ribo4 in the UC!

Added another test case to rbq_GetTotalForceObjectsInDynamicSegment.

Read some of the project development pages on the Python home page. Great background info for how to do collective project development.

Interesting reading of Will Ware's nanocad mailing list back in 1995.

Created rlut rbq_GetElementMass.

2004-05-16

Created rlut rbq_GetElementMass.

More reading of the nanocad mailing list (http://discuss.foresight.org/~pcm/nanocad). Starts off with discussions about goals of nanocad and some initial work on energy minimization and how to represent the data, using Lisp. Then around Feb 1996, a lot of talk about how to extend the core chem computational part with a scripting language and gui and what language to use (Java, Python, Tk/Tcl, etc.), and the reasons why (elegance, portability, efficiency, availability, capability, etc). Very interesting to me as it leads me to think of my own choice of C++ and Lua, and the benefits/drawbacks of that. Konrad Hinsen appears to have exceptionally good insight into both the chemistry and programming end of things, and is a proponent of Python. The subsequent success of PyMOL provides confirmation of his inclinations.

Investigating MMTK.

Created rlut rbq_RotateForceObject.

2004-05-17

Created rlut rbq_TranslateForceObject. Created rlut rbq_TransformForceObject.

Adding retrieval of node children and parent info to rbq_GetForceObjProperty().

Created rlut rbq_GetObjectIndexFromName.

2004-05-18

Working on rlut rbq_RotateForceObjectNode.

While doing some debugging involving rotation of a point around a rotation center through multiplication by a homogeneous transform matrix, I browsed a little of the CGrTransform3f code and how its implemented and used by CRbqNodeBsjForce in timestep movement and one blatant inefficiency is the code


        // update group atoms pos
        for( int iAtom = 0; iAtom < pNode->GetTotalAtoms(); ++iAtom )
        {
            CTorAtom *pAtom = pNode->GetAtom( iAtom );
            CGrVector3f txPos = pAtom->GetUnmovedPos() * txFrame;
            pAtom->SetPos( txPos );
        }

Because this results in a huge number of unnecessary operations being repeating for each atom inside of CGrTransform3f::TransformVector() where GetMatrix() is called:

//---------------------------------------------------------------------------------------------
// GetMatrix - float
//---------------------------------------------------------------------------------------------
void CGrTransformT::GetMatrix( float rgd[16] ) const
{
    // produce the hmTr = hmR * hmT
    float hmR[16];
    m_mRot.GetMatrix( hmR );

    float hmT[16];
    SetIdentityMatrixf( hmT );
    hmT[12] = m_vTrans[0];
    hmT[13] = m_vTrans[1];
    hmT[14] = m_vTrans[2];

    MultiplyMatrixOpenGLStyle( hmR, hmT, rgd );

}// GetMatrix - float

As soon as I finish the unit tests and can start doing some profiling, this may be one of the bottlenecks.

Added rbo test module to rbuilder exp module as 'tst' subdir. Got exp/tst/testGrtRot.lua working, after writing multiplyVectorAndHMatrix() in VectorUtil.lua. Hopefully this will put a nail in my ever-recurring rotation matrix confusions.

In rlut rbq_RotateForceObjectNode(), calculation of expected node positions using VectorUtil functions is now matching rotation produced by CRbqNodeBsjForceObject, with the proviso that the degree argument to getGrtRotation() is negated.

2004-05-19

Trying to finish rlut rbq_RotateForceObjectNode, which requires addition of c-o-m checks for preceding and subsequent force objects, I realized that I needed inter-residue bond info for force objects (to get node rotation axis for root node of a force object, which has an atom bonded to a previous residue atom). This requires addition of 2 more rbq-lua functions, or perhaps, just 2 more properties in rbq_GetForceObjProperty(), 'intraResBonds' and 'prevResBonds'.

Added CBnd::GetAtomIndexPairs() to return a flat list of bonds defined by pairs of indices from the packed multilist representation. Also starting documenting bond representation design in the whitepaper docs.

In trying to get baseline data on intra-res bonds before adding property to rbq_GetForceObjProperty(), tried to run lua/ForceObjectReport.lua and found that it was broken in my dev copy of the bas module because the perl and gnuplot subdirs were not added to cvs (need to update the cvswrappers file in CVSROOT so they can be added).

TODO: update blog with split-brain realization.

2004-05-20

Trying to finish up rlut rbq_RotateForceObjectNode() after adding access to intra and inter-residue bonds for force objects via script API. After adding a test case to do node rotation for multi-residue dynamic segments, it looks like there may be a sign bug in the rotation code somewhere, as the expected rotation position appears to differ from the actual position of node 1 of 1tra.a$.C2 for a rotation of of node 0 of -339.7 degrees in foward dir. The difference seems to be one of direction only.

Debugging rotation in rlut, it seems that a positive rotation fails for node 1 of res 0, and a negative rotation passes for res 0 and fails for node 0 of res 1. Strange.

2004-05-21

Created html doc 'BondRotation.html' to discuss design of rotation about dynamic nodes. Looking over the code in CRbqDynamicSegment::RotateNode(), the two main branches are 1) rotation at node 0 (root node), and 2) rotation at other nodes. In the case of rotation at node 0, all nodes in the force object are rotated, and so the CRbqNodeBsjForceObject::Rotate() function is called, both for the force object containing the node, and for all subsequent force objects. The vector about which rotation occurs is determined by the vector from the atom in the force object residue to its bond partner atom in the previous force object residue.

In the other case, the CRbqNodeBsjForceObject::RotateAboutNode() function is called. In this case, the vector about which rotation occurs is determined by CTorNode::GetDir(). That explains the problem. In CTorNode::GetDir(), the direction is defined from the atom in the parent node to the atom in the node. We don't want to change that definition, because of all the possible problems in forcefield calculations that may result, so the one in CRbqDynamicSegment::RotateNode() will be changed, the one for doing rotation of node 0.

Done. Rbq-Lua unit test rbq_RotateForceObjectNode() is fully passing now.

Created index page for web/wp.

2004-05-22

Still working on the never-ending rlut rfon. Added checking of downstream force objects back in. After test failure, realized that the assumption that downstream force objects are always rotated is wrong. That only happens for descendant nodes that included the downstream inter-residue bond.

Straightened out documentation of linkage status of adjacent residues during forward and back node rotation.

Added testing of back-rotation of force object nodes. The rfon rlut is finally passing with full testing of nodes and force objects in both foward and back node rotation.

2004-05-23

Added links page to project web pages.

Started getting ready to do rluts for graphics functions. Created command 'dev dumpGraphicsWin' to output current graphics buffer to a bmp file. However, will also need to add additional support functions to adjust the main window and graphics window sizes to a specific size so that the graphics dumps will match a reference file.

2004-05-25

The Ribosome Builder paper has been officially submitted to the Journal of Molecular Graphics and Modelling!

Downloaded multiple papers on forcefields for whitepaper references.

2004-05-26

JMGM has rejected the Ribosome Builder paper immediately, saying that papers about computer programs are no longer accepted. The paper has been submitted to JCC (Journal of Computational Chemistry).

Trying to get unit test rbq_DrawBitmapText to work. The problem is that after resizing the main window to a fixed known size, and then doing a write of the graphics window buffer, the graphics child window has not been resized. After a call to resize the main window, the CRbqGraphicsWindow::resizeGL() method is not being called.

Created some documentation for the main window and child widget layouts while working on the graphics window resize problem. Been reading through the Qt interest mail archives, but no enlightenment yet. I think the problem is that the status window and toolbars are rapidly turned off and then shortly afterwards, turned back on again, so perhaps some messages are being combined in an event message queue to prevent the graphics winodw from being resized as desired. The way to figure it out will probably involve overriding some event methods in the Qt classes and doing some printfs during the sequence.

Before doing that, I think I may see the cause of the problem: all of these hide() and show() events are happening sequentially inside of a single script function, and the re-layout/ resize() events that must occur in Qt will naturally happen after the script function has completed. It seems that I'm wanting some 'immediate', non-queued calls of the re-layout/resize and code.

After adding a resizeEvent() override in CRbqGraphicsWindow, the above hypothesis has been confirmed.

2004-05-27

After yesterday's time-consuming debugging with Qt resize events, I've come to a final decision on how to deal with the problem. Instead of trying to hack things to get 'immediate' behaviour from the windowing code, I'll just extend the current unit testing methodology by defining an additional type of test which will be called 'tickTest.lua'. The current testing method uses a test driver that iterates all subdirectories in the tst/rbqlua/funcs directory and calls each 'test.lua' script in a directory and then procedes to the next one. This method requires immediate behaviour from the application during script execution.

By defining an optional 'tickTest.lua' script within a unit test directory, a unit test can be executed by a script object test driver, using timer ticks in the application main event loop. This will allow a script to initiate operations and then check for the expected application behavior in subsequent blocks of execution code, after a particular block of script code has completed. This will solve the graphics window resize problem above, as well as allow for testing of forcefield behavior across multiple timesteps, which is not possible in the current testing scheme. Will also create associated drivers, 'runAllTickTests.lua' and 'runSubsetTickTests.lua'.

Added documentation of main window architecture to wp.

Created first draft of wp outline. Created first draft of goals doc in wp. Reading (MacKerell, 1995).

Creating some more screenshots.

Note: nice sky bgcolor: .64, .65, .88

2004-05-28

As a good way of building resources for schematic simulations, reviewing ribosome-specific journal articles and getting more familiar with the landscape of the ribosome I am resuming creation of annotations of journal articles, starting with the classic (Ban, 2000) paper.

Trying to fix resizeMainWin() to set size of frame instead of client area (not as easy as it should be because apparently in X11, the frame decoration can be inconsistent, so Qt is weak in this area).

By having working move and resize functions for the window frame, this will save a lot of time because it allows scripted setup of the window position for working with the browser interface, instead of the continual manual resizing and positioning that I have been doing up until this point. Move and resize funcs are working. It is good.

Working on 'lua/CircleObject.lua' script, it is currently drunk. I think I will rewrite it and do it a little differently, without the pitching. Just some simple turns, up/down and forward/back moves.

Actually, simplified it even further by chucking the initial code that sets the view while moving to the circle radius. New version of 'CircleObject.lua' is working.

2004-06-01

TODO: update toolbar descriptions in the User Manual.

Starting on creation of tick unit tests. This requires creation of some scripted way of deleting script objects.

Implementing new command 'script so sdelObj' (schedule delete script object). In doing so, I reviewed my earlier log entry about script object deletion (projectLog_2000-2004.html, 2004-02-24), which gives some further explanation of why deletion of script objects from within script object executing code must currently be prohibited (one reason is to prevent document closing, which causes deletion of all script objects and other annotations). At present, there will be some duplicated code with regard to deleting script objects and deleting annotations, but no time to worry about that right now.

Created test script 'exp/dev/tst/testDeleteSo.lua'. Scheduled deletion of script objects appears to be working.

2004-06-02

Rotamer-covariation idea: in reading (Walberer, 20003) this morning, I got to thinking about a dynamic version of isomorphism and covariation, where one could start with two separate strands of RNA that are docked together (close complementary fit), and each strand has its own rotameric conformation, and then try to generate a range of new rotatmeric conformations for each strand separately, and then from this pair of very large conformational sets, try to identify the very small subsets in which a conformation from strand A was still complimentary to a conformation in strand B. This would be a 'complementary covariation', which could be highly indicative of a possible movement motif.

Finally added a helper function for creating script objects, 'constructScriptObject()', to _ScriptUtil.lua.

Initial version of app/rbq/tst/rbqlua/funcs/rbq_DrawBitmapText/tickTest.lua is working.

2004-06-03

Actually, no, it isn't. Hit a snag where the dump of the graphics buffer is not showing the expected drawn text, even when the draw is being done in a 'draw()' event script and is checked in a subsequent tick in a tick event script. Need to do more debugging.

Created 'exp/dev/tst/testWriteGraphics.lua', which defines a tick script and a draw script for a script object. The draw script calls rbq_DrawBitmapText() for each tick, and the tick script does a graphics buffer dump and a redraw for each tick, for 10 ticks, but the text never shows up in the output files.

Looking at the output of the event scripts, it seems that the draw() event is called after the tick() event, for each tick. Also, it is necessary to call redraw() from within the tick event in order for the draw event to be called each tick. However, very strangely, if a second exportGraphicsWinBuffer() call is done in the tick event after the redraw(), the draw event is not called! That doesn't make sense!

Wait, calling the exportGraphicsWinBuffer() function does cause a 'renderPixmap()' function to be called. Is this clearing the 'redraw' flag?

Ah, think I see the problem: the paintGL() is being initiated by the renderPixmap() call, but all this is happening from within a tick() event call, and the script manager must be preventing the call to the draw script. If so, at the very least, a warning should have been reported. Yup, that's the problem.

Added warning to CRbqScriptObject::RunScriptFile().

This current restriction appears to prohibit testing of graphic contents through script object tick and draw events. One workaround may be to add a 'post message' hack to allow a tick event to request a graphics dump from outside of its executing code (similar to the recently-added 'scheduled delete' of script objects).

Was about to add command 'dev schedDumpGraphicsWin', and associated function in CRbqMainWindow() 'ScheduleDumpGraphicsWin()', when I realized that I could generalize it to a submission of a list of commands to the command processor instead. This allows script object tick event code to submit arbitrary commands for execution after the event code execution has completed, eliminating potential problems where one of those commands would result in the need to run some other script object event code (not sure, at this point, how much that would be needed, but the functionality will be in place). Currently, only the 'dev dumpGraphicsWin' command requires this functionality. In retrospect, the function to do scheduled deletion of script objects could have made use of this more generalized function.

Added command 'dev appendPteCmd' and associated functions. A fortunate bug in the cmd processor code also revealed the need to add a reentrant check for CRbqMainWindow::RunPteScheduledCommands().

Whew, after adding the 'dev appendPteCmd', the tick-driven graphics draw and write is finally working in exp/dev/tst/testWriteGraphics.lua!

2004-06-04

The only remaining strange thing about testWriteGraphics.lua is that the appendPteCmd in the final tick doesn't appear to result in a call to the draw event script. Ah, no big deal, just a bug setting the done flag in the tick script.

rbq_DrawBitmapText unit test is finally passing! Wow, a new world record, 11 days (2004-05-25 to 2004-06-04), over the previous winner, rbq_RotateForceObjectNode, which took 6 days (2004-05-17 to 2004-05-22).

Created new unit test rbq_DrawOrthoText. To avoid code dup, will create a helper script object that will do the setting up of the graphics window to a specific fixed size. This will also simplify the test case code for the unit tests, as the tick function will just wait until the helper object has completed the setup.

Created helper so script 'rlutSetGraphicWin.lua'. Also, for the first time, in adding another function to the 'TestUtil.lua' module, I decided to make the function a member of a 'TableUtil' object, requiring qualification of the function call: TestUtil.getRlutDir()', because at some point, name clashes will start to be a real problem with the current 'global' function scheme. However, a transition to this better way will require huge code changes, although Lua appears to have many mechanisms for adding global names, local names, and putting module names in the global namespace (Lua book, Chapter 13).

However, this change also has consequences for the documentation scripts (alphabetical ordering), but that may not be too big of problem. We'll try it and see.

Changed rlut rbq_DrawOrthoText to use new graphic setup scheme. The test is working.

2004-06-05

Adding test driver for tick unit tests.

Added documentation of tick unit tests to Guide for Writing Unit Tests.

Created StringUtil.parseOptions().

Created 'tickTestDriver' script. Created 'runSubsetTests-postTtd.lua'. There is now a heavily duped-code problem between runAllTests.lua and runSubsetTests.lua. Probably will ditch 'runAllTests.lua' and create an 'all.testNames' file and call 'runSubsetTests.lua' with that file as a param.

'immediate' and 'tick' unit tests are both being run from 'runSubsetTest.lua'.

2004-06-06

There is a bug in the new 'compareFiles()' function in _FileUtil. It is failing to spot the difference between two png files. The problem seems to be that the lua readfile() function is reading in text mode instead of binary mode. Ah, after looking at the lua docs on file modes, I noticed that it says you can add a 'b' to the mode flag. Fixed.

Added another test case to rbq_DrawOrthoText, to fill up the screen.

Created rlut 'rbq_DrawBlockArrow', 'rbq_DrawBox', 'rbq_DrawCylinder', 'rbq_DrawCylinder', 'rbq_DrawSphere'.

2004-06-07

Modifying rlut script 'runAllTests.lua' to use 'runSubsetTests.lua' so that tick tests will be included. Done.

Ack. Graphic unit tests are failing now because the png format doesn't appear to be invariant. A file of a different size is being produced today compared to yesterday, pretty sure the actual image is the same. Not a major show-stopper, just more time spent doing research on png format and possible alternatives.

Spent gobs of time downloading, compiling, running sng (scriptable network graphics) to output sng versions of differing png files, and writing a little perl script to give the diff lines and offsets. Then, tried to spot the individual pixels in photoshop but couldn't. sng files appear to show a numerical difference of a single digit, indicating some kind of round-off error.

A brief search on the web didn't bring enlightenment. The next step should be to save as bitmaps to see if this error occurs again, though how often it will occur is not certain to me. If the error is resulting from some kind of processing in the png, the test could be changed to output as bmp, though it would be desireable to add some kind of compression with that because the files would be much larger than necessary otherwise. Another nice option would be if someone has written a graphical diff tool. If so, it might be possible to do a compare with that which would disregard diffs due to round-off error.

No luck on image-diff. However, I suppose I could write a dedicated program to do that on the images without too much trouble. Although it has already been too much trouble.

Downloaded png2bmp, compiled, it works. Now I can just call that from the test script and then do a binary compare on the bmp files. They currently differ by just 1 for 11 bytes in the file. Will write a small c utility to do a fast check: 'minDiffByteVal' or something like that, which will return a result code to the test script.

2004-06-08

Hmmph. As I suspected, the graphics tests are passing today. Wonder if that round-off error is due to some subtle memory bug or something? Only did a subset test with the 5 current graphics tests though. Previously, the error happened when they were run at the end of an 'all test' run. Will do that again to see if the error repros. No, all tests are passing now. Oh well, I won't worry about it for now, but I have a solution to be applied if the problem recurs.

Updated the links page with some more molecular modeling mailing archives.

Submitted a project report to the Lua website about Ribosome Builder.

Did a little research on GUI libs for lua. wxLua looks interesting. One possible problem is that support for Lua 4.0 is disappearing. wxLua 1.4 still supports it, I will grab that one for the present time. Also, wxWidgets may be a good alternative to Qt to escape the current VC 6.0/Qt 2.3 bind.

Rotamer covariation!! Do it!!

Created rlut rbq_GetAtomTypeVdwRadius().

Working on more atom type-related rlut funcs. But there is a problem with nomenclature. I noticed that there currently is not a function to return the actual 'atom type' id for a particular atom of a dynamic residue. We need the function 'rbq_GetAtomType()', similar to the existing function 'rbq_GetAtomElement()'. But there are already several functions 'rbq_GetAtomTypeFromName()', 'rbq_GetAtomTypeName()' and 'rbq_GetAtomTypeVdwRadius()'. In all of these functions, the 'Atom' in the 'rbq_GetAtomTypeXXX' refers the 'AtomType' type, not the actual atom that possesses a particular 'atom type'. It's very confusing, but I'm not sure how to sort it out. The term 'AtomType' should probably be changed to something else, like 'ChemType' or something. But can't do that right now. Will have to think about it. For now, will just have to try to deal with it by putting sufficient comments in the api docs.

So this work will involve actually adding two more rbq-lua funcs, pushing the rlut progress back somewhat! Needs to be done, though. This also brings up an additional problem that I've noticed in the rbqlua api, that a number of current functions only info for static atoms, not dynamic atoms. Of course, the force object atom properties are provided indirectly through rbq_GetForceObjProperty() and the high-level lua lib functions getForceObj_XXX. Actually, probably only one for now, don't strictly have to add rbq_SetAtomType() at this time.

That can be done in a non-runtime way by adding more definitions to the atomType files, though that really must be documented in the whitepaper soon.

2004-06-09

Added some more documentation of atom types to whitepaper. Added 'rbq_GetAtomType()' to rbqlua api. TODO: add test cases to existing static-atom-only rluts that try to use dynamic atoms instead (isn't this the same as passing an invalid index?).

Created rlut rbq_GetAtomType(). It works.

Create rlut rbq_SetAtomTypeVdwRadius(). In so doing, it becomes apparent that there needs to be a way of restoring the compiled default values. Currently, there is no way of doing this. If this unit test fails during a run, it will continue to fail until the program is restarted.

2004-06-11

Created more drawing rluts, 'rbq_DrawLine' and 'rbq_DrawBackbone' and ran into another potential problem where turning off display of the rotation axes changed the bitmap image of rbq_DrawLine slightly, even though the rotation axes are not visible when the view is centered at the origin. However, they are affecting the rendered image by changing the value of several pixels. Not a big deal, but it may mean updating the reference images for previous graphic rluts. No, that isn't the problem. Ran the test again with the rot axes off and the test image became different again! Arg.

2004-06-12

Did full rlut test with the app window in the fore-ground and all tests pass. When running a subset of tests, rbq_DrawLine rlut appears to consistently fail, but it seems to be the only one doing so, so I won't worry too much about it right now.

Adding rbq_DrawOrthoQuad, which is needed for transparent billboard display in the schematic sims. This caused me to review why I had to implement a separate transparent drawing pass in the main render function. After reviewing the code in CWkSmoothColorMesh::DrawTransparentTris(), it's because I had to disable the depth mask by calling glDepthMask(GL_FALSE), prior to calling glBlendFunc( GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA ). I did this because I didn't know much about transparent rendering and didn't have a lot of time to learn about the best way to implement it. It seems that a whole separate rendering pass is the wrong way to do it, and it doesn't even work properly with multiple transparent surfaces.

A brief search showed some posts on gamedev.net where people are doing it this way (a separate, subsequent rendering pass for transparent objects). Also, the sorting of transparent triangles from far to near in drawing (painter's algorithm) is mentioned. I am doing this for individual pdb objects, but not globally, so that is why my transparent rendering is not always correct. And given the existence of transparent drawing for script objects, implementing a global draw ordering of triangles will be more difficult.

Read a nice paper on transparent rendering. It makes the clear point that if the depth buffer is turned on, then an opaque object that is farther from a transparent object, but rendered later, will not show up. It also mentions the 'draw solids first, then depth off, then draw trans objects'. So the current method does not seem totally wrong , except that somehow global sorting of triangles needs to be done for the transparent pass. The only way that I can think of at present is to change the actual drawing code to some kind of 'submit these triangles to a drawing list' operation, and then the top-level draw trans function does the sorting and actual drawing of triangles that were submitted by the object hierarchy. I suspect however that with the newer graphics cards and engines and dynamic lighting and such, that this whole line of talk may be completely archaic and irrelevant. Time will tell.

Added some notes on transparent rendering to the whitepaper.

rlut rbq_DrawOrthoQuad is working.

There is a bug in OutputCurSelTorsions.lua, when run on 1tra.pdb. Wow, the similarity of getAtomParName() and getAtomPartName() is totally confusing. Arg. Renaming: 'getAtomParName()' renamed to 'getAtomPdbName()'. Thought about renaming getAtomPartName() renamed to 'getAtomTrimPdbName(), but reconsidered because there needs to be a function that returns the partial 'atom-only' part of an atom name, in contrast to 'getAtomName()', which returns the full name.

Fixed bug in getAtomPartName(), dihedral/torsion scripts are working again.

TODO: create a script in the 'Geometry', 'Torsion' menu to create an html report for dihedral angles of current selection (just need a driver for the exp/dev/report/DihedralReport.pl).

2004-06-13

Adding 'TorsionFreqReport.lua'. There is a bug in the generation of html docs for the lua_lib api functions, the qualified function name 'ScriptUtil.parseOptions' is showing up in its own section in the column-based list of names in the indexes. This could also be considered a feature, but looks bad. Also will get worse as more qualified functions are created/converted. The current perl script the generates the docs is a mess and should probably be rewritten at some point.

Updated ScriptUtil.parseOptions to handle short options, long options and non-options.

Torsion Angle Frequency Report script 'lua/TorsionFreqReport.lua' is working. I think the next step after this was something I was thinking about a while back, a way to generate a frequency report from a list of objects. This would allow the accumulation of statistics for a larger pool of conformations.

Thinking about how to implement this 'cumulative' version of torsion frequency calculation, this shouldn't be too hard. The current version creates a 'torsion angle' file from the current selection, which has a line for each residue, containing the torsion angles for that residue. In the cumulative version, we can just define a 'torsion angle' file that we append residue records to, for all residues of all models in the source model list. This file should be able to be input to the existing perl script 'MakeTorsionFreqTable.pl', without any modifications. The only change would be that column 1 would have the full dotted name of a residue instead of its numeric index, but that shouldn't be a problem. The only remaining issue is what to name the new script. Something like 'multi-model torsion freq report', 'mmTorsionFreqReport.lua'. That works.

This work is preparatory to taking another shot at accumulating g-rotamer stats (general rotamers, 324 possible compared to the 42 proposed by (Murray et. al, 2003)). This involves all possible combinations of (P1, z, a, b, c, P2) where P1 and P2 are 3' and 5' pucker and (z, a, b, c) are the 4 torsion angles that can be in one of 3 states: m, t, p (gauche minus, trans, gauche plus). The only thing that bothers me is that the Murray table gives a constant value for epsilon, but the frequency stats I just generated for epsilon for 1fka show quite a bit of variation. It makes me curious what feedback there has been to the Murray paper. 0 hits on Usenet. You know, it's pretty damn sad the way the Usenet has completely disappeared with respect to scientific discussion.

Added a little about torsion angle anaylsis to the whitepaper.

2004-06-14

Added new rlut 'rbq_GetViewCenter'. Added more xrefs to lua_lib view functions. Finished 3 more rluts.

Created script 'lua/mmTorsionFreqReport.lua'. Starting to get a better idea about where I want to go with the rotamer thing. An immediate project would be to try to produce torsion-directed conformational change of 2 linked residues from one rotamer to another, for every possible combination of the 42 m-rotamers (and possibly, some additional well-represented g-rotamers). This would be 42 * 41 = 1722 simulations if bi-directional changes are investigated, or only 861 simulations if only uni-directional transitions are done. The relative difficulty or ease with which a subset of the transitions may occur can then form the basis for further investigation, especially the coordinated transitions involving multiple successive residue suites.

mmTorsionFreqReport.lua script is working, with only minor changes to exp/dev/report/MakeTorsionFreqTable.pl'.

So, before proceeding with this project, I need to get solid g-rotamer and m-rotamer stats from a large source of nucleic acid structures. This will require a rotamer version of the mmTorsionFreqReport script that has just been created. There are existing rotamer perl scripts in exp/dev/report. I need to create another lua marshall script, 'mmGrotamerFreqReport.lua'.

2004-06-15

More work on g-rotamer frequency calc and reporting. mmGrotamerFreqReport.lua is working. Ran it on 6 large ribo pdb models, 4 30S and 2 50S. One notable point is that in the top 11 g-rotamers, 6 of them are non-m-rotamers. Strange.

2004-06-16

Adding selection and highlighting of inter-subunit bridges to Features menu. 1gix 30S bridges defined and working. Added 1giy 50S bridges.

Started writing a script to automatically convert bridge scripts for 1gix/1giy to other pdb models, but I think it will be too much work and will be faster to just manually create scripts for additional models such as 1ffk, 1fka (at least for now).

Creating bridge-select scripts for 1ffk. Note: L19 (involved in bridge b6) is radically different in size and location in 1ffk compared to 1giy. Instead, L24E is the 1ffk version of 1giy L19.

2004-06-17

I realized today that the way I implemented the isu bridge selection scripts is quite wrong. Creating a script for every bridge results in far too many scripts and redundancy. It's much better to put all the bridge definitions in a single script and select according to params. Don't know why I didn't do it that way in the first place.

This changes requires adding arg support to the ScriptDefs.ini file. Hope that won't break anything. Actually, it doesn't. The current mechanism already supports additional arguments after the script file name.

New version of bridge selection is working. Also added functionality to select all bridges.

Looking for newer models of ribosomes, found 1pns, a model of E. coli 30S, stated as 8.70 A resolution, but the model used full-resolution atoms. Nice. Of course, Ribosome Builder should have a similar full-atom capability.

2004-06-18

Created exp/dev/sub70/Bridges html docs. Created helper script 'lua/selCgiRanges.lua'.

2004-06-19

Working on modelling results from Scott Hennelly's kinetic probing. One thing that I noticed yesterday was his use of Rasmol to view the 16S, with covalent bonds displayed instead of backbone, and how the depth-cueing worked well to convey the 3D illusion. It might be worthwhile to consider adding depth-cueing to rbq, if not too difficult. Also need to check to see how PyMOL and VMD handle it.

Created a dynamic portion of 1j5e.A helix 27 and looked at the initial forces. There appears to be a bug in covalent force calculation because the initial structure shows a lot of covalent force arrows, all aligned in the same direction. There should be no initial covalent force on a newly-created dynamic structure which has not been allowed to move. I wonder if it is just a round-off error? Started initial control sim of selected portion of helix 27 on ribo4. After 140 frames, looks fairly stable.

2004-06-20

Trying to improve torsion spring usage by adding better graphical indicators. Added annotation function 'drawWireArc(). It works.

2004-06-21

Almost had nice indicators in drawing torsion spring dials, but then ran into a problem where the current implementation of 'rbq_DrawWireArc()' doesn't specify the proper 'up' vector. Not sure how to fix it.

Redefined rbq_DrawWireArc() to take explicit ptCen, vLook and vUp. It appears to work.

Drawing of torsion dials is finally working.

2004-06-22

Now drawing of torsion dials to correctly reflect applied torques is really working (excepting special iUserGAD mode). One problem however, for some strange reason the frame rate drops dramatically when the delta angle goes to zero. The slowdown is in drawWireArc().

Found the problem. Was calculating fraction of 360 degrees inversely in rbq_DrawWireArc(). Fixed. Now there is another bug where the arrows flip direction. Actually, this looks like a bug in the DihedralUtil.lua code, because when the flip happens, the reported torsion angle flips from 0 to 180. I thought that was an old bug which had been fixed! Arg! Looking at old log, on 2004-03-26, the description of that old bug seems to be exactly the same problem. The cause was a zero cross-product. In this new bug, the problem seems instead to be from vectorAngle().

Fixed. Hope this is the last of the dihedral bugs! Torsion dials appear to be working. They appear to be very successful in indicating what the torsion springs are supposed to be doing.

Working on ribo5 to simulate inter-subunit bridge interactions for Hennelly paper. Will simulate all bridge residues dynamically by creating inter-residue meshes using new script object 'interResSpring.lua'.

Along the way, needed to add support for dynamic residues to script 'lua/ReportSelResDistance.lua', but in so doing, found bug in getSelectedForceObject(). Arg. Has something to do with the fact that there are multiple dynamic segments with the same chain name. Failure is in CRbqDoc::GetDynamicSegmentIndexFromName(). Actually, it's in CRbqPdbMol::GetDynSegMhIndexFromName(), which doesn't even consider multiple dyn segs per chain!! TODO: add creation of multiple dyn segs per chain to dynamic model unit tests!!!

Note: the bug above doesn't show up during mouse selection, because that is by index instead of name.

Hopefully fixed bug by adding 'CRbqPdbMol::GetOrdinalDynSegName()' fixup in CRbqDoc::GetDynamicSegmentIndexFromName(). Bug appears fixed. ReportSelResDistance.lua is working for dynamic residues in multi-segment chains.

2004-06-23

Added labels to bridge residues ('CreateBridgeLabels.lua'). In so doing, fixed some bugs in _GeomUtil.lua where the function wasn't check for nil values returned from rbq_FuncXXX and in creating a table of nil values that was returned, the table was not nil, but getn( table ) returned 0.

I've worked out a way to systematically create the inter-residue spring-bonds for the subunit bridges. Adapting from 'initTorsionSpringsFromFile.lua' and the associated .ta file, I will create the script 'initLoopMeshFromFile.lua' and an associated .loopMesh file, which is simply a list of records where each record specifies the start and end static residue full names for dynamic segments that will be the loops. The script will create all the dynamic segments and then define inter-res spring bonds that connect the endpoint residues of each dynamic segment with the N nearest neighbor endpoints. This should produce a fairly stable yet efficient mesh.

Finished 'initLoopMeshFromFile.lua', defined bridge and adjacent residues in subunits, started first inter-subunit mesh sim on ribo5.

2004-06-25

Found and fixed bug in CPovRayExportGraphics_PdbSurf::OutputSurfGraphics().

2004-06-28

After input from Scott H. that display icons to turn off backbone/covalent/spacefill were not obvious, changed the icons to have a red circle with slash through them, and also changed ordering from reflective ordering wrt to 'on' icons to same ordering.

Next work on modeling bridge interactions is to produce some kind of quantitative analysis of bridge residue proximities over time. A way that this could be done is to define an approach vector of one subunit relative to another, then incrementally move the subunit along this vector and calculate the steric energy between bridge residue pairs. Will create a script called 'bsa.lua' (for bridge steric approach).

2004-06-29

After a suggestion from Scott H., added file drag-and-drop. It was trivial to implement because of Qt support.

2004-06-30

Working on improving export of graphics to POV-RAY. The current implementation can only export backbone or surface, as two separate files. Need to integrate them, and possibly add covalent and spacefill generation.

The way that things are currently done is that, for backbone output, a function, 'ExportGraphics()', opens a new .pov file from param filename, outputs some common boilerplate povray code, which does required includes for povray functions such as math.inc, sets the background color, camera location and orientation and light source. Then, after declaring the start of a union block, the file handle, along with a param export graphics object, is passed to the document object, which traverses the pdb object hierarchy to output triangle meshes and cylinders to represent the nucleic acid backbone (proteins are not currently supported).

The same thing is done for surface mesh output, except that the pointer to the 'CExportGraphics' object is pointing to a CPovRayExportGraphics_PdbSurf object instead of a CPovRayExportGraphics_NucleicChain object when entering the CRbqCmdProcessor::ExportGraphics() function.

The document object just iterates each pdb model object, passing the param output stream and CExportGraphics ptr. Inside the CRbqPdbMol function, a dynamic cast is done to detect whether it is a CPovRayExportGraphics_PdbSurf object, in which case the pdb surf object member function 'OutputSurfGraphics()' is called. Otherwise, each chain in the pdb model is iterated, calling the 'OutputGraphics()' function of the param CExportGraphics object, which in this case is a CPovRayExportGraphics_NucleicChain object.

This current implementation is quite messy and needs to be redesigned.

Combined surface mesh output with nucleic chain backbone output. Also fixed some other things in the POVRAY code, such as the view problem that existed before, where the position of the graphics in the OpenGL window didn't quite match that in the POVRAY image. I found that an angle of 75 in the POVRAY camera seemed to produce a good match.

The POVRAY export is much more usable now. One more thing to add would be transparency to surface meshes.

Did unit test run, all passed. I think it may be time to do a new file release, perhaps after adding transparency to povray export.

Added transparency to surfaces in povray export, it works.

2004-07-01

Built some distribution files for 0.3.2. Also, trying to get pictures out ASAP for Scott H. Thought that I had got the POVRAY export to a workable state and now find that it isn't doing colors for each residue correctly in nuc chain backbones. Arg! Oh, it's because I changed the code to apply a global texture for the entire chain.

Added coloring of each residue to povray nuc chain graphics. However, the problem with that is that the current implementation defines a nurb ribbon segment from the backbone atom of the current residue to the backbone atom of the previous residue, and when a single residue is colored differently from the adjacent residues, it looks weird. The expected coloring should go from the midpoint between cur res and prev res to the midpoint of cur res and next res. So this would require calculation of nurb segments involving the next residue. More work.

Actually, because the phosphorus atom is the first atom in the residue bb chain, setting the color using the previous residue color should work (nurb seg is from current phosphorus to prev phosphorus).

This is still a problem with missing bases (backbone atoms only), because the backbone ribbon requires an orientation. I may implement a second version of backbone export using povray sphere_sweep, which would also work for proteins.

Added new version of backbone rendering in povray export using sphere_sweep object, it works! Added covalent output, it works. Added spacefill output, it works.

Generated another picture of the 702 region in 1j5e for Scott, it looks much better now.

2004-07-02

Ack. In trying to get out a new file release, am finding a bad bug that is release-version only. It happens during export of graphics to povray, where degenerate cylinders are produced. Examining the diff in the povray outputs, it looks like a bug in the inter-residue bond code. In the release version, the atom of the previous and next residues is being returned for both the i and the j atoms in the inter-res bonds involving the current residue. Crap! It's a goddamned Heisenbug!!!!!! I think it may be related to some kind of temporary involving CAtm.GetPos(). Yes, of course. That is it, I think. Wonder how many other places that is done? Fortunately, 'GetPos().' is a good search pattern.

Installed winzip8 on ribo5 to create a distribution there using the personal self-extractor. TODO: replace with a free sfx version.

Fixed GetPos() bugs.

Building and testing rel can 0.3.2 on ribo5. One big problem: the 'Error: already running script...' message (and companion 'Error: failed running script...' message in CRbqScriptObject) is slowing things down when running the translation init demo. Need to change warning so that it is only given once per a particular currently-running script.

Done. Trans init demo re-runs without problems now.

Downloading povwin3.6 to ribo5 to test rb povray export. It works on a test render of 1fka and 1j5e, but there is a strange little artifact in part of the image. I think I will release this version.

Also ran the unit tests, and all non-graphics tests appeared to pass, and a check of the final graphic image appeared ok. At some point, when there is time, I will add the .bmp image check because I think the diffs are just do to math roundoff errs.

Did file release of version 0.3.2.

2004-07-03

Experimenting with doing surface mesh on selected helices (currently have to export them to their own pdb file to do that) and 'dev setSurfVdwExpand' set to 1.5 and 'draw surf createForPdb 1.5' are giving good results for showing the true vdw surface boundaries between adjacent stacked helices.

Trying to get a better feel for how helices pack against other helices. It's hard to see things with full vdw radii, but otherwise, it's hard to tell exactly what is packing against what. It would be really nice to discover some simple motifs or patterns of stacking, involving individual atoms. One way to start with that might be to write a script that, for any given atom of a residue, will output the nearest three atoms of a neighbor packing residue. Then correlations could be done between pairs of atoms, and their 'tri-nabor' pack atom pairs, and so on. Also, could output pairs of atoms that are actually 'touching', though this depends on how the vdw radii are defined.

2004-07-04

Did a brief ff sim to investigate helix packing between 1j5e.A helix 44 (partial) and helix 27. One thing that I noticed is a bug in the hbond vector code. Hbond acceptor vectors are not being created for the 3' oxygens in nucleic acid residues. Also, really need to lock down the exocyclic amines in base rings so that they stay in the plane of the ring.

I wanted to look at more examples of helix packing, and this led to the problem of trying to align additional models of the 30S, which requires sequence maps and helix alignments. After adding a little discussion of sequence and structural alignments to the whitepaper, I am thinking that some scripts should be created to automate the current process, which is a manual and time-consuming one. The first step would be to create an unaligned sequence file of a pair of chain sequences. This would be done by running a script in the program that has the desired models loaded. Something like 'OutputPairChainSeqs.lua'. This would then serve as the input to a pair-wise sequence alingment program such as globals.

2004-07-05

Ribosome Builder manuscript rejected by JCC. :(

Created function 'getNucleicChainSequence()' in SeqUtil.lua. Starting on 'lua/CreateSeqMap.lua' script.

Fixed bug in povray export for invalid residue sequence number (-1 in 1giy, chain 1, residue 0).

Finished initial portion of 'CreateSeqMap.lua' script, but then, in using the 'globalS.exe' program that I had compiled on 2004-10-13, it is crashing. The third-party code seems a bit of a mess to me, and I don't want to take any time to clean it up. Added some exit() statements to bail out instead of crashing when arguments are missing. Also, I had forgotten that I had written a script, 'aln2fasta.pl', to convert the output of the globalS alignment into a fasta alignment. Fortunately, all of these 'manual' steps will be encoded into the 'CreateSeqMap.lua' script. Still, the entire operation appears rather brittle at this point because so many disparate command-line tools are used. In GNU/Linux, the error-handling and chaining could probably be handled just fine, but in DOS it will probably fail miserably in edge cases.

Well, there is already a problem using the brain-dead DOS command-line. The current implementation of globalS outputs to stdout, which I cannot redirect in the current implementation of runProcess(). Rather than trying to hack a redirect, I think I will just hack the globalS code to output to a param filename.

2004-07-06

Found output flag in globalS, so I don't have to hack it. 'CreateSeqMap.lua' script is working, added support for reference E.coli sequences as well. This allowed me to create a sequence map between E. coli 16S and 1ibk.A. Then, to create an alignment between 1gix.A and 1ibk.A, I needed to run 'GenHelixFileForChain.lua' on 1ibk.A, but because the helix files are still hardcoded in _SeqUtil.lua, it was a little problematic. Finally, after creating the helix file, I was able to run 'FindBestHelixAlign.lua' to get the best alignment. The alignment of arbitrary subunit RNA chains is improving, but still not quite there yet.

2004-07-07

Trying to keep the progress of unit tests going, in spite of many other things to do. Started on rlut rbq_GetSelectionCenter. Finished rlut. And it found a bug. Tried to translate all dynamic segments created from 1tra, and chain a$ was translated, but not chain b$. Fixed.

But now the 'run all tests' test driver is broken. Ah. Because I changed StringUtil.parseOptions(). No problem.

TODO: update graphic unit test code to check diffs, get rid of hard-coded .hlx file refs in _SeqUtil.lua.

Idea: ligand-receptor docking using the 'single contact sphere-rotate, two contact axis-rotate' strategy.

2004-07-09

Starting work on getting rid of hard-coded helix data and sequence-map data in SeqUtil.lua. Instead, the code should just do file lookups in the seq subdir.

Currently, the following SeqUtil functions reference 'f_HelixData':

Currently, the following SeqUtil functions reference 'f_SeqMapData':

Changing these refs shouldn't be too much of a problem in this particular case, but it leads me to consider adding tests to verify the continued function of scripts, in addition to the existing unit tests for the rbq-lua api. These wouldn't be called unit tests. Instead, they might be organized by category, and called 'feature tests'? Such as 'sequence feature' tests for sequence-related scripts. Should these be called 'regression tests'? Or 'scenario tests'? Or 'category tests'?

Using the rbqlua test driver structure as a template, created new feature test subdir 'app/rbq/tst/seq'. Created test 'app/rbq/tst/seq/tests/CreateSeqMap/test.lua'.

2004-07-10

Added feature test 'app/rbq/tst/seq/tests/SelectHelix'.

Added rlut rbq_GetSelectionExtent.

2004-07-11

Added rlut rbq_GetSelectedPdbs.

2004-07-12

Added rlut rbq_GetTotalSelectedChains.

2004-07-13

Finished feature test 'app/rbq/tst/seq/tests/FindBestHelixAlign'.

Wrote a description of the Helix Alignment Algorithm for Scott H..

2004-07-14

Did full test run for rbqlua tests, 88 tests run and passed.

2004-07-15

  • Added rlut rbq_TranslateSelection.
  • Added rlut rbq_RotateSelection.

    While coding the rlut rbq_RotateSelection, I noticed that there is not any current specification of the requirement for vector normalization for any of the rotation functions in the class hierarchies and libraries. Tracing it all the way back to grCommon::GetRotatedMatrixOpenGLStyle() in the wkGrMatrix lib, I see that the vector is normalized inside the function. Adding an explicit specification that the vector need not be normalized would be a lot of work. And perhaps the current absence of this is the expected behaviour. If a param is required to be normalized, it should be stated explicitly in the specification. In addition, for possible optimization, there perhaps should be another version of the function that doesn't do the normalization, or, to avoid a zillion function dups, perhaps a state, such as that in OpenGL, which enables auto-normalization (I believe in OpenGL, it doesn't check for normalization by default).

    Also, that would be a nice thing to add to all rluts which use vectors that possibly might need to be normalized: test cases which pass non-normalized versions of the parameters.

    Finally finished rlut rbq_RotateSelection. Disturbingly, the inverting atom position error in rotating a dynamic segment by 180 degrees about a vector orthogonal to the atom position vector is greater than 0.001. It does pass with an error limit of 0.01 however. Presumably, this is an accumulation of numerous small errors in the vector, matrix and center-of-mass calculation code, but it should probably be checked at some point.

    90 rluts running and passing.

    2004-07-16

    2004-07-17

    Testing export of a selected dynamic segment, it appears that it is not exporting the created hydrogens. In looking at the code, it is explicitly skipping created hydros. Why? This is because calls are made to the embedded CFastPdbObj with ptrs to atoms, which are expected to be component atoms of that object. So, for created hydros, we should just add a separate block of code to export them with default pdb info. Done. It works.

    Next is the issue of supporting only a selected portion of a dynamic segment for export. The current implementation only supports the export of the first fully-selected dynamic segment. It should be easy to add a flag specifying that dynamic atoms should be exported only if they are selected. Done. It works.

    The reason that I added this capability was to enable export of single atoms to a PDB file, with the intention of using them for testing of the forcefield. However, I'm not sure if the current implementation of force objects permits creation from partially-defined residues. If so, it should be added, because single atom-pairs would be the best way to test the forcefield functions.

    BUG: when a single node of a dynamic model is selected that doesn't rotate, or when multiple nodes are selected, they will not rotate, but no error message is displayed to the user.

    I'm also modifying export of dynamic segments to support composite (multi-model) export. At some point, the static model export should be updated to support this as well, but that will be a little more complicated because the current implementation of static model export supports exporting chain descriptions. The dynamic model export has the flexibility of composite export, but this isn't compatible with maintaining existing chain descriptions for 'all-or-nothing' static model export.

    I should add an 'export' section to the feature tests in the 'tsts' subdir.

    After these changes, did rlut tests, 94 run/pass.

    Looking at the requirement for creation of dynamic residues, in CRbqDynamicSegment::ValidateForDynamicResidue() it requires that atoms in the 'extra-bond-definitions' must be present. Why was this made a requirement for dyn res creation? Looked back in the old dev log, on 2003-11-13, the reason for this was that hydrogen atom addition would fail because some atoms were missing. If extra bonds were not added to an atom because its partner atom in an 'extra-bond-definition' record was not present, then the correct valence of the atom would not be determined, and hydrogens might be added incorrectly. So, currently, if this validation fails, the code just drops this residue completely. I'm thinking that it should be fairly straightforward to just drop hydrogen atom addition instead, for 'incomplete' residues.

    However, would it be even better to do the enabling of hydrogen addition on a 'per' atom basis, so that we could have a singly-defined hydrogen bond for testing? This is more problematic, and since there is a current capabilitie to disable individual hydrogen bonds in the forcefield, that could be done instead. Note: currently, only the DEBUG version supports this, and it isn't available in rbq_SetForceObjProperty().

    Adding code to just skip hydrogen addition instead of dyn res creation if missing atoms. However, in creating for a test residue with just two atoms, there is now a failure in creation of CRbqTorsionGraph This is due to non-bonded atoms in a residue. Trying one P atom per residue, and trying to create 2 dyn residues, now getting a failure in CRbqNodeBsjForceObject::SetPrevResBondData(), so we have to handle that as well (dynamic segments with adjacent residues that are not bonded to each other). Though, for testing, could have 2 separate dynamic segs with one atom each?

    Successfully creating 2 dyn res in separate segments, each with a single P atom.

    2004-07-18

    Working on fixing ff param read/write bug. Re-organized params in CRbqTimestepContext so vars are alphabetized, and so the getter function is used from the param set/get map instead of duped code, which became out of sync.

    2004-07-19

    In adding the rlut rbq_StepForcefield, and improving the reported node total force, I notice that some nodes in the test force object have zero total force on them after 1 timestep. This doesn't seem right, as there should be some small, non-zero force due to vanderwaals interactions with the other atoms. Oh wait, it's probably the hydrogens, which are currently skipped in vdw calculations. Yup, that's it.

    However, in devising this test, this brings up another interesting thing in that the total force on the single force object should be zero, and the deviation from this is a good indication of the numerical errors. Currently, for the test object 1tra.a$.G1, the total force after 1 timestep is reported as (-0.00000009 0.00000009 0.00000021), which is fairly close to zero (nearly within the expected precision of a 16 bit float (is it 16 bit currently?).

    2004-07-20

    Rlut development progress now at 50%!

    2004-07-21

    2004-07-23

    Finished calculating the theoretical number of intra-residue steric interactions for 1tra.a$.G1. I get 174 atom pairs after excluding hydrogens, 1-2, 1-3 and 1-4 interactions. In doing a timestep and checking the reported stats, there appears to be a bug as only 1 steric interaction is reported, only 1 torsion interaction, and the cumulative stats also appear broken.

    Tracing into CTorsionBodyIteFcon, the pair count is 172 instead of the predicted 174. That may be a distance threshold effect, retrying with larger threshold. No, that didn't do anything. That threshold value is a residue-level param anyhow.

    2004-07-31

    Loryn and I are married!

    2004-08-05

    Reading Cantor and Schimmel Biophysical Chemistry, about how the in-vivo environment of biomolecules may have complex and unknown effects on them, that become lost when the molecules are extracted for analysis and experimentation. It caused me to imagine the ribosomal complex embedded in some heterogeneous matrix of stuff that might play important parts in the process of translation in various contexts.

    Then, reading Lowe's Pipeline blog entry about biochemistry processes that are modelled with mathematical equations that have these high-exponential terms with tiny coefficients that only affect the result in unusual circumstances to reveal some buried biological effect, this led me to try to imagine a way to connect some particular environmental context of a macromolecular system to these low-weight exponential terms of an abstract mathematical equation.

    2004-08-06

    Back to rlut rbq_GetTimestepInteractionCount. After writing script exp/dev/tst/stericX.pl, to analyze the atom interaction data output by CTorsionBodyIteFcon, and generate an exclusion list from it, the descrepancies with the rlut are revealed as errors in the predicted values in the rlut. Verified 172 atom-atom interactions.

    2004-08-07

    Manually enumerating the torsions for 1tra.a.G1, I only get 46 of the 48 reported torsions from ff stats. Should I add detailed reporting to torsion calc code?

    Did the command 'ff fo report torsionTorque' and got a listing of 96 torques, as expected for 48 torsion interactions. Could just add the command 'ff fo report torsionBonds' to list the torsion bonds for the selected force objects. Done.

    Looking at the report, I found some missing torsion bonds, but there are also some extra ones! These are bonds where the endpoint atoms A and D are the same, but atoms B and C are different. For example, in the 6-ring of Guanine, there is (C5 C6 N1 C2) and (C5 C4 N3 C2). The existing torsion code must be ignoring a torsion bond if one with the same endpoints already exists, but this is incorrect behaviour, because torque should be applied about both torsion bonds for those pair of atoms. This is a good bug find from developing an rlut.

    2004-08-08

    Fixed code in CRbqNodeBsjForceObject::CreateTorsionBonds() to check all 4 atoms for existing bond instead of just atoms A and D. We now have 51 torsion bonds in both the rlut and the program for 1tra.a$.G1.

    For covalent interactions, there are 39 single covalent bonds visible. 44 are reported, so there must be 5 additional double bonds. Verified.

    We finally have a working version of rlut rbq_GetTimestepInteractionCount, although only for a single forceobject. Enumerating the theoretical counts for multi-residue tests will take a bit more work.

    Fixed ff cumulative interaction stats. Ran rluts, 100 run and pass.

    2004-08-09

    After skipping a date header in this dev log, I tried to use the 'cvs log' command to find out exactly when I did what in the last few days. Had a little trouble using the cvs log command because it reports headers for all files, including those with the desired log entries in the specified date range (which has the format 'cvs log -d "5 Aug<now"'). And, of course, redirection is useless on Windosed systems, so I have to do it on GNU/Linux. Then, I found out about cvs2cl.pl, which I am investigating. It works beautifully, generating a ChangeLog file for all changes newer than a desired date with command: [perl cvs2cl.pl -l "-d'>2004-08-04'" -f clog.txt].

    Note: steps for ssh on GNU/Linux:

    Starting doing some thinking again about the schematic sims and how to design the simulation portion and the annotation portion in the best way (model events vs. presentational events). Currently, there is an interpolated presentational event script object (spIpe), but this seems rather kludgy. I'm thinking that there needs to be a clean separation between the code that implements the model simulation and the code that implements the presentational stuff.

    We also need an easier way to crank out a lot more schematic sims. I think that a good way to go about this is to create some tools that can help to generate the needed files. Such a tool would let the user define which models are to be loaded, then to define a set of interpolated sequences, then to define camera shots and billboards, and ultimately, to do much more sophisticated presentational events during the model simulation.

    2004-08-31

    Back from Honeymoon/vacation. Thinking about working on schematic sims, one thing that needs to be added (I may have discussed this before) is internal interpolation of static models from one conformation to another. I beleive that the proper combination of an interpolation of a static model position and orientation from one state to another, in conjunction with a conformational interpolation, may be able to reproduce any desired change of state for components of a macromolecular process such as ribosomal translation.

    2004-09-01

    Started on the 'Ribosome Builder' game, exp/games/rbg, a little script to learn the structure of the ribosomal components through guided movement and docking of fragments.

    2004-09-02

    Continuing on rbg game, the script is loading differently-colored fragments. Now I need to add a 'difference' check to insure that colors of adjacent fragments are not too similar (as well as distance from selected color and background color).

    Added 'diffColor' functions, they work.

    My plan of how the game should work has been evolving. Initially, I envisioned a rather complicated requirement of the user aligning each fragment until it is nearly in the complete correct position and orientation, but now I realize that it could be a lot easier, and still educational, to require the user to choose a fragment and then just put one of its endpoints in proximity to an endpoint of the correctly-assembled portion, and then do a 'submit' action. If it is the correct fragment and endpoint, the game will then do an animated alignment of the fragment, with accompaning sound at some point, for a nice 'reward', or play an annoying buzz for failure. The scoring can be simply based upon the number of correct successive submissions.

    Next: starting on 'dock' script object.

    2004-09-03

    Redefined funcs.lua file in rbg game to RbgGame.lua, made all game functions and data as members of an RbgGame object. Created random placement of fragments, it works. Then I wanted to reset all frags to initial position, but when I tried, I got the 'multiple selection' error for 'pos sel resetTransform' command. I wonder why I prevented this for multiple selection? Looking at the code, I think that it is just because I initially implemented it with the assumption of applying to just a single pdb. I believe that I can safely remove that restriction for this command.

    Created the docker script object, which is currently docking and setting color of docked frags each timer tick. But I have encountered a problem, where the selection coloring mode is staying locked. It results from the selection that the script object is doing each timer tick, but I don't understand why. It's annoying, and potentially time-wasting, so for now, I will just do conditional dock and selection/coloring for fragments that are not in the docked position. That fixed that problem, but still worrisome.

    Interpolation works! Just a simple cut and paste from the simpanel interp code. We almost have a game!

    More evolution of how the game should work. Found that a black background works much better, and also setting the orig model as a transparent surface to show the envelope. Also, it seems too hard to expect correct sequential assembly, especially for newbies such as myself. So instead, I am allowing all submitted fragments for docking, in any order, and will just calculate the score based on proximity to destination. Finally, as far as creating helix annotations as clues, I think for now we can just draw annotations for helices that are fully contained within fragments. This will lower the current performance hit for lots of annotations, and also solve the problem of having to add 5' or 3' side designators to the annotations.

    2004-09-04

    Finished initial version of the game.

    In developing the Rbg game, I started making extensive use of a module-level object (RbgGame) to hold data instead of in script objects. It caused me to realize that this could be a better alternative to the cumbersome script object variables for all script objects. Each script object could be created as a table object, held in an array in a module-level lua variable. Data access could be much easier and powerful. Possible downsides include somewhat less visibility and access from the user level compared to script object vars, although presumably inspection routines could compensate. Also, there might be some problems in freeing unused data after script objects are deleted.

    Added new game function to rbg game. Now it is fully functional. Also, realized that I didn't add random rotation to frags, just random translation. This actually makes it easier. Need to hook random rotation to higher difficulty levels. Also need to add helix labels soon, as this will help the user to learn the structure. Also, add mrd color (most recent docked frag color, as distinct from remainder docked color).

    2004-09-05

    Been thinking about how to make a more flexible and general purpose framework for schematic sims as well as animated narrations of journal articles. One idea is to define a sequence of items in a lua table, where each item is a step in the narration or schematic sim. Each item defines an init() event, a tick event, an interpolation rate, and optionally, draw and drawTransparent events. The events of an item will be called until they complete, and then the driver will process the next item in the list. This should provide for a general-purpose animation where models can be loaded, interpolated, drawn, camera positioned, text displayed, all in an interpolatable manner.

    Added semi-transparent backgrounds to text messages in rbg game. Added some helper functions to do some of the calculations, but the process is still kludgy, requiring separate 'matching' functions called from the 'drawTransparent' event for each text function called from the 'draw' event.

    Added helix labels to fragments in rbg game.

    2004-09-06

    Added interp rate adjustment script, more help info and random rotation of frags to rbg game. Getting ready to release next version of rbuilder. Got rid of kludgy CalibrateInterpRate.lua script, the manual adjustment one works much better.

    Released version 0.3.3.

    Looking at the directory structure, I'm thinking changes need to be made. First and foremost, the distribution and install mechanism should result in the creation of a subdirectory with the program and version name, e.g 'rbuilder-0.3.3'. Second, we should ditch the 'bas' directory on the development machines. The base directory is implicitly the 'rbuilder-XXX' subdirectory. Second, the 'app' and 'lib' subdirs, which are src directories, should be explicitly moved into a new 'src' subdirectory. Finally, the 'exp' directory should be maintained explicitly as a subdirectory of the base directory.

    2004-09-07

    Wrote scripts 'exp/articles/rboExportData.pl', 'web/wp/ref/makeHtml.pl' and 'web/wp/ref/xp2ref.pl' to export journal article references to text files and html docs. Started in earnest on writing the dissertation.

    2004-09-08

    Have obtained 3 excellent books as guides and inspiration for writing the dissertation:

    2004-09-09

    Still working out the general outline of the paper. It is necessary for me to organize and create a more comprehensive summary of the existing literature for RNA, ribosomes and molecular modelling.

    Adding keywords to my existing database of references.

    2004-09-10

    While accumulating more literature on ribosome termination, it has been motivating me to try to quickly create some more schematic simulations. Also, came across a fantastic picture (Fig 2) while reading (Brodersen 2003): it is a composite of 2D cross-sections of 3D structures that gives a very nice 2D schematic view of a particular state. It had never occurred to me before to do this. I had realized the need of some kind of 2D illustrations or cartoons to accompany 3D schematic sims, serving as reference annotations in 2D media such as a web page. But I had assumed that to produce such a 2D cartoon would require manual illustration work. This cross-section approach should prove to be a much more convenient way of producing such 2D schematic pictures, once the right tool for producing a 2D cross-section is obtained.

    Added 'command reference' html files to project web page, as User Manual and other pages referenced those, and were showing a broken link. However, need to come up with a more comprehensive way of updating these kinds of files on the project web page so that they are in sync with the latest build, as the current manual method is not good at keeping everything up to date.

    Videogame boxing is a great caffeine burner-offer.

    2004-09-14

    Created 'keywords.pl' script in web/wp/ref to generate list of references organized by keywords.

    2004-09-15

    More refs and html docs.

    2004-09-20

    After reading a couple of papers on RNA-protein structure (Jones, 2001), (Draper, 1999), I am looking at the structures in rbuilder with some new eyes. Taking a fragment from the ribosome builder game, containing helix 44, and rendering its surface at 2 A, I obtain a nice visual appreciation of the narrow, deep major groove and the shallow minor groove, and note how irregularities in the A-form helix result in widenings, twistings and other irregular alterations of the groove structure, providing the opportunity for sequence-specific recognition by RNA-binding proteins.

    2004-09-21

    Created AnnUtil.runSim() and supporting sim driver code, created initial schematic sim in exp/articles/Ban-2000, it appears to be working.

    Added AnnUtil.setBillboard() and supporting billboard code.

    2004-09-22

    To continue with the new implementation of schematic simulations, as supported by AnnUtil.runSim(), it is clear that some form of object-oriented programming is needed, to avoid massive amounts of duplicated code. This is because there are lots of common operations needed for all schematic sim objects, such as the initial Ban2000 object, which does an animated annotation of the (Ban, 2000) journal article. An example of a common operation is sim.incInterp(), where the fInterp variable is incremented by the current interpolation rate. This is typically done in each tick() function call. The code to do this is fairly simple: function incInterp( self ) self.fInterp = self.fInterp + self.getInterpRate(); end. However, defining this function in every schematic sim script file, along with other related functions, is a bad duplicate coding practice.

    So the time has come for me to use some of the object-oriented capabilities of Lua. I am comfortable enough with the language not to be bothered by this additional complexity. Read the old version of the Lua book (around when Lua ver. 4.0 was used). This version mentions two ways of creating objects: cloning a table and using settagmethod(). The table cloning method is simple, but uses more memory. The settagmethod() is fairly simply to use for the specific situation of adding delegation for table element indexing, but I believe that because it is a global effect, it could have a significant slowdown of the existing code because after setting a delegate function, every table index operation for all the current Lua code will go through this function. So I think I will stick with the clone method for schematic sim objects for now. Read a little bit of the newer version of the 'Programming in Lua' book, which is for post 4.0 versions, and it talks about doing things a little differently, using metatables, which I suspect allows for more specific, localized overriding of table index lookups, but I am not about to upgrade to a newer version of Lua at this time.

    Ack. For the first time, I am running into lua file load conflicts, where ScriptUtil.lua needs to load AnnUtil.lua and vice versa. Why is this only happening now? Is it because I am doing a dofile() at top of _AnnUtil.lua to separately load AnnUtil.Sim.lua?

    Ok, hardcoded the path for the dofile(), which is really ugly. Now having problems with function declaration 'AnnUtil.Sim.new()'. Can we not nest package names? Changed to 'AnnUtil_Sim.new()', did 'AnnUtil.Sim = AnnUtil_Sim;' at top of file. Is this the way to do it or is that a hack? Anyhow, now it compiles.

    AnnUtil Billboards are working.

    2004-09-23

    Adding lua function 'rotateViewAroundCenter()' to ViewUtil.lua. There is a bug when using the console view commands 'view setCenter' and 'view lookDir'. After setting the view center to (200, 0, 0), then setting view look dir to (-1, 0, 0) changes the view center to (0, 0, -200). I am surprised that there are still bugs in the view code, what a PITA.

    Since the console commands are used to implement the lua lib commands, then the bug should show up there as well. Why didn't the unit tests catch this? Answer: the currently defined unit tests only cover the rbq_lua interface functions, not lua_lib functions. Verified that setting the view up dir to (-1, 0, 0) will also change the view center.

    Traced the code to CSimpleView::SetLookDir(), which does the actual setting of a new direction of the view. Rather than mess with this function, for now, we could just do a hack in CRbqCmdProcessor::Cmd_View() to adjust the view center to maintain it after changing view look dir / up dir. This should be a good solution because it is similar to what setView() in ViewUtil.lua does, where first the look dir is set, then the up dir is set, then the view center is set.

    Did fix, it appears to work. Also, all non-bitmap rbq_lua unit tests are still passing.

    Added 3 steps to Ban-2000 Journal Article Annotation, I think the new scheme will work. It will require periodic enhancement and creation of support routines as the annotation tasks are encountered, but as a result, the work of creating Journal Article Annotations should become faster and easier over time.

    Added a parameter to the AnnUtil.Sim.incInterp() function so that each step in the sim can adjust the amount of time that is needed, relative to other steps. This is still a little ad hoc, use of an explicit real-time value like '2 seconds' would be better, but in general, most steps will involve a constant static delay of a few seconds so that the observer can read the billboard text and the associated graphical highlight events.

    After adding a few more steps, we will be needing RTT functionality soon.

    Adding a Camera to AnnUtil. Done. It's incredibly simple (2 functions), took only a few minutes to do, and it works beautifully. Such a contrast to the struggle in coding camera movements in the first schematic sim.

    2004-09-24

    Implementing RTT for AnnUtil.Sim. This involves adding a new command menu, 'ann sim', and also, for the first time, a need for C++ code to access data from Lua objects (the Ann.Sim object). I hope this will not be trouble to do.

    After a bit of thought, I realize that it should be simpler than that, all we need to do is a simple lua_dostring() or lua_call() from CRbqCmdProcessor::Cmd_Ann_Sim() and call a function in AnnUtil.Sim.

    Adding code to load a sim at a param step.

    'Goto Sim Step' is working!

    2004-09-25

    Ironing out bugs in GSS. Previous code used 'sim:getInterp()==0' for intialization ops in tick() functions, but that is skipped in 'goto step N' code, so it needs to be replaced by something like 'sim:isFirstTick()'. Also will rename 'sim:infoDelay()' to 'sim:isFirstInfoDelayTick()'. Over time, a number of subtle adjustments should be added to the step definition in order to better convey the flow and highlighting of information, such as small pauses between information highlighted in the previous step and new information highlighted in the current step. Example: 'sim:isFirstDelayTick()'.

    Proper naming is hard. Trying 'sim:isFirstMatureInfoTick()' instead of 'sim:isFirstInfoDelayTick()'.

    Adding display of interp state in graphics window, should have been simple, but there appears to be a bug in the Billboard display, the text and background quad are out of sync. Arg.

    Ok, found the error, just wasn't noticeable until a bb with enough rows were being displayed, so that the row position error could accumulate enough to be noticeable.

    Working on exp/dev/tst/testBillboard.lua to try to debug the problem, one part of the problem is that the command 'edit delAnnotations' is not truly re-initializing the AnnUtil.Billboard table of boards.

    Added a fix for that where if the Billboard has to create the associated script object, it will also re-init the Board table.

    Did one change of changing the hardcoded char height in CRbqLua.cpp : rbq_GetBitmapTextMetric() from 8x15 to 8x13. That helps.

    After creating a working test of the Billboard to display all chars, it looks like the background quad just needs to be dropped down 3 pixels relative to the text. Not sure why, but we'll just hardcode that in AnnUtil.lua textAreaToPixels(). Ok, that fixed it.

    One annoying effect: display of the interp info every tick messes up the playback rate. With a graphics update every tick, the sim doesn't need the 0.01 slowdown that was done there before, so I might just have the sim.tickStep() function do a redraw every tick. But this is still pretty ad hoc, what is really needed is some code to pace things to a fairly constant frame rate.

    2004-09-26

    Addding more miscellaneous controls to AnnUtil.Sim, such as 'stop at end of step'. Also creating html control page for Ban-2000 sim.

    More tweaks to to sim controls. One small problem: the camera interp appears to have a slight inaccuracy, the destination point is slightly different from the specified one. This is actually a problem in the Ban-2000 runSim.lua script, and the Sim class, which terminate the step before calling the full fInterp = 1 value.

    The obvious fix is to move the incInterp() to the beginning of every tick() function. Since we are no longer detecting first tick with sim.fInterp value (using sim.isFirstTick() instead, which uses sim.iTotalStepTicks), this shouldn't cause any problems.

    Did it, sim works fine and camera interp is now ending at expected position.

    2004-09-27

    More work and refinements in schSim. The most recent problem found was in jumping to a late step in the current Ban-2000 sim, the full interp of previous steps didn't work for one of the steps, because instead of using the explicit fInterp value, it used the sim:getInterpRate() instead, which remained at the default small value of 0.01, so only an incremental amount of rotation was done. This was a step that did a 'rotateViewAroundCenter()' call.

    The solution is probably to add another function to the AnnUtil.Camera class and have it do the actual positioning, because it will calculate each position independently, using an interp value. So we must remember to avoid the use of any 'relative movement' schemes that do not make explicit use of the interp value.

    Renamed AnnUtil.Camera.setInterp() to AnnUtil.Camera.setLinearInterp(), added AnnUtil.Camera.setArcInterp().

    camera arc interpolation works!

    Now, we are needing multiple pauses for the events of a step. For example, in the current step 18 of Ban2000 sim, the first thing that happens is to throw up the new billboard describing a new domain, domain II of the 23S rRNA. Then, after a brief pause, the region is selected and appears to the viewer highlighted in yellow. Then, after another pause, the view begins moving, in an interpolated manner, to best show the user the domain. So there are, at minimum, two pauses required during this step, and possibly more will be needed in the future. So, there needs to be a better mechanism than the current 'sim:isFirstMatureInfoTick()'. One possibility is the more general 'isFirstTickOfPause( N )' where N is the Nth time segment defined for the step. Or, instead of pause, would a better name be 'isFirstTickOfSegment( N )'. In addition to the 'first tick' status, there also needs to be something like 'afterTimeSegment( N )', in order to properly call an interp function, only during that segment. A better name than segment is 'interval'. A set of functions should be defined, to do relational calculations of time intervals within a step, although we must be careful that all cumulative operations are performed, no matter how many ticks (and associated temporal locations in intervals) occur, as every step must work properly with just a single tick() call for interp value 1.

    No, interval is no good, because it implies something bounded on both sides. Instead, we need something like 'isFirstTickAtOrAfterInterp()' and 'isAtOrAfterInterp()'. Of course, 'AtOrAfter' is much too verbose, as is 'GreaterThanOrEqualTo'. We could just use 'isFirstTickAfterInterp( N )', but this is dangerously imprecise, implying it should not be true for the value at N.

    Other possibilities: get rid of 'FirstTickAtOrAfter' and use 'isFirstInterp( N )' for the single-shot. For the 'greater-than-or-equal-to', use 'isAttainInterp( N )' or 'isArriveInterp( N )', but neither of these is quite right. 'isPostInterp()' is better, but there still is some implication that it may not apply at the value N. 'isAtLeastInterp( N )' is pretty clear.

    Then there is the problem of how to define the paramter. Is using an explicity numerical value verboten? Probably not, because the relative ordering would be more clear within the step tick() function definition. But then adjusting the value subsequently would be an ultra-hassle. So named constants must be used. Does 'isFirstInterp( sim.fInfoDelay )' work? Seems to, in conjunction with 'isFirstInterp( sim.fHighlightDelay )', but only if we assume that these two delays are always used in the same way, which they are not. Instead, how about numeric labels, 'isFirstInterp( sim.fDelay1 )', 'isFirstInterp( sim.fDelay2 )'? Still not perfect, but better than named delays and numeric values. These values could initially be assumed to be 0.1 increments, and could also be redefined subsequently if needed.

    Ok, I think I'm going to go with 'isGainInterp( N )' for the greater-than-or-equal-to functionl. It's short and the meaning is fairly clear for a temporal context. 'Reach' is clearer, but not as mellifluous. 'isReachInterp( N )'. Hmm, maybe clarity should supercede mellifluousness. Yeah, gonna go with that.

    Arg, 'isFirstInterp()' will be confused with 'isFirstTick()'! Now it must be 'isFirstReachInterp()'.

    To do the actual 'first-time' check for a 'isFirstReachInterp( N )' call, will need to create a log of the fInterp value for each tick() call in the step. Then we would have to count of the number of log entries which have an interp value greater than or equal to the param interp value. This doesn't sound very efficient. That's assuming that the call can't have a side effect. If we allowed the call to have the side effect of setting a hash value, then determination would be easy, but then the call would only be valid once per step. This restriction seems reasonable, but might become a cause of bugs at some point. Ah, just record 'sim.fPrevTickInterp' value. Simple.

    Added function Sim:isReachInterp() and Sim:isFirstReachInterp(), changed delay refs in Ban2000 and it works. Also added some pre-defined delays. However, one thing that is apparent is that only a single interp'd event can be done in any given step. Having two different interp events in a step, such as a linear view interp and an arc interp, separated by 'isReachInterp()' logic, would not work properly for a single full-value interp. So the delays will be used to separate multiple 'single-shot' events in a step, but not multiple 'interp' events.

    Added AnnUtil.Camera:lookAtInterp().

    Ok, the other problem with delayed interps is the 'jerk' that occurs when a camera interp starts at 0.2 and then goes to 1.0.

    2004-09-28

    Added sim step control functions to html page for Ban-2000.

    Added vUpDir option to AnnUtil.Camera.linearInterp().

    Adding AnnUtil.LineLabels class. This should be very straightforward, basically just copy and slightly modify the AnnUtil.Billboard class to produce an annotation service for producing lines attached to text labels in the 3D graphics window.

    2004-09-29

    LineLabels are working.

    Working on adding line lables to the 3 protrusions of domain II of 23S rRNA for model chain 1ffk.0. Found a bug in one of the sequence map scripts: SeqMap_23S_Ecoli_Hmari.lua reports that there is no mapped base for E.coli base 'C835', but there is one, plain as day, should be 'G928'. I note in passing that there is no unit test for any seq map scripts on bas/app/rbq/tst/seq.

    This must be a bug in SeqUtil.lua translateMappedBases(). Found the bug, it is due to an implicit string to number conversion for one of the variables. Will fix by doing explict number conversion for the sequence position vars.

    Fixed seq bug. Ran seq test, all passed (but need to define more).

    Almost done defining protrusion helix callout of domain II step, but ran into a weird bug where using a fractional arg to incInterp() caused the camera arc interp to wack out towards the end. Why?

    Looking at arc interp code, I'm really hoping that it's because I am getting the current view up dir instead of the initial one. Substituting initial up dir.

    Yeah! That fixed it.

    2004-10-01

    Gave demo of program at poster session of Bio-Nano Technology conference yesterday at U of M. Not many people saw it.

    2004-10-05

    After a brief distraction of the last couple of days working on a new version of my 'origin-of-life' hypothesis (The QCH project: Quaternary Complex Hypothesis), I must get back to work on the thesis and Ribosome Builder.

    Created a new jaa: exp/articles/Carter-2000. This involves loading a new model, and at some point may require alignment with the reference models in std orientation, requiring the usual sequence of operations to create aligned sequence maps and helix files. It would be nice to have an automated process to do this.

    The script 'CreateSeqMap.lua', created 2004-07, does the work of creating the sequence map. I need to add documentation of that to the User Manual. And then, only one other script, GenHelixFileForChain.lua, needs be run. One minor bug needs to be fixed: the current implementation for selecting helices is looking at hard-coded map files listed in SeqUtil. This should be changed to just look for an existing file in the seq subdir. Added helix file auto-naming to SeqUtil.lua function findHelixFileForChain().

    Added some brief explanation of smap creation to User Manual. Testing creation of smap file for 1pns, I note that there is an ASSERT in CFastPdbObj in loading the model. This ASSERT results from an assumption in CFastPdbObj::CreateInterResCovalentBonds() that residue numbering corresponds to the residue order in the pdb file.

    2004-10-07

    I think the thing that has been hanging me up in writing my thesis is the current lack of the document in some kind of 'finalized' form. The method of defining a set of cross-referenced html files is powerful and flexible, but it lacks a nice, final form that can be read in a way that conveys the linear flow and presentation of the material.

    I want to keep the existing organization form, but I think that I can also achieve working version of the 'final' form by writing a script to process the current html files, in a sequential order as defined by 'next' links at the top of each document, and concatenate the contents into a single composite html file. This can then be read either in a web browser, or in the more traditional word processor application.

    Created script 'makeThesis.pl'. First version was simple to do. It works.

    Finally took the trouble to figure out how to do manual formatting of line lengths in vim: use 'gq', after setting 'textwidth' to desired line length. That ought to save me about 10 million keystrokes.

    2004-10-13

    Making progress on the 'Methods' section of the dissertation. Finished sections for the low-level libs: Working on the wkGrChem lib. Having to go through source files and looking at the msurf project to remember how I implemented the marching cubes algorithm for CPdbSurfFactory. I wish I had been in the habit of writing a project log when I created the msurf project. There is only a very terse 'history.txt' file. Fortunately, the process is revealed both in the source code and the collection of tools. There is the case viewer lua script, which I was able to run after very minor updates to be compatible with the current lua library. Also a collection of perl scripts for solving the hole-filling problem.

    2004-10-14

    Starting to figure out what the heck I was doing to solve the hole-fill problem. I had created some nomenclature to organize the hole problem. The 6 cube faces are referred to as Nx, Px, Ny, Py, Nz, Pz. At each cube face, the conditions for a hole are 'inside' condition at two diagonal vertices and 'outside' condition at the other two vertices. When viewing the face from a certain orientation, the edges of the triangles needed to cover the 'inside' vertices would have either a 'Fwd' or 'Bak' slope, where 'Fwd' is a positive slope and 'Bak' is a negative slope.

    Actually, further examination leads me to think that the 'Fwd' and 'Bak' refer to the line connecting the filled vertices, not the triangle edges.

    The hole is at the facial boundary between two cubes. The hole has a direction in that one cube is on the outside of the hole, and the other cube defines the 'inside' boundaries of the hole. The cube on the 'outside' is the 'Begin' part of the hole and the cube on the 'inside' is the 'End' part of the hole.

    Created image 'HoleFill-130-203.bmp', which shows cases 130 and 203 adjacent to each other. Case 130 is an example of a PxFwd_HoleBegin and Case 203 is an example of a PxFwd_HoleEnd. It's starting to make sense.

    After updating the \proj\graphics\chem\msurf\cv.lua case viewer script to examine the hole fill work, getting an ASSERT in wkGraphic lib for CWkGraphicObject.h : 101. This is in the SetName() function. Must not have been overridden in the class that implemented drawing the bitmap text for command 'ann insBmText'. This is a CWkBitmapText object. That's correct, no override for that function in that class, but doesn't really matter at this point.

    2004-10-15

    Added code to 'makeThesis.pl' script to embed figures. Later, will add more code to put the figures at the end, along with generating list of figures in table of contents.

    Code to add figures works well, after I realized that doing percent scaling in html img tags wasn't going to work. It's better to have the pictures in their final intended size.

    Finally finished marching cube stuff in dissertation.

    2004-10-16

    Been reading up on VRML and X3D prior to discussing work done on that in dissertation. Found a great article by Tony Parisi, one of the co-creators of VRML and a co-chair of the X3D specification. He talks about the reasons for the failure of Web 3D during the last 10 years, and why he feels that X3D is finally poised to take off in that area.

    Downloaded the latest version of FreeWrl on my linux box (version 1.08 pre 3) and tried to compile it, without success. Didn't want to put much time into it, but it looks like the same problem that I had trying to build previous versions - a bunch of dependencies for other software components that I have already spent too much time trying to co-install and build. It may also be due partially to my 'older' version of linux on that machine (Mandrake 8.1), but that shouldn't really be a problem. Looks like FreeWrl still needs some work in the user support department. That is one area why Ribosome Builder can be considered a success, at least for the platform that is supported. There is a pre-built binary that downloads and runs, with pretty much everything included (although the downloaded file is a little big, as a consequence).

    Downloaded the latest version of the Cortona VRML client (version 4.2) and tried to install it for the Firefox 1.0PRE browser on my WinME machine. Didn't work at first, and then, for some strange reason, after I went to a web site with a VRML plugin detector (http://cic.nist.gov/vrml/vbdetect.html), it seemed to 'activate' the plugin, and I could then successfully load and run .wrl files in Firefox, which is cool. It used the OpenGL rendered (DirectX didn't work) and the performance was not bad, although nothing to write home about.

    Did all this research on VRML only to realize that the vrml stuff in the rb project has not been used for a long time, only POVRAY export is currently done. What a dunderhead.

    2004-10-17

    Finally finished up wkGrChem discussion. Managed to talk a little about VRML so it wasn't a total waste.

    Starting on discussion of implementation of main application (and internal libs).

    2004-10-22

    Took a break for one day to create the 'tree viewer' app for Russell Parsons. This was valuable, because it resulting in an independent implementation of the Rbuilder CSimpleView mechanisms, but using the glut library and OpenGL for the matrix operations. It gave me an even better understanding of the relation between view transformations and user inputs from the mouse, which has caused me some problems in the past.

    Creating a picture for a camera frame, found a bug in rbq_DrawBlockArrow(): the polys for an arrow pointing in -x dir have incorrect normals. Looking at the code, it looks like it fails for arrows pointing in the -x direction because in wkGLutils.cpp, glxRotateCurrentMatrix() is trying to do a cross-product on vectors 180 degrees apart, which will produce a zero vector. Rather than fixing glxRotateCurrentMatrix() at this time, hacked a fix in CRbqArrow to do a manual rotation. It works. But this fix should be applied to glxRotateCurrentMatrix(), because this function is also currently used in CGrAtmUtil and CRbqForceDisplay.

    2004-10-26

    After making some good progress, got a little bogged down today in trying to remember and understand the design decision of combining the static and dynamic models within a single CRbqPdbMol object. Read quite a bit through the old project log.

    I think it just kind of 'evolved' that way, starting with the incorporation of torsion graphs into the CRbqPdbMol object, and doing some static model steric analysis with them, and then the force object and dynamic segment stuff being tacked on later. But it seems that it might have been better to design dynamic models as a completely separate collection within the document from the static pdb models, although there would have been numerous redesign issues resulting from that.

    2004-11-02

    Finally starting on the elongation schematic sim, I am faced with how to actually implement the combined conformational and positional interpolation of the mRNA as it translocates by one codon. In order for the adjacently-bonded residues to maintain a roughly-allowable stereochemistry, we must do the torsion interpolation first, for all residues simulataneously, then calculate the translational and rotational interpolation necessary to re-align the new conformation with the target model.

    Right off the bat, in trying to develop this new interpolation, I am running into a bug in saving and restoring an rbd document. Saved exp/demo/mrnaWrap/model.rbd to a new directory, then on reloading, got an assert in CRbqPdbMol.cpp:3285 and garbage in the location of parts of the dynamic model. Don't have time for this!

    Fortunately, this bug appears to be not repro. A subsequent save and load worked correctly.

    2004-11-03

    Actually, the bug is repro, if the file is saved after running the movie. This bad news is in good company today.

    In comparing the rbd files for before and after running the movie, the difference is that the after version is only saving 206 out of the 863 dynamic node transforms. Well, looking at the script that loads the demo, it is turning 'single-atom-nodes' off, because it says that the model was created that way. However, selecting and displaying indices for the loaded model indicates that the model has single-atom-nodes. At this point, don't know how much I will worry about it. Need to move on and this appears to be a bug related to that particular flag, which should not be an issue for newer models.

    Exported wrapped model to exp/dev/mrna/interp/wrapped.pdb. Now there appears to be a bug in selecting the backbone of dynamic models. But this bug is not repro.

    Created lua object DihedralUtil.Interp, to do torsion angle interpolation of dynamic residues.

    2004-11-04

    Created schematic sim html framework for exp/dev/mrna/interp/ project. DihedralUtil.Interp appears to be working when applied to a single residue in the wrapped mrna model. The ssim framework is a useful tool for development of new capabilities such as mrna interpolation. It seems that there is not an existing ForceObject script function to reset force objects to their initial transform. Curious that that hasn't come up. Created simple wrapper function 'resetSelectedForceObjectTransforms()' in ForceObjectUtil.lua.

    For development, looks like we need to 'single tick' to AnnUtil.Sim in addition to single step. Done, and it helps.

    Running into problems, it seems like dihedral angles are being returned instead of torsion angles!!???. Duh, yes, that was the problem (bug in newly-added getFoTorsionAngles() function).

    DihedralUtil.Interp interpolation of all torsion angles of G23 is working. The cumulative effect of all torsion angle changes on the downstream residues is quite dramatic. Of course, this makes me realize that I am interpolating in the wrong direction. G23 needs to be interpolated to U20, not U26.

    Interpolating to angles of U20, there appears to be a direction bug, originating from DihedralUtil.getAngleDiff(), which I just copied from torsionInterp.tick.lua. I don't know how well that script was tested. Another good candiate for unit test development. Currently, the only 'special category' testing that is done is tst/seq. 'tst/dihedral' or 'tst/torsion' would be an excellent choice for the next category. I think that the problem is that getAngleDiff() expects angles in the dihedral range [0, 360] instead of the torsion range [-180, 180]. But, would that really make any difference? Ach, dumbkopff! I was switching the params in the function call. I don't think it does make any difference. Ok, it's working now.

    Now we have to figure out the position transform. Thinking about how to do a '3 atom alignment', I realize that we can do a dynamic residue alignment that is similar to the existing static residue alignment script (AlignSelectedResidues.lua), except that instead of aligning using two subsequent backbone vectors, we use two vectors from the first 3 backbone atoms of the dynamic residue.

    Created script 'AlignSelectedForceObjects.lua'. It works.

    Now the next challenge is to extract the rotation that occurs during this alignment, and convert it to a quaternion, which should allow for a positional interpolation. Reviewed code in exp/dev/simpanel/interp.tick.lua to see how the positional interpolation is done. It works by receiving starting and ending homogeneous transform matrices, along with associated center points, then translating them to the origin, then retrieving the quaterinions for them, then producing a slerped quaternion matrix, then translating that slerped quaterinion matrix to the linear interpolated position between the two param matrix centers.

    The problem with simply applying this approach to the mRNA force objects is that the force object consists of multiple transforms, one for every atom. We need some kind of generic quaterion rotation that can be applied globally to the entire force object.

    I suppose that we could obtain the slerped quaternion matrix and lerped translation matrix from a reference node in the force object, and then apply these two transforms to all node frames in the force object.

    2004-11-05

    Running into a problem that I'm surprised has never come up before. In CRbqScriptObject::SetValue(), there is an assignment from a param string to a string in a member data string list. In the actual assignment, references are used on both sides of the statement. I always believed that when assigning to a reference, the actual result is that the value of the thing pointed to by the reference is changed. But in this case, the item in the string list appears to be changed to point to the param reference, which is certainly not desired. Very strange.

    No, something else appears to be going on. It looks like something else is modifying the actual contents of the string somewhere. Ok, this is interesting. What is happening is that there was a script object initialization script, exp/dev/tst/testQuat.lua, which defined some vars, using the 'local' qualifier, but at the main level, so that I believe these vars were actually put into the lua global namespace. This script creates a script object with a tick function script, which is run every timer tick. In this tick function script, it calls 'setScriptObjectVar()' at the end of the tick function, to update a script object variable called 'fInterp'. This stores the value in the member data list of the script object, held by CRbqScriptObject. But then, after running the tick script, from CRbqScriptObject::RunScriptFile(), the function CRbqScriptObject::GetScriptGlobalData() is called, to implicitly update modified script object data. And this is where the fInterp variable is set back to the initial value. In looking at all this, it makes me wonder why we have both the implicit update of script object variables done by CRbqScriptObject::GetScriptGlobalData() AS WELL AS the explict 'setScriptObjectVar()'???

    Also, there must be some global 'fInterp' value in the lua global namespace, though I'm not sure where at this point. It seems like the explicit setScriptObjectVar() statements are superfluous in the current scripts. Except in the precise case where we have the 'global' override problem seen here. So what could be done is to remove the 'GetScriptGlobalData()' call in the code. Hopefully, this will not cause any scripts to break. I believe that I have been doing the explicit update of all vars with 'setScriptObjectVar()' for some time now. But not 100% sure it is done for older scripts.

    Ok, commented-out the post-script-run GetScriptGlobalData() call, I don't think this is going to break anything significant, but I will run the demos and unit tests as a check.

    Quaternion-based interpolated rotation of force object G23 to align with U20 is working. Now, just need to incorporate the translation interpolation, and a scheme for doing full interpolation of mrna translocation is starting to take shape.

    Things are becoming clear. What we need is a single function, probably in the GeomUtil module, something like getInterpTransform(), which receives a center point, a translation vector, a rotation, and an interpolation scalar. The function will return a homogeneous transform matrix that will represent an interpolated orientation and position of the center point. This single composite transform can then be applied to a set of force objects. It works!

    2004-11-06

    Removed ASSERTs from CRbqPdbMol::GetOrdinalDynSegName(). This is because an invalid name can be passed in from the user, so this should be caught be validation. It is not an internal error and should not ASSERT.

    Trying to get position and torsion interpolation of mrna working together in eln001. Currently, when they are both done in a single step, the moving residue reaches correct torsion alignment and correct translational alignment, but the final rotation is not quite right. When the positional interpolation is done in a subsequent step, with full torsion alignment pre-set, the rotational alignment is correct. What's going on?? Ah, I see that I was applying the torsion interpolation after the positional interpolation. Moving it to before.

    That was it! We know have a working combined torsion and positional interpolation for a single residue of the mRNA.

    S