From skleinberg at common-lisp.net Wed Aug 16 20:21:56 2006 From: skleinberg at common-lisp.net (skleinberg at common-lisp.net) Date: Wed, 16 Aug 2006 16:21:56 -0400 (EDT) Subject: [Clarity-cvs] r1 - doc doc/html doc/html/dictionary doc/html/images gui gui/icons sql utilities utilities/delivery Message-ID: <20060816202156.28C7730010@common-lisp.net> Author: skleinberg Date: Wed Aug 16 16:18:39 2006 New Revision: 1 Added: COPYING.txt LGPL.TXT README.txt alignment-functions.lisp.lisp clarity-package.lisp clarity.exe (contents, props changed) clarity.system database-functions.lisp decimal-number.lisp doc/ doc/html/ doc/html/clarity-package.html doc/html/clarity-schema.png (contents, props changed) doc/html/dictionary/ doc/html/dictionary.html doc/html/dictionary/align-charts.html doc/html/dictionary/align-to-consensus.html doc/html/dictionary/alignment-item.html doc/html/dictionary/alignment.html doc/html/dictionary/build-consensus.html doc/html/dictionary/connect.html doc/html/dictionary/ganttify.html doc/html/dictionary/get-all-data.html doc/html/dictionary/get-children.html doc/html/dictionary/get-consensus-terms.html doc/html/dictionary/get-data-terms.html doc/html/dictionary/get-node-terms.html doc/html/dictionary/get-root.html doc/html/dictionary/insert-node.html doc/html/dictionary/insert.html doc/html/dictionary/lastid.html doc/html/dictionary/needleman-wunsch.html doc/html/dictionary/score-pair-consensus.html doc/html/dictionary/score-pair.html doc/html/dictionary/score.html doc/html/dictionary/store-consensus-sequence.html doc/html/dictionary/store-gantt-chart.html doc/html/dictionary/store-gantt-charts.html doc/html/dictionary/store-numerical-data.html doc/html/dictionary/string-alignment.html doc/html/dictionary/tree-insert-recursive.html doc/html/dictionary/tree-insert.html doc/html/downloads.html doc/html/gui.html doc/html/images/ doc/html/images/Thumbs.db (contents, props changed) doc/html/images/interface2.jpg (contents, props changed) doc/html/images/phylogeny-1-smaller.jpg (contents, props changed) doc/html/images/phylogeny-1.jpg (contents, props changed) doc/html/images/phylogeny-2-smaller.jpg (contents, props changed) doc/html/images/phylogeny-2.jpg (contents, props changed) doc/html/images/phylogeny-3.jpg (contents, props changed) doc/html/images/shim.gif (contents, props changed) doc/html/index.html doc/html/installation.html doc/html/links.html doc/html/style.css gui/ gui/clarity-database-setup-interface.lisp gui/clarity-gui.system gui/clarity-interface-functions.lisp gui/clarity-interface.lisp gui/icons/ gui/icons/base.bmp (contents, props changed) gui/icons/down.bmp (contents, props changed) gui/icons/icons.bmp (contents, props changed) gui/icons/inactive.bmp (contents, props changed) gui/icons/neutral.bmp (contents, props changed) gui/icons/up.bmp (contents, props changed) gui/insert-data-interface.lisp gui/start-gui.lisp sql/ sql/clarity.sql utilities/ utilities/delivery/ utilities/delivery/clarity-4.ico (contents, props changed) utilities/delivery/clarity-icon-3.bmp (contents, props changed) utilities/delivery/clarity-icon-3.ico (contents, props changed) utilities/delivery/clarity-icon-4.bmp (contents, props changed) utilities/delivery/clarity-icon-4.ico (contents, props changed) utilities/delivery/clarity.ico (contents, props changed) utilities/delivery/delivery-script.fsl (contents, props changed) utilities/delivery/delivery-script.lisp utilities/delivery/lwdeli.bat Log: Initial import Added: COPYING.txt ============================================================================== --- (empty file) +++ COPYING.txt Wed Aug 16 16:18:39 2006 @@ -0,0 +1,18 @@ +CLARITY: Common Lisp Data Alignment Repository +Copyright (c) 2006 Samantha Kleinberg +All rights reserved. + +This library is free software; you can redistribute it and/or modify it under the terms of the GNU +Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the +License, or (at your option) any later version. + +This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser +General Public License for more details. + +You should have received a copy of the GNU Lesser General Public License along with this library; +if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +contact: Samantha AT Bioinformatics DOT nyu DOT edu +715 Broadway, 10th floor +New York, NY 10003 \ No newline at end of file Added: LGPL.TXT ============================================================================== --- (empty file) +++ LGPL.TXT Wed Aug 16 16:18:39 2006 @@ -0,0 +1,106 @@ +TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + +0. This License Agreement applies to any software library or other program which contains a notice placed by the copyright holder or other authorized party saying it may be distributed under the terms of this Lesser General Public License (also called "this License"). Each licensee is addressed as "you". + +A "library" means a collection of software functions and/or data prepared so as to be conveniently linked with application programs (which use some of those functions and data) to form executables. + +The "Library", below, refers to any such software library or work which has been distributed under these terms. A "work based on the Library" means either the Library or any derivative work under copyright law: that is to say, a work containing the Library or a portion of it, either verbatim or with modifications and/or translated straightforwardly into another language. (Hereinafter, translation is included without limitation in the term "modification".) + +"Source code" for a work means the preferred form of the work for making modifications to it. For a library, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the library. + +Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running a program using the Library is not restricted, and output from such a program is covered only if its contents constitute a work based on the Library (independent of the use of the Library in a tool for writing it). Whether that is true depends on what the Library does and what the program that uses the Library does. + +1. You may copy and distribute verbatim copies of the Library's complete source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and distribute a copy of this License along with the Library. + +You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. + +2. You may modify your copy or copies of the Library or any portion of it, thus forming a work based on the Library, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: + + a) The modified work must itself be a software library. + + b) You must cause the files modified to carry prominent notices stating that you changed the files and the date of any change. + + c) You must cause the whole of the work to be licensed at no charge to all third parties under the terms of this License. + + d) If a facility in the modified Library refers to a function or a table of data to be supplied by an application program that uses the facility, other than as an argument passed when the facility is invoked, then you must make a good faith effort to ensure that, in the event an application does not supply such function or table, the facility still operates, and performs whatever part of its purpose remains meaningful. + + (For example, a function in a library to compute square roots has a purpose that is entirely well-defined independent of the application. Therefore, Subsection 2d requires that any application-supplied function or table used by this function must be optional: if the application does not supply it, the square root function must still compute square roots.) + + These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Library, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Library, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. + + Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Library. + + In addition, mere aggregation of another work not based on the Library with the Library (or with a work based on the Library) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. + +3. You may opt to apply the terms of the ordinary GNU General Public License instead of this License to a given copy of the Library. To do this, you must alter all the notices that refer to this License, so that they refer to the ordinary GNU General Public License, version 2, instead of to this License. (If a newer version than version 2 of the ordinary GNU General Public License has appeared, then you can specify that version instead if you wish.) Do not make any other change in these notices. + +Once this change is made in a given copy, it is irreversible for that copy, so the ordinary GNU General Public License applies to all subsequent copies and derivative works made from that copy. + +This option is useful when you wish to copy part of the code of the Library into a program that is not a library. + +4. You may copy and distribute the Library (or a portion or derivative of it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange. + +If distribution of object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place satisfies the requirement to distribute the source code, even though third parties are not compelled to copy the source along with the object code. + +5. A program that contains no derivative of any portion of the Library, but is designed to work with the Library by being compiled or linked with it, is called a "work that uses the Library". Such a work, in isolation, is not a derivative work of the Library, and therefore falls outside the scope of this License. + +However, linking a "work that uses the Library" with the Library creates an executable that is a derivative of the Library (because it contains portions of the Library), rather than a "work that uses the library". The executable is therefore covered by this License. Section 6 states terms for distribution of such executables. + +When a "work that uses the Library" uses material from a header file that is part of the Library, the object code for the work may be a derivative work of the Library even though the source code is not. Whether this is true is especially significant if the work can be linked without the Library, or if the work is itself a library. The threshold for this to be true is not precisely defined by law. + +If such an object file uses only numerical parameters, data structure layouts and accessors, and small macros and small inline functions (ten lines or less in length), then the use of the object file is unrestricted, regardless of whether it is legally a derivative work. (Executables containing this object code plus portions of the Library will still fall under Section 6.) + +Otherwise, if the work is a derivative of the Library, you may distribute the object code for the work under the terms of Section 6. Any executables containing that work also fall under Section 6, whether or not they are linked directly with the Library itself. + +6. As an exception to the Sections above, you may also combine or link a "work that uses the Library" with the Library to produce a work containing portions of the Library, and distribute that work under terms of your choice, provided that the terms permit modification of the work for the customer's own use and reverse engineering for debugging such modifications. + +You must give prominent notice with each copy of the work that the Library is used in it and that the Library and its use are covered by this License. You must supply a copy of this License. If the work during execution displays copyright notices, you must include the copyright notice for the Library among them, as well as a reference directing the user to the copy of this License. Also, you must do one of these things: + + a) Accompany the work with the complete corresponding machine-readable source code for the Library including whatever changes were used in the work (which must be distributed under Sections 1 and 2 above); and, if the work is an executable linked with the Library, with the complete machine-readable "work that uses the Library", as object code and/or source code, so that the user can modify the Library and then relink to produce a modified executable containing the modified Library. (It is understood that the user who changes the contents of definitions files in the Library will not necessarily be able to recompile the application to use the modified definitions.) + + b) Use a suitable shared library mechanism for linking with the Library. A suitable mechanism is one that (1) uses at run time a copy of the library already present on the user's computer system, rather than copying library functions into the executable, and (2) will operate properly with a modified version of the library, if the user installs one, as long as the modified version is interface-compatible with the version that the work was made with. + + c) Accompany the work with a written offer, valid for at least three years, to give the same user the materials specified in Subsection 6a, above, for a charge no more than the cost of performing this distribution. + + d) If distribution of the work is made by offering access to copy from a designated place, offer equivalent access to copy the above specified materials from the same place. + + e) Verify that the user has already received a copy of these materials or that you have already sent this user a copy. + +For an executable, the required form of the "work that uses the Library" must include any data and utility programs needed for reproducing the executable from it. However, as a special exception, the materials to be distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. + +It may happen that this requirement contradicts the license restrictions of other proprietary libraries that do not normally accompany the operating system. Such a contradiction means you cannot use both them and the Library together in an executable that you distribute. + +7. You may place library facilities that are a work based on the Library side-by-side in a single library together with other library facilities not covered by this License, and distribute such a combined library, provided that the separate distribution of the work based on the Library and of the other library facilities is otherwise permitted, and provided that you do these two things: + + a) Accompany the combined library with a copy of the same work based on the Library, uncombined with any other library facilities. This must be distributed under the terms of the Sections above. + + b) Give prominent notice with the combined library of the fact that part of it is a work based on the Library, and explaining where to find the accompanying uncombined form of the same work. + +8. You may not copy, modify, sublicense, link with, or distribute the Library except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense, link with, or distribute the Library is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. + +9. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Library or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Library (or any work based on the Library), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Library or works based on it. + +10. Each time you redistribute the Library (or any work based on the Library), the recipient automatically receives a license from the original licensor to copy, distribute, link with or modify the Library subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties with this License. + +11. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Library at all. For example, if a patent license would not permit royalty-free redistribution of the Library by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Library. + +If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply, and the section as a whole is intended to apply in other circumstances. + +It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. + +This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. + +12. If the distribution and/or use of the Library is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Library under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. + +13. The Free Software Foundation may publish revised and/or new versions of the Lesser General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. + +Each version is given a distinguishing version number. If the Library specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Library does not specify a license version number, you may choose any version ever published by the Free Software Foundation. + +14. If you wish to incorporate parts of the Library into other free programs whose distribution conditions are incompatible with these, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. + +NO WARRANTY + +15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + +16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. +END OF TERMS AND CONDITIONS \ No newline at end of file Added: README.txt ============================================================================== --- (empty file) +++ README.txt Wed Aug 16 16:18:39 2006 @@ -0,0 +1,22 @@ +CLARITY + +CLARITY is a tool and method for the storage and comparison of data with numeric and set membership components. +It is specifically geared toward timecourse microarray data, which is used to study the activity of genes across time. +By using data that has been redescribed into Gene Ontology (GO) terms, and summarizing the regulation of these terms across +time using characters (together forming sequences) we are able to use standard DNA alignment techniques with these sequences. + +The Gene Ontology (GO), is a controlled vocabulary used to aid the description of genes and gene product attributes in a +variety of organisms. There are three different ontologies that describe molecular functions, biological processes, and cellular components. + +Requirements: + +CLARITY Database -- which requires MySQL. +Lispworks Enterprise Edition 4.2 or higher -- this restriction will +be removed soon by making sure that the MySQL connection works +on the freely available CL-SQL. + + +Last Update: 2006-08-16 + +Contact: samantha AT bioinformatics DOT nyu DOT edu +Copyright 2006 Samantha Kleinberg Added: alignment-functions.lisp.lisp ============================================================================== --- (empty file) +++ alignment-functions.lisp.lisp Wed Aug 16 16:18:39 2006 @@ -0,0 +1,551 @@ +;;; -*- Mode: Lisp -*- + +#|CLARITY: Common Lisp Data Alignment Repository +Copyright (c) 2006 Samantha Kleinberg +All rights reserved. + +This library is free software; you can redistribute it and/or modify it under the terms of the GNU +Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the +License, or (at your option) any later version. + +This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser +General Public License for more details. + +You should have received a copy of the GNU Lesser General Public License along with this library; +if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +contact: Samantha AT Bioinformatics DOT nyu DOT edu +715 Broadway, 10th floor +New York, NY 10003|# + +(in-package "CLARITY") + +(eval-when (:compile-toplevel :load-toplevel :execute) + (require "sql") + (require "odbc")) + +#.(sql:enable-sql-reader-syntax) + +(defparameter *gap* #\-) +(defparameter *true* 1) +(defparameter *false* 0) + +(defstruct (alignment + (:constructor new-alignment)) + (score) + (items)) ;;type is pair of alignment items + +(defstruct (alignment-item + (:constructor new-alignment-item)) + (dataset-id) + (chart-id) + (term-name) + (string)) + + +(defgeneric align-charts (clh id_1 id_2) + (:documentation "Aligns two datasets, given their timecourse data ids. + arguments: clarity-handle timecourse-id-1 timecourse-id-2 + usage: (clarity:align-charts clarity-handle timecourse-id-1 timecourse-id-2) + notes: Returns hash table of alignments hashed by score" + )) + +(defgeneric score-pair (clh id_1 id_2) + (:documentation "Given two timecourse data ids, computes their alignment and + returns score computed from hash table +arguments: clarity-handle timecourse-data-id-1 timecourse-data-id-2 +usage: (clarity:score-pair clarity-handle timecourse-data-id-1 timecourse-data-id-2) +notes: Returns single numerical value" + )) + +(defgeneric align-to-consensus (clh timecourse-id consensus-id) + (:documentation "Aligns timecourse data to consensus data" + )) + +(defgeneric string-alignment (string1 string2) + (:documentation "Given two strings, performs dynamic programming alignment and returns the alignment score + arguments: string1 string2 + usage: (clarity:string-alignment ""UUDDUI"" ""IUDDDI"")" + )) + +(defgeneric score (char1 char2) + (:documentation "Given two characters, this function returns the numerical value associated with alignign one to the other + arguments: character1 character2 + usage (clarity:score U D)" + )) + +(defgeneric get-root (clh) + (:documentation "Returns root of phylogenetic tree. + arguments: clarity-handle + usage: (clarity:get-root clarity-handle) + notes: returns id number of root node." + )) + +;;right now, choose charts based on data ids +(defmethod align-charts ((clh clarity-handle) id_1 id_2) + ;;get intersection of datasets + (let* ((alignment-hash (make-hash-table :test #'equal)) + (intersection-list (sql:select [fir.term_name] [fir.timecourse_data_id] [fir.id] [fir.sequence] + [sec.timecourse_data_id] [sec.id] [sec.sequence] + :from '(#.(sql::make-db-identifier :val "gantt_chart FIR") + #.(sql::make-db-identifier :val "gantt_chart SEC")) + :where [and [= ["FIR" timecourse_data_id] id_1] + [= ["SEC" timecourse_data_id] id_2] + [= ["FIR" term_name] ["SEC" term_name]]] + :database (connection clh) + )) + (alignment-items (loop for (term time_id_1 first_id first_sequence + time_id_2 second_id second_sequence) in intersection-list + collecting (list (new-alignment-item :dataset-id time_id_1 + :chart-id first_id + :term-name term + :string first_sequence) + (new-alignment-item :dataset-id time_id_2 + :chart-id second_id + :term-name term + :string second_sequence)) + ))) + + (loop for value in (loop for (left right) in alignment-items + collecting (new-alignment :score (string-alignment + (alignment-item-string left) + (alignment-item-string right)) + :items (list left right)) + ) + do (push value (gethash (alignment-score value) alignment-hash)) + finally (return alignment-hash)) + )) + + +(defmethod score-pair ((clh clarity-handle) id_1 id_2) + (let ((hash (align-charts clh + (first (first (sql:select [timecourse_data_id] + :from [|tree|] + :where [= [id] id_1] + :database (connection clh)))) + (first (first (sql:select [timecourse_data_id] + :from [|tree|] + :where [= [id] id_2] + :database (connection clh))))))) + (loop for key being the hash-keys of hash + with alignmentSum=0 + summing (* key (length (gethash key hash))) into alignmentSum + finally (return alignmentSum) + )) + ) + + +(defmethod align-to-consensus ((clh clarity-handle) timecourse-id consensus-id) + ;;get intersection of datasets + (let* ((alignment-hash (make-hash-table :test #'equal)) + (intersection-list (sql:select [fir.term_name] [fir.timecourse_data_id] [fir.id] [fir.sequence] + [sec.tree_id] [sec.id] [sec.sequence] + :from '(#.(sql::make-db-identifier :val "gantt_chart FIR") + #.(sql::make-db-identifier :val "consensus SEC")) + :where [and [= ["FIR" timecourse_data_id] timecourse-id] + [= ["SEC" tree_id] consensus-id] + [= ["FIR" term_name] ["SEC" term_name]]] + :database (connection clh) + )) + + (alignment-items (loop for (term time_id first_id first_sequence + tree_id second_id second_sequence) in intersection-list + collecting (list (new-alignment-item :dataset-id time_id + :chart-id first_id + :term-name term + :string first_sequence) + (new-alignment-item :dataset-id tree_id + :chart-id second_id + :term-name term + :string second_sequence)) + ))) + + (loop for value in (loop for (left right) in alignment-items + collecting (new-alignment :score (string-alignment + (alignment-item-string left) + (alignment-item-string right)) + :items (list left right)) + ) + do (push value (gethash (alignment-score value) alignment-hash)) + finally (return alignment-hash)) + )) + +(defmethod score-pair-consensus ((clh clarity-handle) timecourse-id consensus-id) + (let ((hash (align-to-consensus clh + (first (first (sql:select [timecourse_data_id] + :from [|tree|] + :where [= [id] timecourse-id] + :database (connection clh)))) + consensus-id))) + + + (loop for key being the hash-keys of hash + with alignmentSum=0 + summing (* key (length (gethash key hash))) into alignmentSum + finally (return alignmentSum) + ) + ) + ) + + +(defmethod score (char1 char2) + (declare (type character char1 char2)) + (cond ((char= char1 char2) 3) + ;((char= char1 *gap*) -1) + ;((char= char2 *gap*) -1) + ((and (char= char1 #\U) (char= char2 #\D)) -2) + ((and (char= char1 #\D) (char= char2 #\U)) -2) + (t -1) + )) + +(defmethod string-alignment (string1 string2) + (let* ((l1 (length string1)) + (l2 (length string2)) + (table (make-array (list (+ l1 1) (+ l2 1)) + :initial-element 0))) + + ;;initialize table + (loop for i from 1 to l1 + do (setf (aref table i 0) (+ (aref table (- i 1) 0) (score (char string1 (- i 1)) *gap*))) + ) + (loop for k from 1 to l2 + do (setf (aref table 0 k) (+ (aref table 0 (- k 1)) (score *gap* (char string2 (- k 1)))))) + + ;;fill in rest of table and return score in lower right corner + (loop for k from 1 to l2 + do (loop for i from 1 to l1 + do (setf (aref table i k) + (max (+ (aref table (- i 1) k) (score (char string1 (- i 1)) *gap*)) + (+ (aref table (- i 1) (- k 1)) (score (char string1 (- i 1)) + (char string2 (- k 1)))) + (+ (aref table i (- k 1)) (score *gap* (char string2 (- k 1))))))) + finally (return (aref table l1 l2 ))) + + )) + + + + +(defmethod get-root ((clh clarity-handle)) + ;;returns tree id of root node + (first (sql:with-transaction + (sql:select [id] + :from [|tree|] + :where [= [is_root] 1] + :database (connection clh) + :flatp t)))) + + + +(defmethod tree-insert ((clh clarity-handle) timecourse_data_id) + (let ((root (get-root clh))) + (if root + ;there is a root + (let ((new-node-id)) + ;;make node for new-node + (sql:with-transaction + (sql:insert-records :into [|tree|] + :attributes '([|timecourse_data_id|] [|node_left|] [|node_right|]) + :values (list timecourse_data_id 0 0) + :database (connection clh))) + (setf new-node-id (lastid clh :table "tree")) + (setf *new-best-node* 0) + (setf *new-best-score* 0) + + (multiple-value-bind (best-node best-score) + (tree-insert-recursive clh new-node-id root) + ;;if there is no best node, insert as sibling of root + (insert-node clh new-node-id + (cond ((= best-node 0) root) + (t best-node))))) + + ;no root, data to insert becomes root. this is the base case + (sql:with-transaction + (sql:insert-records :into [|tree|] + :attributes '([|timecourse_data_id|] + [|is_root|] + [|node_left|] + [|node_right|]) + :values (list timecourse_data_id *true* 0 0) + :database (connection clh))) + ) + )) + + +;;node referred to by node-id. if node has no children, it has timecourse data. +;; if it's an internal node, it has simply a consensus sequence" + +(defvar *new-best-node*) +(defvar *new-best-score*) + +(defmethod tree-insert-recursive ((clh clarity-handle) new-node current-node) + #| (if (eq depth 0) + (score-pair clh new-node current-node) + )|# + (destructuring-bind (left right) + (first (sql:select [node_left] [node_right] + :from [|tree|] + :where [= [id] current-node] + :database (connection clh))) + (let ((score (cond ((and (= 0 left) (= 0 right)) ;;if leaf node, use reg-score-pair + (score-pair clh new-node current-node)) + (t (score-pair-consensus clh new-node current-node)))) +; (new-best-node best-node) + ; (new-best-score best-score)) + ) + + (when (> score *new-best-score*) + (setf *new-best-node* current-node) + (setf *new-best-score* score) + ) + + (if (> left 0) + (tree-insert-recursive clh new-node left)) + + (if (> right 0) + (tree-insert-recursive clh new-node right)) + + (values *new-best-node* *new-best-score*) + ))) + + + +(defmethod insert-node ((clh clarity-handle) new-node-id sibling-node-id) + (let ((new-parent-id) + (new-node-data-id (first (first (sql:select [timecourse_data_id] + :from [|tree|] + :where [= [id] new-node-id] + :database (connection clh))))) + (new-consensus)) + + (destructuring-bind (sib-left sib-right sib-data-id is-root) + (first (sql:select [node_left] [node_right][timecourse_data_id][is_root] + :from [|tree|] + :where [= [|id|] sibling-node-id] + :database (connection clh) + )) + + (when is-root + ;;if sibling was root, it no longer is, then parent becomes root + (sql:update-records [|tree|] + :where [= [|id|] sibling-node-id] + :attributes '([|is_root|]) + :values '(0) + :database (connection clh)) + ) + + ;;make new-node for parent + (sql:with-transaction + (sql:insert-records :into [|tree|] + :attributes '([|timecourse_data_id|] [|node_left|] [|node_right|][is_root]) + :values (list 0 sibling-node-id new-node-id is-root) + :database (connection clh))) + + (setf new-parent-id (lastid clh :table "tree")) + ;;update parent's consensus seq with it's id + ;;actualyl consensus id IS node id! + + ;;update sibling's original parent + ;;could have been a left child or a right child. try both. + ;;get id to update old parent's consensus + (let ((old-parent-id + (or (first (sql:with-transaction + (sql:select [|id|] :from [|tree|] + :where [and [= [node_left] sibling-node-id] + [not [= [id] new-parent-id]]] + :database (connection clh) :flatp t))) + (first (sql:with-transaction + (sql:select [|id|] :from [|tree|] + :where [and [= [node_right] sibling-node-id] + [not [= [id] new-parent-id]]] + :database (connection clh) :flatp t)))))) + (sql:with-transaction + (sql:update-records [|tree|] + :where [and [= [node_left] sibling-node-id] + [= [id] old-parent-id]] + :attributes '([|node_left|]) + :values (list new-parent-id) + :database (connection clh))) + + (sql:with-transaction + (sql:update-records [|tree|] + :where [and [= [node_right] sibling-node-id] + [= [id] old-parent-id]] + :attributes '([|node_right|]) + :values (list new-parent-id) + :database (connection clh))) + + + + ;;build consensus sequence + ;;when buildng consensus: right is always real data, since new. left may or may not be consensus + (build-consensus clh new-parent-id sibling-node-id new-node-data-id) + + + (when old-parent-id + ;;after making consensus sequence, for new node, need to update parent of new node's consensus! + ;;delete old consensus from table + (sql:with-transaction + (sql:delete-records :from [|consensus|] + :where [= [tree_id] old-parent-id] + :database (connection clh))) + + ;;build consensus to replace old + (build-internal-consensus clh old-parent-id)) + + + )))) + + +(defvar *test*) +(defvar *test-list*) + +(defmethod build-consensus ((clh clarity-handle) node-id data-left data-right) + ;;right is always timecourse, left may be either + + (destructuring-bind (data-id) + (first (sql:select [timecourse_data_id] + :from [|tree|] + :where [= [id] data-left] + :database (connection clh))) + (let ((term-seq-list + (cond ((> data-id 0) + ;;if left is timecourse_data + (sql:select [lchild.term_name] [lchild.sequence] + :from '(#.(sql::make-db-identifier :val "gantt_chart LCHILD") + #.(sql::make-db-identifier :val "gantt_chart RCHILD")) + :where [and [= ["LCHILD" timecourse_data_id] data-id] + [= ["RCHILD" timecourse_data_id] data-right] + [= ["LCHILD" term_name] ["RCHILD" term_name]] + [= ["LCHILD" sequence] ["RCHILD" sequence]]] + :database (connection clh))) + ; ((> consensus-id 0) + ;;left is consensus data + (t + (sql:select [lchild.term_name] [lchild.sequence] + :from '(#.(sql::make-db-identifier :val "consensus LCHILD") + #.(sql::make-db-identifier :val "gantt_chart RCHILD")) + :where [and [= ["LCHILD" tree_id] data-left] + [= ["RCHILD" timecourse_data_id] data-right] + [= ["LCHILD" term_name] ["RCHILD" term_name]] + [= ["LCHILD" sequence] ["RCHILD" sequence]]] + :database (connection clh))) + #|(t + (print "error!!!"))|# + ))) + + (setf *test-list* term-seq-list) + + (when term-seq-list + (loop for (term seq) in term-seq-list + do(store-consensus-sequence clh node-id term seq) + )) + + ))) + +(defmethod build-internal-consensus ((clh clarity-handle) node-id) + ;;at least one node is consensus, other may be either + (destructuring-bind (data-left data-right) + (first (sql:select [|node_left|] [|node_right|] + :from [|tree|] + :where [= [|id|] node-id] + :database (connection clh))) + + (let ((left-data-id + (first (sql:select [timecourse_data_id] + :from [|tree|] + :where [= [id] data-left] + :database (connection clh) + :flatp t))) + (right-data-id + (first (sql:select [timecourse_data_id] + :from [|tree|] + :where [= [id] data-right] + :database (connection clh) + :flatp t)))) + (let ((term-seq-list + (cond ((and (> left-data-id 0) + (> right-data-id 0)) + ;;if left is timecourse_data + (sql:select [lchild.term_name] [lchild.sequence] + :from '(#.(sql::make-db-identifier :val "gantt_chart LCHILD") + #.(sql::make-db-identifier :val "gantt_chart RCHILD")) + :where [and [= ["LCHILD" timecourse_data_id] left-data-id] + [= ["RCHILD" timecourse_data_id] right-data-id] + [= ["LCHILD" term_name] ["RCHILD" term_name]] + [= ["LCHILD" sequence] ["RCHILD" sequence]]] + :database (connection clh))) + ((and (> left-data-id 0) + (= right-data-id 0)) + ;;if left is timecourse_data + (sql:select [lchild.term_name] [lchild.sequence] + :from '(#.(sql::make-db-identifier :val "gantt_chart LCHILD") + #.(sql::make-db-identifier :val "consensus RCHILD")) + :where [and [= ["LCHILD" timecourse_data_id] left-data-id] + [= ["RCHILD" tree_id] data-right] + [= ["LCHILD" term_name] ["RCHILD" term_name]] + [= ["LCHILD" sequence] ["RCHILD" sequence]]] + :database (connection clh))) + + ((and (= left-data-id 0) + (= right-data-id 0)) + ;;if left is timecourse_data + (sql:select [lchild.term_name] [lchild.sequence] + :from '(#.(sql::make-db-identifier :val "consensus LCHILD") + #.(sql::make-db-identifier :val "consensus RCHILD")) + :where [and [= ["LCHILD" tree_id] data-left] + [= ["RCHILD" tree_id] data-right] + [= ["LCHILD" term_name] ["RCHILD" term_name]] + [= ["LCHILD" sequence] ["RCHILD" sequence]]] + :database (connection clh))) + + (t + (sql:select [lchild.term_name] [lchild.sequence] + :from '(#.(sql::make-db-identifier :val "consensus LCHILD") + #.(sql::make-db-identifier :val "gantt_chart RCHILD")) + :where [and [= ["LCHILD" tree_id] data-left] + [= ["RCHILD" timecourse_data_id] right-data-id] + [= ["LCHILD" term_name] ["RCHILD" term_name]] + [= ["LCHILD" sequence] ["RCHILD" sequence]]] + :database (connection clh))) + ))) + + term-seq-list + (when term-seq-list + (loop for (term seq) in term-seq-list + do(store-consensus-sequence clh node-id term seq) + )) + + )))) + +(defmethod store-consensus-sequence ((clh clarity-handle) node-id term-name sequence) + (sql:with-transaction + (sql:insert-records :into [|consensus|] + :attributes '([|tree_id|] [|term_name|] [|sequence|]) + :values (list node-id term-name sequence) + :database (connection clh))) + ) + +(defmethod get-consensus-terms ((clh clarity-handle) node-id) + ;;node-id is tree id + (sql:with-transaction + (sql:select [term_name] + :from [|consensus|] + :where [= [tree_id] node-id] + :database (connection clh))) + ) + +(defmethod get-data-terms ((clh clarity-handle) data-id) + (sql:with-transaction + (sql:select [term_name] + :from [|gantt_chart|] + :where [= [timecourse_data_id] data-id] + :database (connection clh))) + + ) + +#.(sql:disable-sql-reader-syntax) + + +;;; end of file -- alignment-functions.lisp -- Added: clarity-package.lisp ============================================================================== --- (empty file) +++ clarity-package.lisp Wed Aug 16 16:18:39 2006 @@ -0,0 +1,113 @@ +;;; -*- Mode: Lisp -*- + +#|CLARITY: Common Lisp Data Alignment Repository +Copyright (c) 2006 Samantha Kleinberg +All rights reserved. + +This library is free software; you can redistribute it and/or modify it under the terms of the GNU +Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the +License, or (at your option) any later version. + +This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser +General Public License for more details. + +You should have received a copy of the GNU Lesser General Public License along with this library; +if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +contact: Samantha AT Bioinformatics DOT nyu DOT edu +715 Broadway, 10th floor +New York, NY 10003|# + +(defpackage "CLARITY" (:use "CL") + (:export + "ALIGN-CHARTS" + "SCORE" + "SCORE-PAIR" + "ALIGN-TO-CONSENSUS" + "SCORE-PAIR-CONSENSUS" + "STRING-ALIGNMENT" + "GET-ROOT" + + "TREE-INSERT" + "TREE-INSERT-RECURSIVE" + "INSERT-NODE" + "BUILD-CONSENSUS" + "BUILD-INTERNAL-CONSENSUS" + "STORE-CONSENSUS-SEQUENCE" + "GET-CONSENSUS-TERMS" + "GET-DATA-TERMS") + (:export + "CLARITY-HANDLE" + "CLARITY-HANDLE-P" + "*CURRENT-CLARITY-HANDLE*" + "MAKE-CLARITY-HANDLE" + "DISCONNECT-CLARITY-DBS" + "CONNECT" + "NUMBER-TO-STRING" + "INSERT" + "INSERT-WITH-PROBES" + "GANTTIFY" + "GANTTIFY-WITH-PROBES" + "STORE-GANTT-CHARTS" + "STORE-GANTT-CHART" + "STORE-NUMERICAL-DATA" + "STORE-NUMERICAL-AND-PROBE-DATA" + "FLATTEN" + "LASTID" + "FILE-LINES" + "GET-CHILDREN" + "GET-NODE-TERMS" + "GET-ALL-DATA") + + (:export + "READ-STRING-WHILE" + "DECIMAL-READER" + "PARSE-DECIMAL" + "USE-DECIMAL") + + (:export + "INSERT-FILE-POPUP" + "GET-FILENAME" + "DATABASE-SWITCH-CALLBACK" + "PRINT-PARTIAL-FILENAME" + ) + (:export + "START-CLARITY-GUI" + "START-SETUP-INTERFACE" + ) + + (:export + "*CLARITY-DB-NAME*" + "*CLARITY-DB-USER*" + "*CLARITY-DB-PASSWORD*" + ) + + (:export + "INSERT-FILE-POPUP" + "INSERT-DATA-INTERFACE" + "GET-FILENAME" + "GET-PHYLOGENY-ROOT" + "GET-PHYLOGENY-CHILDREN" + "DATABASE-SWITCH-CALLBACK" + "PRINT-PARTIAL-FILENAME" + ) + (:export + "START-CLARITY-GUI" + "START-CLARITY-INTERFACE" + "START-SETUP-INTERFACE" + "START-WINDOWS-DATA-SOURCE-SETUP" + "START-MACOSX-DATA-SOURCE-SETUP" + "CLARITY-DATABASE-SETUP-INTERFACE" + ) + (:export + "PHYLOGENY-ITEM" + "PHYLOGENY-TERM" + "PHYLOGENY-WINDOW" + ) + ) + + + + +;;; end of file -- clarity-package.lisp -- Added: clarity.exe ============================================================================== Binary file. No diff available. Added: clarity.system ============================================================================== --- (empty file) +++ clarity.system Wed Aug 16 16:18:39 2006 @@ -0,0 +1,62 @@ +;;; -*- Mode: Lisp -*- + + +;;; Setting up the logical pathname. + +(eval-when (:load-toplevel :execute) + (setf (logical-pathname-translations "CLARITY") + `(("*.*" ,(make-pathname :name :wild :type :wild + :defaults *load-pathname*)) + ("*.*.*" ,(make-pathname :name :wild :type :wild :version :wild + :defaults *load-pathname*)) + ("**;*.*" ,(merge-pathnames + (make-pathname :directory '(:relative :wild-inferiors) + :name :wild + :type :wild + :version :wild) + *load-pathname* + )) + ("**;*.*.*" ,(merge-pathnames + (make-pathname :directory '(:relative :wild-inferiors) + :name :wild + :type :wild + :version :wild + :version :wild) + *load-pathname* + )) + ))) + + + +;;; Adding registry locations. + +(eval-when (:load-toplevel :execute) + (mk:add-registry-location + (merge-pathnames (pathname "gui/") + (make-pathname :name nil :type nil + :defaults *load-pathname*))) + + (mk:add-registry-location (translate-logical-pathname "CLARITY:"))) + + +(mk:defsystem "CLARITY" + :components ("clarity-package" + (:system "cl-data-files") + "decimal-number" + (:file "database-functions" :depends-on ("clarity-package")) + "alignment-functions" + ) + ) + + +#+sysdeps +(mk:defsystem "CLARITY" + :components ((:subsystem "clarity-gui" :source-pathname "gui/") + "decimal-number" + "database-functions" + "alignment-functions" + "cl-data-files" + "clarity-package") + :depends-on ("CL-DATA-FILES")) + +;;; end of file -- clarity.system -- Added: database-functions.lisp ============================================================================== --- (empty file) +++ database-functions.lisp Wed Aug 16 16:18:39 2006 @@ -0,0 +1,465 @@ +;;; -*- Mode: Lisp -*- + +#|CLARITY: Common Lisp Data Alignment Repository +Copyright (c) 2006 Samantha Kleinberg +All rights reserved. + +This library is free software; you can redistribute it and/or modify it under the terms of the GNU +Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the +License, or (at your option) any later version. + +This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser +General Public License for more details. + +You should have received a copy of the GNU Lesser General Public License along with this library; +if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +contact: Samantha AT Bioinformatics DOT nyu DOT edu +715 Broadway, 10th floor +New York, NY 10003|# + +(in-package "CLARITY") + +(eval-when (:compile-toplevel :load-toplevel :execute) + (require "sql") + (require "odbc")) + + +#.(sql:enable-sql-reader-syntax) + + +(defclass clarity-handle () + ( + ;; GRAPH/DB maintainance. + ;; none yet + ;; Connection information. + (connection :accessor connection :initform nil) + ) + (:documentation "The CLARITY Handle Class. +Class containing specifications for connecting to the database.")) + + + + +;;; Protocol. + +(defgeneric clarity-handle-p (x) + (:method ((x clarity-handle)) t) + (:method ((x t)) nil)) + +(defgeneric connect (clarity-handle db-spec &optional connection) + (:documentation "Sets up a connection to an the clarity database + for the handle. + arguments: connection string, optional connection + usage: (godb:connect ""data source name/user/password"") + notes: ")) + +(defgeneric insert (clarity-handle filename filedate) + (:documentation "Takes a file and adds it to the database + arguments: handle, path to file, date of file creation + usage: (clarity:insert cl-handle ""Z:/filename.txt"" MO/DAY/YR)" + )) + + +(defgeneric ganttify (clarity-handle filename) + (:documentation "Takes a file with columns of numerical data and transforms + data into strings + arguments: clarity-handle filename + usage: (clarity:ganttify cl-handle ""Z:/filename.txt)" + )) + +(defgeneric get-children (node-id) + (:documentation "Gets left and right child of node in phylogenetic tree + arguments: tree-id + usage: (clarity:get-children tree-id)" + )) + + +(defgeneric get-node-terms (clarity-handle node-id) + (:documentation "Gets all terms associated with a tree node. + arguments: cl-handle tree-id + usage: (clarity:get-node-terms cl-handle tree-id) + notes: Terms may be part of conensus sequence or actual data set" + )) + + +(defun sqlcon () + "Connects to sql using stored connection information." + (sql:connect "GODB_internal/root" :database-type :odbc :if-exists :old)) + + + + +(defvar *cl-handle*) + +(defvar *current-clarity-handle* nil) + +(defun make-clarity-handle () + "Creates a new instance of the clarity handle class and assigns +it to the current-clarity-handle variable" + (setf *current-clarity-handle* (make-instance 'clarity-handle))) + + +(defun disconnect-clarity-dbs () + (when (member (connection *current-clarity-handle*) (sql:connected-databases)) + (sql:disconnect :database (connection *current-clarity-handle*)))) + + +(defmethod connect ((clh clarity-handle) (db-spec string) &optional connection) + (format t "~S connecting as ~S~%" clh db-spec) + (if connection + (setf (connection clh) connection) + (setf (connection clh) (sql:connect db-spec :database-type :odbc :if-exists :old)))) + + +(defun number-to-string (number) + (format nil "~s" number) + ) + +;;will have variety of insert methods, for different types of input. +;;for now, only simple, very processed, input is allowed +(defmethod insert ((clh clarity-handle) filename filedate) + (let ((gantt-chart) + (file-id)) + ;;insert datafile in db + (sql:with-transaction + (sql:insert-records :into [|timecourse_data|] + :attributes '([|datafile_path|] [|creation_date|]) + :values (list filename filedate) + :database (connection clh))) + (setf file-id (lastid clh :table "timecourse_data")) + + ;:Create gantt chart of datafile's contents + (multiple-value-bind (header gantt-chart) (ganttify clh filename) + (store-gantt-charts clh file-id gantt-chart) + (store-numerical-data clh file-id filename) + ) + ;;ask if file should be inserted into tree + (when (capi:confirm-yes-or-no "Add new file to tree?") + (tree-insert clh file-id) + ) + + ) + ) + +(defmethod insert-with-probes ((clh clarity-handle) filename filedate &key probes-p) + (let ((gantt-chart) + (file-id)) + ;;insert datafile in db + (sql:with-transaction + (sql:insert-records :into [|timecourse_data|] + :attributes '([|datafile_path|] [|creation_date|]) + :values (list filename filedate) + :database (connection clh))) + (setf file-id (lastid clh :table "timecourse_data")) + + ;:Create gantt chart of datafile's contents + (multiple-value-bind (header gantt-chart) + (ganttify-with-probes clh filename) + (store-gantt-charts clh file-id gantt-chart) + + (store-numerical-and-probe-data clh file-id filename) + ) + ;;ask if file should be inserted into tree + (when (capi:confirm-yes-or-no "Add new file to tree?") + (tree-insert clh file-id) + ) + + )) + +(defvar numlines) + +(defmethod ganttify ((clh clarity-handle) f) ;clh = clarity handle + (let* ((lines (file-lines f)) + (split-lines (loop for line in lines + collecting (split-sequence:split-sequence #\Tab line :remove-empty-subseqs t) + )) + (head (first split-lines)) + #|header of form "term_name 0 2 TAB 2 4 TAB 4 8 + want '(term name ('(0 2) . . .'(4 8)))|# + (header (append (list (first head)) + (loop for nums in (rest head) + collecting + (loop for dig in (split-sequence:split-sequence #\Space nums :remove-empty-subseqs t) + collecting (cond ((equal dig nil) nil) + (t (coerce (parse-decimal dig) 'double-float))))))) + (numerical-lines (loop for (label . nums) in (rest split-lines) + collecting (append (list label) + (loop for n in nums collecting (cond ((equal n "NIL") nil) + (t (coerce (parse-decimal n) 'double-float))))))) + + (sequences (loop for (label . nums) in numerical-lines + collecting (append (list label) + (list (loop for num in nums + collecting (cond ((equal num nil) #\I) ;;check first so there won't be type errors + ((> num 0) #\U) + ((< num 0) #\D) + ((= num 0) #\N) + (t #\I)) into my-string + finally (return (concatenate 'string my-string)))))))) + + (values header sequences) + )) + +(defmethod ganttify-with-probes ((clh clarity-handle) f) ;clh = clarity handle + (let* ((lines (file-lines f)) + (split-lines (loop for line in lines + collecting (split-sequence:split-sequence #\Tab line :remove-empty-subseqs t) + )) + (head (first split-lines)) + (header (remove-if (lambda (x) + (equal x nil)) + (append (list (first head)) + (loop for nums in (rest head) + collecting (cond ((equal nums "NIL") nil) + (t (loop for dig in + (split-sequence:split-sequence #\Space nums :remove-empty-subseqs t) + collecting (cond ((equal dig nil) nil) + (t (coerce (parse-decimal dig) 'double-float)))))))))) + + (numerical-lines (loop for (label . nums) in (rest split-lines) + collecting (append (list label) + (loop for i from 0 to (- (length nums) 1) by 2 + collecting (cond ((equal (nth i nums) "NIL") nil) + (t (coerce (parse-decimal (nth i nums)) + 'double-float))))))) + + (sequences (loop for (label . nums) in numerical-lines + collecting (append (list label) + (list (loop for num in nums + collecting (cond ((equal num nil) #\I) ;;check first so there won't be type errors + ((> num 0) #\U) + ((< num 0) #\D) + ((= num 0) #\N) + (t #\I)) into my-string + finally (return (concatenate 'string my-string)) + ))))) + ) + + + ; paired-lines + (values header sequences) + )) + + +(defmethod store-gantt-charts ((clh clarity-handle) data_id chart-list) + ;;store multiple gantt charts comprising a data set + ;;would be better to use this and not have to specify each col individually + (let ((window-string "")) + + (loop for c in chart-list + do(store-gantt-chart clh data_id c) + ) + )) + + +(defvar *head) + +(defmethod store-numerical-data ((clh clarity-handle) data-id file) + (let* ((lines (file-lines file)) + (split-lines (loop for line in lines + collecting (split-sequence:split-sequence #\Tab line :remove-empty-subseqs t) + )) + (head (first split-lines)) + #|header of form "term_name 0 2 TAB 2 4 TAB 4 8 + want '(term name ('(0 2) . . .'(4 8)))|# + (header (append (list (first head)) + (loop for nums in (rest head) + collecting (loop for dig in (split-sequence:split-sequence #\Space nums :remove-empty-subseqs t) + collecting (coerce (parse-decimal dig) 'short-float))))) + (numerical-lines (loop for (label . nums) in (rest split-lines) + collecting (append (list label) + (loop for n in nums collecting (cond ((equal n "NIL") 0.0) ;;bad fix! BAD! + (t (coerce (parse-decimal n) 'short-float))))))) + + + ) + + (setf *head header) + + (loop for (term . rest) in numerical-lines + do(loop for i = 1 + then (incf i) + for window in rest + do(sql:with-transaction + (sql:insert-records + :into [|numerical_data|] + :attributes '([|timecourse_data_id|] + [|term_name|] + [|window_start|] + [|window_end|] + [|data|]) + :values (list data-id + term + (first (nth i header)) + (second (nth i header)) + window) + :database (connection clh)))) + + + ) + ) + ) + +(defmethod store-numerical-and-probe-data ((clh clarity-handle) data-id file) + (let* ((lines (file-lines file)) + (split-lines (loop for line in lines + collecting (split-sequence:split-sequence #\Tab line :remove-empty-subseqs t) + )) + (head (first split-lines)) + #|header of form "term_name 0 2 TAB 2 4 TAB 4 8 + want '(term name ('(0 2) . . .'(4 8)))|# + (header (remove-if (lambda (x) + (equal x nil)) + (append (list (first head)) + (loop for nums in (rest head) + collecting (cond ((equal nums "NIL") nil) + (t (loop for dig in + (split-sequence:split-sequence #\Space nums :remove-empty-subseqs t) + collecting (cond ((equal dig nil) nil) + (t (coerce (parse-decimal dig) 'short-float)))))))))) + + (numerical-lines (loop for (label . nums) in (rest split-lines) + collecting (append (list label) + (loop for i from 0 to (- (length nums) 1) by 2 + collecting (list (cond ((equal (nth i nums) "NIL") 0.0) ;;bad fix! BAD! + (t (coerce (parse-decimal (nth i nums)) + 'short-float))) + (nth (+ i 1) nums) + ) + ))))) + + + (loop for (term . rest) in numerical-lines + do(loop for i = 1 + then (incf i) + for (window-num probes) in rest + do(sql:with-transaction + (sql:insert-records + :into [|numerical_data|] + :attributes '([|timecourse_data_id|] + [|term_name|] + [|window_start|] + [|window_end|] + [|data|] + [|probe_ids|]) + :values (list data-id + term + (first (nth i header)) + (second (nth i header)) + window-num + probes) + :database (connection clh)))) + + + ))) + + +(defun flatten (list) + (cond + ((null list) list) + ((atom list) (list list)) + (t (append (flatten (first list)) + (flatten (rest list)))))) + +(defvar store) + +(defmethod store-gantt-chart ((clh clarity-handle) data_id chart) + ;;store a single gantt chart + (let ((to-store) + (term-name (first chart)) + (string (second chart))) + (setf to-store (list data_id term-name string)) + (setf store to-store) + (sql:with-transaction + (sql:insert-records :into [|gantt_chart|] + :attributes '([|timecourse_data_id|] [|term_name|] [|sequence|]) + :values to-store + :database (connection clh) + ))) + ) + + + + + + +(defmethod lastid ((clh clarity-handle) &key table) + (cond ((equal table "timecourse_data")(first (first (sql:query + "SELECT MAX(id) FROM timecourse_data;" + :database (connection clh))))) + ((equal table "tree") (first (first (sql:query + "SELECT MAX(id) FROM tree;" + :database (connection clh))))) + + ((equal table "consensus")(first (first (sql:query + "SELECT MAX(id) FROM consensus;" + :database (connection clh))))) + ((equal table "gantt_chart") + (first (first (sql:query + "SELECT MAX(id) FROM gantt_chart;" + :database (connection clh))))) + (t 0);unknown table + )) + + +(defun file-lines (path) + "Sucks up an entire file from PATH into a list of freshly-allocated + strings, returning two values: the list of strings and the number of + lines read." + (with-open-file (s path) + (loop for line = (read-line s nil nil) + while line + collect line into lines + counting t into line-count + finally (return (values lines line-count))))) + + + +(defmethod get-children (node-id) + (let ((children + (first (sql:with-transaction + (sql:select [node_left] [node_right] + :from [|tree|] + :where [= [id] node-id] + :database (connection *current-clarity-handle*) + ))))) + (cond ((and (= (first children) 0) + (= (second children) 0)) + nil) + ((= (first children) 0) + (list (second children))) + ((= (second children) 0) + (list (first children))) + (t children)) + )) + + +(defmethod get-node-terms ((clh clarity-handle) node-id) + ;;node id is TREE id. may be either a consensus seq or real data + (if (get-children node-id) + ;;then it's a consensus + (flatten (get-consensus-terms clh node-id)) + ;;is actual data + (flatten (get-data-terms clh + (first (sql:with-transaction + (sql:select [timecourse_data_id] + :from [|tree|] + :where [= [id] node-id] + :database (connection clh) + :flatp t))))) + ) + ) + +(defmethod get-all-data ((clh clarity-handle)) + (sql:with-transaction + (sql:select [id] [datafile_path] [creation_date] + :from [|timecourse_data|] + :database (connection clh))) + ) + + +#.(sql:disable-sql-reader-syntax) + +;;; end of file -- database-functions.lisp -- Added: decimal-number.lisp ============================================================================== --- (empty file) +++ decimal-number.lisp Wed Aug 16 16:18:39 2006 @@ -0,0 +1,26 @@ +;;Utility from Cliki: the common lisp wiki + +;(use-package "SPLIT-SEQUENCE") + + +(in-package "CLARITY") + +(defun read-string-while (test &optional (stream *standard-input*) (eof-value nil) (recursive-p nil)) + (coerce (loop as x = (peek-char nil stream nil eof-value recursive-p) + while (and (not (equal x eof-value)) (funcall test x)) + collect (read-char stream nil eof-value recursive-p)) 'string)) + +(defun decimal-reader (s c n) (declare (ignore c n)) (parse-decimal (read-string-while #'constituentp s nil t))) + +(defun parse-decimal (str) + (let* ((parts (split-sequence::split-sequence #\. str)) + (a (car parts)) + (b (cadr parts)) + (a1 (parse-integer a)) + (b1 (or (parse-integer (or b "0") :junk-allowed t) 0))) + (+ a1 (/ b1 (expt 10 (length b)))))) + +(defun use-decimal () (set-dispatch-macro-character #\# #\D #'decimal-reader *readtable*)) + + +;;; end of file -- decimal-number.lisp -- \ No newline at end of file Added: doc/html/clarity-package.html ============================================================================== --- (empty file) +++ doc/html/clarity-package.html Wed Aug 16 16:18:39 2006 @@ -0,0 +1,124 @@ + + + CLARITY PACKAGE + + + + + +
+ + + + +
+ CLARITY PACKAGE + + +
+
+
+
+ + + + + + +
+
+ +

Package CLARITY

+ +

Nicknames:

+ +

None

+ +

Uses:

+ +

COMMON-LISP

+ + +

Description:

+ +

This package contains all the symbols (and definitions) of the CLARITY library.

+ +

Affected By:

+ +

None.

+ + +

Exceptional Situations:

+ +

None.

+ + +

See Also:

+ +

None.

+ +

Notes:

+ +

None.

+ + + +
+ + +

News

+ +

News in chronological order, most recent on top. +

+ +
    +
  • 2006-07-24
    + Completed description. +
  • + +
+ + + + + + +
+ Added: doc/html/clarity-schema.png ============================================================================== Binary file. No diff available. Added: doc/html/dictionary.html ============================================================================== --- (empty file) +++ doc/html/dictionary.html Wed Aug 16 16:18:39 2006 @@ -0,0 +1,174 @@ + + + CLARITY Dictionary + + + + + + + + +
+ + + + +
+ CLARITY Dictionary + + +
+
+
+
+ + + + + + + + + + + + + + + + + +
+
+ +

News

+ +

News in chronological order, most recent on top. +

+ +
    +
  • 2006-07-24
    + Page created. +
  • +
+ +
+
+ + + + + + + + + + + + + + + + +
+ Added: doc/html/dictionary/align-charts.html ============================================================================== --- (empty file) +++ doc/html/dictionary/align-charts.html Wed Aug 16 16:18:39 2006 @@ -0,0 +1,157 @@ + + + CLARITY: Standard Generic Function ALIGN-CHARTS + + + + + +
+ + + + +
+ CLARITY: Standard Generic Function ALIGN-CHARTS + + +
+
+
+
+ + + +
+
+ +

Generic function ALIGN-CHARTS

+ +

Package:

+ +

CLARITY

+ +

Syntax:

+ +

+

+  align-charts cl-handle timecourse-id-1 timecourse-id-2
+  
+

+ +

Arguments and Values:

+ +

cl-handle---a cl-handle +

timecourse-id-1---an integer +

timecourse-id-2---an integer + +

Description:

+ +

The generic function align-charts aligns two datasets, given their timecourse data ids. + It takes three parameters, cl-handle, which preserves the session; and timecourse-id-1 and timecourse-id-2, + which are the numerical ids identifying the timecourse datasets in the database. The function returns a hash table + containing alignments hashed by score.

+ + +

Known Methods:

+ +

+

    +
  • +

    +

    +  align-charts (cl-handle clarity-handle) (timecourse-id-1 integer) (timecourse-id-2 integer)
    +  
    +

    + +
  • +
+

+ +

Examples:

+ +

cl-prompt: (clarity:align-charts cl-handle 6 8)
+  

+ +

Affected By:

+ +

None.

+ +

Exceptional Situations:

+ +

None.

+ +

See Also:

+ +

SCORE-PAIR
+ SCORE-PAIR-CONSENSUS
+ ALIGN-TO-CONSENSUS
+ STRING-ALIGNMENT

+ +

Notes:

+ +

None.

+ + + +
+ + +

News

+ +

News in chronological order, most recent on top. +

+ +
    +
  • 2006-07-26
    + Completed description. +
  • + +
+ + + + + + + + +
+ Added: doc/html/dictionary/align-to-consensus.html ============================================================================== --- (empty file) +++ doc/html/dictionary/align-to-consensus.html Wed Aug 16 16:18:39 2006 @@ -0,0 +1,157 @@ + + + CLARITY: Standard Generic Function ALIGN-TO-CONSENSUS + + + + + +
+ + + + +
+ CLARITY: Standard Generic Function ALIGN-TO-CONSENSUS + + +
+
+
+
+ + + +
+
+ +

Generic function ALIGN-TO-CONSENSUS

+ +

Package:

+ +

CLARITY

+ +

Syntax:

+ +

+

+  align-to-consensus cl-handle timecourse-id consensus-id
+  
+

+ +

Arguments and Values:

+ +

cl-handle---a cl-handle +

timecourse-id---an integer +

consensus-id---an integer + +

Description:

+ +

The generic function align-to-consensus aligns a timecourse dataset to a consensus of sequences. + It takes three parameters, cl-handle, which preserves the session; timecourse-id which identifies the timecourse data + and consensus id which is the numerical id identifying the consensus sequences (note that consensus id is interchangeable with + tree id in this case) in the database. The function returns a hash table containing alignments hashed by score.

+ + +

Known Methods:

+ +

+

    +
  • +

    +

    +  align-to-consensus (cl-handle clarity-handle) (timecourse-id integer) (consensus-id integer)
    +  
    +

    + +
  • +
+

+ +

Examples:

+ +

cl-prompt: (clarity:align-to-consensus cl-handle 6 8)
+  

+ +

Affected By:

+ +

None.

+ +

Exceptional Situations:

+ +

None.

+ +

See Also:

+ +

SCORE-PAIR
+ SCORE-PAIR-CONSENSUS
+ ALIGN-CHARTS
+ STRING-ALIGNMENT

+ +

Notes:

+ +

None.

+ + + +
+ + +

News

+ +

News in chronological order, most recent on top. +

+ +
    +
  • 2006-07-26
    + Completed description. +
  • + +
+ + + + + + + + +
+ Added: doc/html/dictionary/alignment-item.html ============================================================================== --- (empty file) +++ doc/html/dictionary/alignment-item.html Wed Aug 16 16:18:39 2006 @@ -0,0 +1,135 @@ + + + CLARITY: Standard Generic Function ALIGNMENT-ITEM + + + + + +
+ + + + +
+ CLARITY: Standard Generic Function ALIGNMENT-ITEM + + +
+
+
+
+ + + +
+
+ +

Standard Class ALIGNMENT-ITEM

+ +

Package:

+ +

CLARITY

+ +

Class Precedence List:

+ +

alignment-item, STRUCTURE-OBJECT, T +

+ +

Slots:

+
    +
  • DATASET-ID accessor alignment-item-dataset-id
  • +
  • CHART-ID accessor alignment-item-chart-id
  • +
  • TERM-NAME accessor alignment-item-term-name
  • +
  • STRING accessor alignment-item-string
  • +
+

Description:

+ +

The alignment-item structure is used to store information for terms about to be aligned. The dataset-id will be either + a timecourse dataset id or a tree node id depending on whether the the node the item belongs to is an internal (consensus) node + or a leaf node. Chart-id is the id of the item in the gantt_chart table. String is the gantt chart as created with the ganttify function.

+ +

The constructor for this class is new-alignment-item. The accessors alignment-item-dataset-id, alignment-item-chart-id + alignment-item-term-name and alignment-item-string can be used to read or write their respective fields.

+ + +

Affected By:

+ +

None.

+ +

Exceptional Situations:

+ +

None.

+ +

See Also:

+ +

ALIGNMENT
+ GANTTIFY

+ +

Notes:

+ +

None.

+ + + +
+ + +

News

+ +

News in chronological order, most recent on top. +

+ +
    +
  • 2006-07-26
    + Completed description. +
  • + +
+ + + + + + + + +
+ Added: doc/html/dictionary/alignment.html ============================================================================== --- (empty file) +++ doc/html/dictionary/alignment.html Wed Aug 16 16:18:39 2006 @@ -0,0 +1,129 @@ + + + CLARITY: Standard Class ALIGNMENT + + + + + +
+ + + + +
+ CLARITY: Standard Class ALIGNMENT + + +
+
+
+
+ + + +
+
+ +

Standard Class ALIGNMENT

+ +

Package:

+ +

CLARITY

+ +

Class Precedence List:

+ +

ALIGNMENT, STRUCTURE-OBJECT, T +

+ +

Slots:

+
    +
  • SCORE accessor alignment-score
  • +
  • ITEMS accessor alignment-items
  • +
+

Description:

+ +

The alignment class stores pairs of instances of the alignment-item class as well as the score of the aligned items. + The constructor for this class is new-alignment. The accessors alignment-score and alignment items can be used to read or write + their respective fields.

+ + +

Affected By:

+ +

None.

+ +

Exceptional Situations:

+ +

None.

+ +

See Also:

+ +

ALIGNMENT-ITEM

+ +

Notes:

+ +

None.

+ + + +
+ + +

News

+ +

News in chronological order, most recent on top. +

+ +
    +
  • 2006-07-26
    + Completed description. +
  • + +
+ + + + + + + + +
+ Added: doc/html/dictionary/build-consensus.html ============================================================================== --- (empty file) +++ doc/html/dictionary/build-consensus.html Wed Aug 16 16:18:39 2006 @@ -0,0 +1,152 @@ + + + CLARITY: Standard Generic Function BUILD-CONSENSUS + + + + + +
+ + + + +
+ CLARITY: Standard Generic Function BUILD-CONSENSUS + + +
+
+
+
+ + + +
+
+ +

Generic function BUILD-CONSENSUS

+ +

Package:

+ +

CLARITY

+ +

Syntax:

+ +

+

+  build-consensus cl-handle data-left data-right
+  
+

+ +

Arguments and Values:

+ +

cl-handle---a clarity-handle +

data-left---an integer +

data-right---an integer + +

Description:

+ +

The generic function build-consensus takes two nodes, computes their consensus sequence, and then stores it in the database. + It takes three parameters, clarity-handle, which identifies the clarity database; data-left, which may be either a timecourse_id + or a consensus id and sdata-right, which is a timecourse id.

+ + +

Known Methods:

+ +

+

    +
  • +

    +

    +  build-consensus (cl-handle clarity-handle) (data-left integer) (data-right integer)
    +  
    +

    + +
  • +
+

+ +

Examples:

+ +

cl-prompt: (clarity:build-consensus cl-handle 7 9)

+ +

Affected By:

+ +

None.

+ +

Exceptional Situations:

+ +

None.

+ +

See Also:

+ +

None.

+ +

Notes:

+ +

None.

+ + + +
+ + +

News

+ +

News in chronological order, most recent on top. +

+ +
    +
  • 2006-07-26
    + Completed description. +
  • + +
+ + + + + + + + +
+ Added: doc/html/dictionary/connect.html ============================================================================== --- (empty file) +++ doc/html/dictionary/connect.html Wed Aug 16 16:18:39 2006 @@ -0,0 +1,173 @@ + + + CLARITY: Standard Generic Function CONNECT + + + + + +
+ + + + +
+ CLARITY: Standard Generic Function CONNECT + + +
+
+
+
+ + + + + + +
+
+ +

Generic function CONNECT

+ +

Package:

+ +

CLARITY

+ +

Syntax:

+ +

+

+  connect db-spec
+  => database-connection
+  
+

+ +

Arguments and Values:

+ +

db spec---a string +

(optional) connection--- a string + + +

Description:

+ +

The generic function connect sets up a connection to an underlying CLARITY database for the handle. + It takes two parameter, clarity handle, to preserve one's session, and db-spec + a database connection string.

+ + +

Known Methods:

+ +

+

    +
  • +

    +

    +  connect (clarity-handle-object clarity-handle) (dp-spec string)
    +  => database-connection
    +  
    +

    + +

    +
  • + +
  • +

    +

    +  connect (clarity-handle-object clarity-handle) (dp-spec string))
    +  => database-connection
    +  
    +

    + +

    This uses the method sqlcon in place of a connection string.  In this case, db spec would be the null + string, "".

    +
  • + +
+

+ +

Examples:

+ +

cl-prompt: (clarity:connect myclarityhandle "data source name/user/password")
+#<CLARITY:CLARITY-HANDLE 2061155C> connecting as "data source name/user"
+#<SQL::ODBC-DATABASE "data source name/user" 205F450C>

+ +

Affected By:

+ +

None.

+ +

Exceptional Situations:

+ +

None.

+ +

See Also:

+ +

None

+ +

Notes:

+ +

None.

+ + + +
+ + +

News

+ +

News in chronological order, most recent on top. +

+ +
    +
  • 2006-07-24
    + Completed description. +
  • + +
+ + + + + + + + +
+ Added: doc/html/dictionary/ganttify.html ============================================================================== --- (empty file) +++ doc/html/dictionary/ganttify.html Wed Aug 16 16:18:39 2006 @@ -0,0 +1,158 @@ + + + CLARITY: Standard Generic Function GANTTIFY + + + + + +
+ + + + +
+ CLARITY: Standard Generic Function GANTTIFY + + +
+
+
+
+ + + + + + +
+
+ +

Generic function GANTTIFY

+ +

Package:

+ +

CLARITY

+ +

Syntax:

+ +

+

+  ganttify clarity-handle filename filedate
+  
+

+ +

Arguments and Values:

+ +

clarity handle---a clarity-handle +

filename--- a string or path +

filedate--- a string + + +

Description:

+ +

The generic function ganttify ganttifys a datafile into the database. It calls the functions ganttify, store-gantt-charts as well as store-numerical-data. + The function then pops up a confirmer, where a user may select to add the data to the tree. + It takes three parameters, clarity handle, to preserve one's session, filename + the location of the data to be ganttifyed and filedate the creation date of the file.

+ + +

Known Methods:

+ +

+

    +
  • +

    +

    +  ganttify (clarity-handle-object clarity-handle) (filename string) (filedate string)
    +  
    +

    + +

    +
  • +
+

+ +

Examples:

+ +

cl-prompt: (clarity:ganttify myclarityhandle "C:/Files/myfile.txt" "MO/DAY/YR")

+ +

Affected By:

+ +

None.

+ +

Exceptional Situations:

+ +

None.

+ +

See Also:

+ +

None

+ +

Notes:

+ +

None.

+ + + +
+ + +

News

+ +

News in chronological order, most recent on top. +

+ +
    +
  • 2006-07-24
    + Completed description. +
  • + +
+ + + + + + + + +
+ Added: doc/html/dictionary/get-all-data.html ============================================================================== --- (empty file) +++ doc/html/dictionary/get-all-data.html Wed Aug 16 16:18:39 2006 @@ -0,0 +1,150 @@ + + + CLARITY: Standard Generic Function GET-ALL-DATA + + + + + +
+ + + + +
+ CLARITY: Standard Generic Function GET-ALL-DATA + + +
+
+
+
+ + + +
+
+ +

Generic function GET-ALL-DATA

+ +

Package:

+ +

CLARITY

+ +

Syntax:

+ +

+

+  get-all-data cl-handle
+  
+

+ +

Arguments and Values:

+ +

cl-handle---a clarity-handle + +

Description:

+ +

The generic function get-all-data gets all of the rows in the timecourse data table of the database. + It takes one parameter, cl-handle, which preserves the session and identifies the database.

+ + +

Known Methods:

+ +

+

    +
  • +

    +

    +  get-all-data (cl-handle clarity-handle)
    +  
    +

    + +
  • +
+

+ +

Examples:

+ +

cl-prompt: (clarity:get-all-data cl-handle)
+

+ +

Affected By:

+ +

None.

+ +

Exceptional Situations:

+ +

None.

+ +

See Also:

+ +

None

+ +

Notes:

+ +

None.

+ + + +
+ + +

News

+ +

News in chronological order, most recent on top. +

+ +
    +
  • 2006-07-26
    + Completed description. +
  • + +
+ + + + + + + + +
+ Added: doc/html/dictionary/get-children.html ============================================================================== --- (empty file) +++ doc/html/dictionary/get-children.html Wed Aug 16 16:18:39 2006 @@ -0,0 +1,152 @@ + + + CLARITY: Standard Generic Function GET-CHILDREN + + + + + +
+ + + + +
+ CLARITY: Standard Generic Function GET-CHILDREN + + +
+
+
+
+ + + +
+
+ +

Generic function GET-CHILDREN

+ +

Package:

+ +

CLARITY

+ +

Syntax:

+ +

+

+  get-children node-id
+  
+

+ +

Arguments and Values:

+ +

node-id---an integer + + +

Description:

+ +

The generic function get-children gets left and right child of node in a phylogenetic tree. + It takes one parameter, node-id, the unique identifier of the node in the tree and returns the + ids of the nodes two children, or nil if it is a leaf node.

+ + +

Known Methods:

+ +

+

    +
  • +

    +

    +  get-children (node-id integer)
    +  
    +

    + +
  • +
+

+ +

Examples:

+ +

cl-prompt: (clarity:get-children 6)
+cl-prompt: (8 12)

+ +

Affected By:

+ +

None.

+ +

Exceptional Situations:

+ +

None.

+ +

See Also:

+ +

None

+ +

Notes:

+ +

None.

+ + + +
+ + +

News

+ +

News in chronological order, most recent on top. +

+ +
    +
  • 2006-07-26
    + Completed description. +
  • + +
+ + + + + + + + +
+ Added: doc/html/dictionary/get-consensus-terms.html ============================================================================== --- (empty file) +++ doc/html/dictionary/get-consensus-terms.html Wed Aug 16 16:18:39 2006 @@ -0,0 +1,155 @@ + + + CLARITY: Standard Generic Function GET-CONSENSUS-TERMS + + + + + +
+ + + + +
+ CLARITY: Standard Generic Function GET-CONSENSUS-TERMS + + +
+
+
+
+ + + +
+
+ +

Generic function GET-CONSENSUS-TERMS

+ +

Package:

+ +

CLARITY

+ +

Syntax:

+ +

+

+  get-consensus-terms cl-handle node-id term-name sequence
+  
+

+ +

Arguments and Values:

+ +

cl-handle---a clarity-handle +

node-id---an integer + + +

Description:

+ +

The generic function get-consensus-terms gets the corresponding consensus terms from the database for a + node in the tree. It takes two parameters, clarity-handle, which identifies the clarity database; and node-id, the + integer id of the tree node for which to find the terms. It returns a list of the ontology terms that are in the + consensus.

+ + +

Known Methods:

+ +

+

    +
  • +

    +

    +  get-consensus-terms (cl-handle clarity-handle) (node-id integer)
    +  
    +

    + +
  • +
+

+ +

Examples:

+ +

cl-prompt: (clarity:get-consensus-terms cl-handle 7)
+cl-prompt: '("Apoptosis" "M phase of mitotic cell cycle" "pathogenesis")

+ +

Affected By:

+ +

None.

+ +

Exceptional Situations:

+ +

None.

+ +

BUILD-CONSENSUS
+ GET-CONSENSUS-TERMS

+ +

None.

+ +

Notes:

+ +

None.

+ + + +
+ + +

News

+ +

News in chronological order, most recent on top. +

+ +
    +
  • 2006-07-26
    + Completed description. +
  • + +
+ + + + + + + + +
+ Added: doc/html/dictionary/get-data-terms.html ============================================================================== --- (empty file) +++ doc/html/dictionary/get-data-terms.html Wed Aug 16 16:18:39 2006 @@ -0,0 +1,154 @@ + + + CLARITY: Standard Generic Function GET-DATA-TERMS + + + + + +
+ + + + +
+ CLARITY: Standard Generic Function GET-DATA-TERMS + + +
+
+
+
+ + + +
+
+ +

Generic function GET-DATA-TERMS

+ +

Package:

+ +

CLARITY

+ +

Syntax:

+ +

+

+  get-data-terms cl-handle node-id term-name sequence
+  
+

+ +

Arguments and Values:

+ +

cl-handle---a clarity-handle +

data-id---an integer + + +

Description:

+ +

The generic function get-data-terms gets the corresponding consensus terms from the database for a + node in the tree. It takes two parameters, clarity-handle, which identifies the clarity database; and data-id, the + integer id of the timecourse dataset for which to find the terms. It returns a list of the ontology terms that are in the + consensus.

+ + +

Known Methods:

+ +

+

    +
  • +

    +

    +  get-data-terms (cl-handle clarity-handle) (data-id integer)
    +  
    +

    + +
  • +
+

+ +

Examples:

+ +

cl-prompt: (clarity:get-data-terms cl-handle 9)
+cl-prompt: '("Apoptosis" "M phase of mitotic cell cycle" "pathogenesis")

+ +

Affected By:

+ +

None.

+ +

Exceptional Situations:

+ +

None.

+ +

None.

+ +

None.

+ +

Notes:

+ +

None.

+ + + +
+ + +

News

+ +

News in chronological order, most recent on top. +

+ +
    +
  • 2006-07-29
    + Completed description. +
  • + +
+ + + + + + + + +
+ Added: doc/html/dictionary/get-node-terms.html ============================================================================== --- (empty file) +++ doc/html/dictionary/get-node-terms.html Wed Aug 16 16:18:39 2006 @@ -0,0 +1,152 @@ + + + CLARITY: Standard Generic Function GET-NODE-TERMS + + + + + +
+ + + + +
+ CLARITY: Standard Generic Function GET-NODE-TERMS + + +
+
+
+
+ + + +
+
+ +

Generic function GET-NODE-TERMS

+ +

Package:

+ +

CLARITY

+ +

Syntax:

+ +

+

+  get-node-terms node-id
+  
+

+ +

Arguments and Values:

+ +

node-id---an integer + +

Description:

+ +

The generic function get-node-terms gets all of the terms associated with a tree node in the phylogenetic tree. + It takes one parameter, node-id, the unique identifier of the node in the tree and returns the + terms associated with the node. These terms will be part of the dataset associated with the node if it is a leaf + or part of the consensus sequence associated with the node if it is internal.

+ + +

Known Methods:

+ +

+

    +
  • +

    +

    +  get-node-terms (node-id integer)
    +  
    +

    + +
  • +
+

+ +

Examples:

+ +

cl-prompt: (clarity:get-node-terms 6)
+cl-prompt: ("cell death" "M phase" "mitotic anaphase A")

+ +

Affected By:

+ +

None.

+ +

Exceptional Situations:

+ +

None.

+ +

See Also:

+ +

None

+ +

Notes:

+ +

None.

+ + + +
+ + +

News

+ +

News in chronological order, most recent on top. +

+ +
    +
  • 2006-07-26
    + Completed description. +
  • + +
+ + + + + + + + +
+ Added: doc/html/dictionary/get-root.html ============================================================================== --- (empty file) +++ doc/html/dictionary/get-root.html Wed Aug 16 16:18:39 2006 @@ -0,0 +1,150 @@ + + + CLARITY: Standard Generic Function GET-ROOT + + + + + +
+ + + + +
+ CLARITY: Standard Generic Function GET-ROOT + + +
+
+
+
+ + + +
+
+ +

Generic function GET-ROOT

+ +

Package:

+ +

CLARITY

+ +

Syntax:

+ +

+

+  get-root cl-handle
+  
+

+ +

Arguments and Values:

+ +

cl-handle---a clarity-handle + +

Description:

+ +

The generic function get-root returns the tree id of the root node in the phylogenetic tree. It takes one parameter, + clarity-handle, which identifies the clarity database.

+ + +

Known Methods:

+ +

+

    +
  • +

    +

    +  get-root (cl-handle clarity-handle)
    +  
    +

    + +
  • +
+

+ +

Examples:

+ +

cl-prompt: (clarity:get-root cl-handle)
+cl-prompt: 8

+ +

Affected By:

+ +

None.

+ +

Exceptional Situations:

+ +

None.

+ +

See Also:

+ +

None.

+ +

Notes:

+ +

None.

+ + + +
+ + +

News

+ +

News in chronological order, most recent on top. +

+ +
    +
  • 2006-07-26
    + Completed description. +
  • + +
+ + + + + + + + +
+ Added: doc/html/dictionary/insert-node.html ============================================================================== --- (empty file) +++ doc/html/dictionary/insert-node.html Wed Aug 16 16:18:39 2006 @@ -0,0 +1,154 @@ + + + CLARITY: Standard Generic Function INSERT-NODE + + + + + +
+ + + + +
+ CLARITY: Standard Generic Function INSERT-NODE + + +
+
+
+
+ + + +
+
+ +

Generic function INSERT-NODE

+ +

Package:

+ +

CLARITY

+ +

Syntax:

+ +

+

+  insert-node cl-handle new-node-id sibling-node-id
+  
+

+ +

Arguments and Values:

+ +

cl-handle---a clarity-handle +

new-node-id---an integer +

sibling-node-id---an integer + +

Description:

+ +

The generic function insert-node inserts a new node as the sibling of the specified node in the phylogenetic tree. + It creates a parent node for the specified nodes and inserts it in the appropriate place. The function takes three parameters, + clarity-handle, which identifies the clarity database; new-node, which is the integer id of the new node in the tree table + of the database and sibling-node-id, which is the id of the node to which the new node is most similar and the node + which will be its sibling in the phylogenetic tree.

+ + +

Known Methods:

+ +

+

    +
  • +

    +

    +  insert-node (cl-handle clarity-handle) (new-node-id integer) (sibling-node-id integer)
    +  
    +

    + +
  • +
+

+ +

Examples:

+ +

cl-prompt: (clarity:insert-node cl-handle 7 9)

+ +

Affected By:

+ +

None.

+ +

Exceptional Situations:

+ +

None.

+ +

See Also:

+ +

None.

+ +

Notes:

+ +

None.

+ + + +
+ + +

News

+ +

News in chronological order, most recent on top. +

+ +
    +
  • 2006-07-26
    + Completed description. +
  • + +
+ + + + + + + + +
+ Added: doc/html/dictionary/insert.html ============================================================================== --- (empty file) +++ doc/html/dictionary/insert.html Wed Aug 16 16:18:39 2006 @@ -0,0 +1,158 @@ + + + CLARITY: Standard Generic Function INSERT + + + + + +
+ + + + +
+ CLARITY: Standard Generic Function INSERT + + +
+
+
+
+ + + + + + +
+
+ +

Generic function INSERT

+ +

Package:

+ +

CLARITY

+ +

Syntax:

+ +

+

+  insert clarity-handle filename filedate
+  
+

+ +

Arguments and Values:

+ +

clarity handle---a clarity-handle +

filename--- a string or path +

filedate--- a string + + +

Description:

+ +

The generic function insert inserts a datafile into the database. It calls the functions ganttify, store-gantt-charts as well as store-numerical-data. + The function then pops up a confirmer, where a user may select to add the data to the tree. + It takes three parameters, clarity handle, to preserve one's session, filename + the location of the data to be inserted and filedate the creation date of the file.

+ + +

Known Methods:

+ +

+

    +
  • +

    +

    +  insert (clarity-handle-object clarity-handle) (filename string) (filedate string)
    +  
    +

    + +

    +
  • +
+

+ +

Examples:

+ +

cl-prompt: (clarity:insert myclarityhandle "C:/Files/myfile.txt" "MO/DAY/YR")

+ +

Affected By:

+ +

None.

+ +

Exceptional Situations:

+ +

None.

+ +

See Also:

+ +

None

+ +

Notes:

+ +

None.

+ + + +
+ + +

News

+ +

News in chronological order, most recent on top. +

+ +
    +
  • 2006-07-24
    + Completed description. +
  • + +
+ + + + + + + + +
+ Added: doc/html/dictionary/lastid.html ============================================================================== --- (empty file) +++ doc/html/dictionary/lastid.html Wed Aug 16 16:18:39 2006 @@ -0,0 +1,152 @@ + + + CLARITY: Standard Generic Function LASTID + + + + + +
+ + + + +
+ CLARITY: Standard Generic Function LASTID + + +
+
+
+
+ + + +
+
+ +

Generic function LASTID

+ +

Package:

+ +

CLARITY

+ +

Syntax:

+ +

+

+  lastid cl-handle table
+  
+

+ +

Arguments and Values:

+ +

cl-handle---a cl-handle +

table---a string + +

Description:

+ +

The generic function lastid returns the value of the more recently created id number for a table. + It takes two parameters, cl-handle, which preserves the session; data-id, which is the numerical id + identifying the timecourse dataset in the database; and table a string that identifies the table.

+ + +

Known Methods:

+ +

+

    +
  • +

    +

    +  lastid (cl-handle clarity-handle) (table string)
    +  
    +

    + +
  • +
+

+ +

Examples:

+ +

cl-prompt: (clarity:lastid cl-handle :table "timecourse_data")
+  

+ +

Affected By:

+ +

None.

+ +

Exceptional Situations:

+ +

None.

+ +

See Also:

+ +

None

+ +

Notes:

+ +

None.

+ + + +
+ + +

News

+ +

News in chronological order, most recent on top. +

+ +
    +
  • 2006-07-26
    + Completed description. +
  • + +
+ + + + + + + + +
+ Added: doc/html/dictionary/needleman-wunsch.html ============================================================================== --- (empty file) +++ doc/html/dictionary/needleman-wunsch.html Wed Aug 16 16:18:39 2006 @@ -0,0 +1,154 @@ + + + CLARITY: Standard Generic Function NEEDLEMAN-WUNSCH + + + + + +
+ + + + +
+ CLARITY: Standard Generic Function NEEDLEMAN-WUNSCH + + +
+
+
+
+ + + +
+
+ +

Generic function NEEDLEMAN-WUNSCH

+ +

Package:

+ +

CLARITY

+ +

Syntax:

+ +

+

+  needleman-wunsch string-1 string-2
+  
+

+ +

Arguments and Values:

+ +

string-1---a string +

string-2---a string + +

Description:

+ +

The generic function needleman-wunsch uses the Needleman Wunsch algorithm to align two strings and then returns their + alignment score. It takes two parameters string-1 and string-2, the strings to be aligned.

+ + +

Known Methods:

+ +

+

    +
  • +

    +

    +  needleman-wunsch (string-1 string) (string-2 string)
    +  
    +

    + +
  • +
+

+ +

Examples:

+ +

cl-prompt: (clarity:needleman-wunsch "UDUUID" "UUDDID")
+  cl-prompt: -2

+ +

Affected By:

+ +

SCORE

+ +

Exceptional Situations:

+ +

None.

+ +

See Also:

+ +

SCORE-PAIR
+ SCORE-PAIR-CONSENSUS
+ ALIGN-CHARTS
+ ALIGN-TO-CONSENSUS

+ +

Notes:

+ +

None.

+ + + +
+ + +

News

+ +

News in chronological order, most recent on top. +

+ +
    +
  • 2006-07-26
    + Completed description. +
  • + +
+ + + + + + + + +
+ Added: doc/html/dictionary/score-pair-consensus.html ============================================================================== --- (empty file) +++ doc/html/dictionary/score-pair-consensus.html Wed Aug 16 16:18:39 2006 @@ -0,0 +1,157 @@ + + + CLARITY: Standard Generic Function SCORE-PAIR-CONSENSUS + + + + + +
+ + + + +
+ CLARITY: Standard Generic Function SCORE-PAIR-CONSENSUS + + +
+
+
+
+ + + +
+
+ +

Generic function SCORE-PAIR-CONSENSUS

+ +

Package:

+ +

CLARITY

+ +

Syntax:

+ +

+

+  score-pair-consensus cl-handle timecourse-id consensus-id
+  
+

+ +

Arguments and Values:

+ +

cl-handle---a cl-handle +

timecourse-id---an integer +

consensus-id---an integer + +

Description:

+ +

Given a time course id and a consensus id (note that the consensus id is equivalent to a tree id), + score-pair-consensus computes their alignment and returns the score. + It takes three parameters, cl-handle, which preserves the session; timecourse-id which identifies the timecourse + dataset and consensus id which identifies the consensus sequence in the database.

+ + +

Known Methods:

+ +

+

    +
  • +

    +

    +  score-pair-consensus (cl-handle clarity-handle) (timecourse-id integer) (consensus-id integer)
    +  
    +

    + +
  • +
+

+ +

Examples:

+ +

cl-prompt: (clarity:score-pair-consensus cl-handle 6 8)
+  cl-prompt: 12

+ +

Affected By:

+ +

None.

+ +

Exceptional Situations:

+ +

None.

+ +

See Also:

+ +

ALIGN-CHARTS
+ SCORE-PAIR
+ ALIGN-TO-CONSENSUS
+ STRING-ALIGNMENT

+ +

Notes:

+ +

None.

+ + + +
+ + +

News

+ +

News in chronological order, most recent on top. +

+ +
    +
  • 2006-07-26
    + Completed description. +
  • + +
+ + + + + + + + +
+ Added: doc/html/dictionary/score-pair.html ============================================================================== --- (empty file) +++ doc/html/dictionary/score-pair.html Wed Aug 16 16:18:39 2006 @@ -0,0 +1,156 @@ + + + CLARITY: Standard Generic Function SCORE-PAIR + + + + + +
+ + + + +
+ CLARITY: Standard Generic Function SCORE-PAIR + + +
+
+
+
+ + + +
+
+ +

Generic function SCORE-PAIR

+ +

Package:

+ +

CLARITY

+ +

Syntax:

+ +

+

+  score-pair cl-handle timecourse-id-1 timecourse-id-2
+  
+

+ +

Arguments and Values:

+ +

cl-handle---a cl-handle +

timecourse-id-1---an integer +

timecourse-id-2---an integer + +

Description:

+ +

Given two timecourse data ids, score-pair computes their alignment and returns the score. + It takes three parameters, cl-handle, which preserves the session; and timecourse-id-1 and timecourse-id-2, + which are the numerical ids identifying the timecourse datasets in the database.

+ + +

Known Methods:

+ +

+

    +
  • +

    +

    +  score-pair (cl-handle clarity-handle) (timecourse-id-1 integer) (timecourse-id-2 integer)
    +  
    +

    + +
  • +
+

+ +

Examples:

+ +

cl-prompt: (clarity:score-pair cl-handle 6 8)
+  cl-prompt: 12

+ +

Affected By:

+ +

None.

+ +

Exceptional Situations:

+ +

None.

+ +

See Also:

+ +

ALIGN-CHARTS
+ SCORE-PAIR-CONSENSUS
+ ALIGN-TO-CONSENSUS
+ STRING-ALIGNMENT

+ +

Notes:

+ +

None.

+ + + +
+ + +

News

+ +

News in chronological order, most recent on top. +

+ +
    +
  • 2006-07-26
    + Completed description. +
  • + +
+ + + + + + + + +
+ Added: doc/html/dictionary/score.html ============================================================================== --- (empty file) +++ doc/html/dictionary/score.html Wed Aug 16 16:18:39 2006 @@ -0,0 +1,151 @@ + + + CLARITY: Standard Generic Function SCORE + + + + + +
+ + + + +
+ CLARITY: Standard Generic Function SCORE + + +
+
+
+
+ + + +
+
+ +

Generic function SCORE

+ +

Package:

+ +

CLARITY

+ +

Syntax:

+ +

+

+  score char1 char2
+  
+

+ +

Arguments and Values:

+ +

char-1---a character +

char-2---a character + +

Description:

+ +

The generic function score is used to compute the score of two characters during alignment using the string-alignment + function. It takes two parameters char-1 and char-2, the characters being scored.

+ + +

Known Methods:

+ +

+

    +
  • +

    +

    +  score (char-1 character) (char-2 character)
    +  
    +

    + +
  • +
+

+ +

Examples:

+ +

cl-prompt: (clarity:score #\D #\I)
+cl-prompt: -1

+ +

Affected By:

+ +

None.

+ +

Exceptional Situations:

+ +

None.

+ +

See Also:

+ +

STRING-ALIGNMENT

+ +

Notes:

+ +

This is the function that should be edited if you would like to alter the scoring.

+ + + +
+ + +

News

+ +

News in chronological order, most recent on top. +

+ +
    +
  • 2006-07-26
    + Completed description. +
  • + +
+ + + + + + + + +
+ Added: doc/html/dictionary/store-consensus-sequence.html ============================================================================== --- (empty file) +++ doc/html/dictionary/store-consensus-sequence.html Wed Aug 16 16:18:39 2006 @@ -0,0 +1,158 @@ + + + CLARITY: Standard Generic Function STORE-CONSENSUS-SEQUENCE + + + + + +
+ + + + +
+ CLARITY: Standard Generic Function STORE-CONSENSUS-SEQUENCE + + +
+
+
+
+ + + +
+
+ +

Generic function STORE-CONSENSUS-SEQUENCE

+ +

Package:

+ +

CLARITY

+ +

Syntax:

+ +

+

+  store-consensus-sequence cl-handle node-id term-name sequence
+  
+

+ +

Arguments and Values:

+ +

cl-handle---a clarity-handle +

node-id---an integer +

term-name---a string +

sequence---a string + + +

Description:

+ +

The generic function store-consensus-sequence stores a consensus sequence and its identifying information + in the database. It takes four parameters, clarity-handle, which identifies the clarity database; node-id, the + integer id of the tree node the consensus sequence belongs to; term name, and sequence which is a gantt chart + sequence.

+ + +

Known Methods:

+ +

+

    +
  • +

    +

    +  store-consensus-sequence (cl-handle clarity-handle) (node-id integer) (term-name string)
    +  (sequence string)
    +  
    +

    + +
  • +
+

+ +

Examples:

+ +

cl-prompt: (clarity:store-consensus-sequence cl-handle 7 "apoptosis" "UDDIDN")

+ +

Affected By:

+ +

None.

+ +

Exceptional Situations:

+ +

None.

+ +

GANTTIFY
+ BUILD-CONSENSUS
+ GET-CONSENSUS-TERMS

+ +

None.

+ +

Notes:

+ +

None.

+ + + +
+ + +

News

+ +

News in chronological order, most recent on top. +

+ +
    +
  • 2006-07-26
    + Completed description. +
  • + +
+ + + + + + + + +
+ Added: doc/html/dictionary/store-gantt-chart.html ============================================================================== --- (empty file) +++ doc/html/dictionary/store-gantt-chart.html Wed Aug 16 16:18:39 2006 @@ -0,0 +1,153 @@ + + + CLARITY: Standard Generic Function STORE-GANTT-CHART + + + + + +
+ + + + +
+ CLARITY: Standard Generic Function STORE-GANTT-CHART + + +
+
+
+
+ + + +
+
+ +

Generic function STORE-GANTT-CHART

+ +

Package:

+ +

CLARITY

+ +

Syntax:

+ +

+

+  store-gantt-chart cl-handle data-id file
+  
+

+ +

Arguments and Values:

+ +

cl-handle---a cl-handle +

data-id---an integer +

chart---a list + +

Description:

+ +

The generic function store-gantt-chart stores a single gantt chart and term associated with a dataset in the database. + It takes three parameters, cl-handle, which preserves the session; data-id, which is the numerical id + identifying the timecourse dataset in the database; and a list of the term and its associated gantt chart.

+ + +

Known Methods:

+ +

+

    +
  • +

    +

    +  store-gantt-chart (cl-handle clarity-handle) (data-id integer) (chart list)
    +  
    +

    + +
  • +
+

+ +

Examples:

+ +

cl-prompt: (clarity:store-gantt-chart cl-handle 6 '("apoptosis" "UUDDUUNN"))
+  

+ +

Affected By:

+ +

None.

+ +

Exceptional Situations:

+ +

None.

+ +

See Also:

+ +

None

+ +

Notes:

+ +

None.

+ + + +
+ + +

News

+ +

News in chronological order, most recent on top. +

+ +
    +
  • 2006-07-26
    + Completed description. +
  • + +
+ + + + + + + + +
+ Added: doc/html/dictionary/store-gantt-charts.html ============================================================================== --- (empty file) +++ doc/html/dictionary/store-gantt-charts.html Wed Aug 16 16:18:39 2006 @@ -0,0 +1,153 @@ + + + CLARITY: Standard Generic Function STORE-GANTT-CHARTS + + + + + +
+ + + + +
+ CLARITY: Standard Generic Function STORE-GANTT-CHARTS + + +
+
+
+
+ + + +
+
+ +

Generic function STORE-GANTT-CHARTS

+ +

Package:

+ +

CLARITY

+ +

Syntax:

+ +

+

+  store-gantt-charts cl-handle data-id chart-list
+  
+

+ +

Arguments and Values:

+ +

cl-handle---a cl-handle +

data-id---an integer +

chart-list---a list + +

Description:

+ +

The generic function store-gantt-charts takes a list of gantt charts and stores them in the database. + It takes three parameters, cl-handle, which preserves the session; data-id, which is the numerical id + identifying the timecourse dataset in the database; and a list of gantt charts created with the ganttify function.

+ + +

Known Methods:

+ +

+

    +
  • +

    +

    +  store-gantt-charts (cl-handle clarity-handle) (data-id integer) (chart-list list)
    +  
    +

    + +
  • +
+

+ +

Examples:

+ +

cl-prompt: (clarity:store-gantt-charts cl-handle 6 '(("cell cycle" "UDUDU") ("apoptosis" "DDUUU")))
+  

+ +

Affected By:

+ +

None.

+ +

Exceptional Situations:

+ +

None.

+ +

See Also:

+ +

GANTTIFY

+ +

Notes:

+ +

None.

+ + + +
+ + +

News

+ +

News in chronological order, most recent on top. +

+ +
    +
  • 2006-07-26
    + Completed description. +
  • + +
+ + + + + + + + +
+ Added: doc/html/dictionary/store-numerical-data.html ============================================================================== --- (empty file) +++ doc/html/dictionary/store-numerical-data.html Wed Aug 16 16:18:39 2006 @@ -0,0 +1,153 @@ + + + CLARITY: Standard Generic Function STORE-NUMERICAL-DATA + + + + + +
+ + + + +
+ CLARITY: Standard Generic Function STORE-NUMERICAL-DATA + + +
+
+
+
+ + + +
+
+ +

Generic function STORE-NUMERICAL-DATA

+ +

Package:

+ +

CLARITY

+ +

Syntax:

+ +

+

+  store-numerical-data cl-handle data-id file
+  
+

+ +

Arguments and Values:

+ +

cl-handle---a cl-handle +

data-id---an integer +

file---a path to a file + +

Description:

+ +

The generic function store-numerical-data takes a file containing a numerical timecourse dataset and stores it in the database. + It takes three parameters, cl-handle, which preserves the session; data-id, which is the numerical id + identifying the timecourse dataset in the database; and a path to the file to insert.

+ + +

Known Methods:

+ +

+

    +
  • +

    +

    +  store-numerical-data (cl-handle clarity-handle) (data-id integer) (file path)
    +  
    +

    + +
  • +
+

+ +

Examples:

+ +

cl-prompt: (clarity:store-numerical-data cl-handle 6 "C:/data/dataset.txt")
+  

+ +

Affected By:

+ +

None.

+ +

Exceptional Situations:

+ +

None.

+ +

See Also:

+ +

None

+ +

Notes:

+ +

None.

+ + + +
+ + +

News

+ +

News in chronological order, most recent on top. +

+ +
    +
  • 2006-07-26
    + Completed description. +
  • + +
+ + + + + + + + +
+ Added: doc/html/dictionary/string-alignment.html ============================================================================== --- (empty file) +++ doc/html/dictionary/string-alignment.html Wed Aug 16 16:18:39 2006 @@ -0,0 +1,154 @@ + + + CLARITY: Standard Generic Function STRING-ALIGNMENT + + + + + +
+ + + + +
+ CLARITY: Standard Generic Function STRING-ALIGNMENT + + +
+
+
+
+ + + +
+
+ +

Generic function STRING-ALIGNMENT

+ +

Package:

+ +

CLARITY

+ +

Syntax:

+ +

+

+  string-alignment string-1 string-2
+  
+

+ +

Arguments and Values:

+ +

string-1---a string +

string-2---a string + +

Description:

+ +

The generic function string-alignment uses a variant of the Needleman-Wunsch and Smith-Waterman algorithms to align two strings and then returns their + alignment score. It takes two parameters string-1 and string-2, the strings to be aligned.

+ + +

Known Methods:

+ +

+

    +
  • +

    +

    +  string-alignment (string-1 string) (string-2 string)
    +  
    +

    + +
  • +
+

+ +

Examples:

+ +

cl-prompt: (clarity:string-alignment "UDUUID" "UUDDID")
+  cl-prompt: -2

+ +

Affected By:

+ +

SCORE

+ +

Exceptional Situations:

+ +

None.

+ +

See Also:

+ +

SCORE-PAIR
+ SCORE-PAIR-CONSENSUS
+ ALIGN-CHARTS
+ ALIGN-TO-CONSENSUS

+ +

Notes:

+ +

None.

+ + + +
+ + +

News

+ +

News in chronological order, most recent on top. +

+ +
    +
  • 2006-07-26
    + Completed description. +
  • + +
+ + + + + + + + +
+ Added: doc/html/dictionary/tree-insert-recursive.html ============================================================================== --- (empty file) +++ doc/html/dictionary/tree-insert-recursive.html Wed Aug 16 16:18:39 2006 @@ -0,0 +1,154 @@ + + + CLARITY: Standard Generic Function TREE-INSERT-RECURSIVE + + + + + +
+ + + + +
+ CLARITY: Standard Generic Function TREE-INSERT-RECURSIVE + + +
+
+
+
+ + + +
+
+ +

Generic function TREE-INSERT-RECURSIVE

+ +

Package:

+ +

CLARITY

+ +

Syntax:

+ +

+

+  tree-insert-recursive cl-handle new-node current-node
+  
+

+ +

Arguments and Values:

+ +

cl-handle---a clarity-handle +

new-node---an integer +

current-node---an integer + +

Description:

+ +

The generic function tree-insert-recursive inserts new data into the phylogenetic tree. It takes three parameters, + clarity-handle, which identifies the clarity database; new-node, which is the integer id of the new node in the tree table + of the database and current-node, which is the id of the current node to which the new node is being aligned. It returns two + values, the number of the node to which the alignment score was highest, as well as that score.

+ + +

Known Methods:

+ +

+

    +
  • +

    +

    +  tree-insert-recursive (cl-handle clarity-handle) (new-node integer) (current-node integer)
    +  
    +

    + +
  • +
+

+ +

Examples:

+ +

cl-prompt: (clarity:tree-insert-recursive cl-handle 7 9)
+  cl-prompt: 7 42

+ +

Affected By:

+ +

None.

+ +

Exceptional Situations:

+ +

None.

+ +

See Also:

+ +

TREE-INSERT

+ +

Notes:

+ +

None.

+ + + +
+ + +

News

+ +

News in chronological order, most recent on top. +

+ +
    +
  • 2006-07-26
    + Completed description. +
  • + +
+ + + + + + + + +
+ Added: doc/html/dictionary/tree-insert.html ============================================================================== --- (empty file) +++ doc/html/dictionary/tree-insert.html Wed Aug 16 16:18:39 2006 @@ -0,0 +1,151 @@ + + + CLARITY: Standard Generic Function TREE-INSERT + + + + + +
+ + + + +
+ CLARITY: Standard Generic Function TREE-INSERT + + +
+
+
+
+ + + +
+
+ +

Generic function TREE-INSERT

+ +

Package:

+ +

CLARITY

+ +

Syntax:

+ +

+

+  tree-insert cl-handle timecourse-data-id
+  
+

+ +

Arguments and Values:

+ +

cl-handle---a clarity-handle +

timecourse-data-id---an integer + +

Description:

+ +

The generic function tree-insert inserts new data into the phylogenetic tree. It takes two parameters, + clarity-handle, which identifies the clarity database; and timecourse-data-id, the id of the new data to be inserted. + It calls the recursive function tree-insert-recursive after creating a new tree node for the data.

+ + +

Known Methods:

+ +

+

    +
  • +

    +

    +  tree-insert (cl-handle clarity-handle) (timecourse-data-id integer)
    +  
    +

    + +
  • +
+

+ +

Examples:

+ +

cl-prompt: (clarity:tree-insert cl-handle 7)

+ +

Affected By:

+ +

None.

+ +

Exceptional Situations:

+ +

None.

+ +

See Also:

+ +

TREE-INSERT-RECURSIVE

+ +

Notes:

+ +

None.

+ + + +
+ + +

News

+ +

News in chronological order, most recent on top. +

+ +
    +
  • 2006-07-26
    + Completed description. +
  • + +
+ + + + + + + + +
+ Added: doc/html/downloads.html ============================================================================== --- (empty file) +++ doc/html/downloads.html Wed Aug 16 16:18:39 2006 @@ -0,0 +1,157 @@ + + + CLARITY Download Page + + + + + + + + +
+ + + + +
+ CLARITY + + +
+
+
+
+ + + + + + +
+
+ +

CLARITY Download Page

+ +
+ +

+ DISCLAIMER: The code associated to these documents is not + completely tested and it is bound to contain errors and omissions. + This documentation may contain errors and omissions as well.

+ +

The file COPYING contains an LGPL license. You + are advised to use the code at your own risk. No warranty + whatsoever is provided, the author will not be held responsible for + any effect generated by your use of the library, and you can put + here the scarier extra disclaimer you can think of. +

+
+
+ + +

Download and CVS Repository

+ +

The CVS repository is here. + You can download a tarball directly from there.

+ + + + + + +
+

Questions? Queries? Suggestions? Comments? Please direct them + at me. +

+ +
+
+ + + + + + + + + + +
+
+ +

News

+ +

News in chronological order, most recent on top. +

+ +
    +
  • 2006-07-24
    + Page created. +
  • +
+ +
+
+ + + + + + + + + + + + + + + + +
+ Added: doc/html/gui.html ============================================================================== --- (empty file) +++ doc/html/gui.html Wed Aug 16 16:18:39 2006 @@ -0,0 +1,129 @@ + + + + CLARITY GUI + + + + + + + + + + + +
+
+ CLARITY GUI + +
+ placeholder
+
+
+ placeholder
+ +
+ + + + +
+ +
+ +

CLARITY GUI

+ +

About the GUI

+ +

The CLARITY GUI allows users to insert data into the databse, browse the database, and view the phylogenetic-like tree. + Users may view similarities between datasets at various levels of resolution. +

+

CL-GODB Screenshot

+

Screenshot of the CLARITY GUI

+

Interface Overview

+ + +

1. Phylogenetic Tree View

+

The area below the "Phylogeny" tab is where the tree of data is displayed. A 0 indicates an internal node, which contains a collection of + consensus terms. Nodes with numerical values are labelled with the id number of the dataset with which they are associated. Clicking on an + internal node will display information in regions 2 and 3 of the above diagram. Clicking on a leaf node will display information in the leaf + node tab, which can be selected by clicking.

+

2. Left and Right Information

+

These panels, displayed as tree views, contain the terms that are either not in the intersection of the two children of the selected node, + or those which are regulated differently. Clicking on each term in these panels will expand the tree and display a number of windows with colored + icons. The icons represent the terms overall regulation, or activity, in that window of time. Green denotes a term which is down regulated, + red denotes up regulation, and yellow denotes neither. If there is a plus sign next to the window's icon, it means that probe, or gene, information + was provided with the data. Clicking on these icons displays the list of genes.

+

3. Consensus Information

+

Selecting an internal node fills this list panel. It contains the highly similarly regulated terms of the selected node's two + immediate children.

+ + + +
+

Questions? Queries? Suggestions? Comments? Please direct them + at me. +

+ + +

News

+ +

News in chronological order, most recent on top. +

+ +
    +
  • 2006-08-16
    + Updated description. +
  • +
+ +
+
+ + + + +
+ + + + \ No newline at end of file Added: doc/html/images/Thumbs.db ============================================================================== Binary file. No diff available. Added: doc/html/images/interface2.jpg ============================================================================== Binary file. No diff available. Added: doc/html/images/phylogeny-1-smaller.jpg ============================================================================== Binary file. No diff available. Added: doc/html/images/phylogeny-1.jpg ============================================================================== Binary file. No diff available. Added: doc/html/images/phylogeny-2-smaller.jpg ============================================================================== Binary file. No diff available. Added: doc/html/images/phylogeny-2.jpg ============================================================================== Binary file. No diff available. Added: doc/html/images/phylogeny-3.jpg ============================================================================== Binary file. No diff available. Added: doc/html/images/shim.gif ============================================================================== Binary file. No diff available. Added: doc/html/index.html ============================================================================== --- (empty file) +++ doc/html/index.html Wed Aug 16 16:18:39 2006 @@ -0,0 +1,164 @@ + + + + CLARITY + + + + + + + + + + + +
+
+ CLARITY + +
+ placeholder
+
+
+ placeholder
+ +
+ + + + + + +
+ + + +
+ +

CLARITY: A Common Lisp Data Alignment Repository

+ + +

CLARITY is a tool and method for the storage and comparison of data with numeric and + set membership components.  It is specifically geared toward timecourse microarray data, which is used to + study the activity of genes across time. By using data that has been redescribed into Gene Ontology (GO) terms, and summarizing the regulation + of these terms across time using characters (together forming sequences) we are able to use standard DNA alignment techniques with + these sequences. Due to the prevalence and size of microarray experiments, finding a way to analyze new experiments as well as consider their relation + to prior work is a significant contribution. CLARITY aims to help researchers update their prior findings as new data becomes available, and + to automate this process. Contained in the software is a novel method of comparison, based on Gantt charts, which allows us to reason about + numerical data in a way that we do DNA sequences. I.e. Rather than just looking at the numbers describing one gene across time as compared to another, + we can consider insertions, deletions, mutations in these sequences of numbers. This is done efficiently using a global alignment + with an affine (linear) gap score, a variant of the Needleman-Wunsch and Smith-Waterman algorithms + + +

+ The Gene Ontology (GO), is a controlled vocabulary used to aid the description of genes and gene product attributes in a variety of + organisms. There are three different ontologies that describe molecular functions, biological processes, and cellular components.

+ +

Features

+

CLARITY provides novel methods for computing and visualizing the relationship among large amounts of data. The graphical + interface allows the user to browse the database contents in text form as well as see the data arranged into a phylogenetic tree. + + There is more information on this interface here +

Screenshot of the phylogeny interface +

+ +

The CLARITY Dictionary

+ +

The CLARITY + dictionary contains all the definitions comprising the library. + + +

Acknowledgments

+ +

This project was sponsored by the Google Summer of Code + program. The Lisp NYC group + provided moral guidance and support. The NYU Courant + Bioinformatics Group provided all the rest.

+ + +

Site Map

+ + +

None yet.

+ + + +
+

Questions? Queries? Suggestions? Comments? Please direct them + at me. +

+ + +

News

+ +

News in chronological order, most recent on top. +

+ +
    +
  • 2006-06-9
    + Started the site. +
  • +
+ +
+
+ + + + +
+ + + + \ No newline at end of file Added: doc/html/installation.html ============================================================================== --- (empty file) +++ doc/html/installation.html Wed Aug 16 16:18:39 2006 @@ -0,0 +1,234 @@ + + + CLARITY Installation + + + + + + + + +
+ + + + +
+ CLARITY Installation + + +
+
+
+
+ + + + + +
+
+ +

Installing the CLARITY library

+ +

Requirements

+

-MySQL
+ -Lispworks
+ -Common SQL + +

Installation Steps

+

If you don't have mySQL installed, go to the MySQL Downloads + page and follow their instructions. (Note: you probably want the "Community Edition - Generally Available (GA) Release") + + + +

Install CLARITY for Windows:

+

Open the mysql command line interface (this can be done in Cygwin). Enter the root password +that was created during mysql installation. Replace the uppercase +"DATABASE" with the name of your choice, after entering the comand you will have created a database +named clarity with the tables needed for the library.

+
mysql> \. C:/Path-to-clarity/utilities/clarity.sql;
+

Alternatively, you may enter your password and run the creation script in one step:

+
Prompt: mysql -u root -p < C:/Path-to-clarity/utilities/clarity.sql;
+

+The clarity database is now set up and currently empty. +

+

You may close the command line now. Open Microsoft ODBC +Administrator (may be called "Data Sources (ODBC)" in shorcuts). +Click add and then create a new data source using the MySQL ODBC +driver. Choose a name for your Data Source (note: you will be using +this name later +when you connect with clarity), then input the User/Password you +will be using to connect to the database. If the database is on your +computer, you +you can type in "localhost" or leave the server field blank. Now you +should be able to select the database you created earlier in the drop +down menu. + + +

Install CLARITY For Unix:

+

Coming Soon! + +

Install CLARITY For Mac:

+

Coming soon! + +

Load and Compile CLARITY

+

+ Get the CLARITY tarball from the downloads page and unpack it + into a directory where Lispworks will be able to see it. +

+

+You can either use mk:defsystem or compile and load the files in the +following order: clarity-package, decimal-number, database-functions, alignment-functions. In order to +use the gui, go into +gui/impl-dependent/lwcapi and then compile and load the insert-data-interface, clarity-interface, +clarity-interface-functions, clarity-database-setup-interface, and start-gui.

+

Using MK:DEFSYSTEM

+

If you don't already have it, you can download it from the CLOCC Sourceforge page + You can load it as below at the lisp prompt, or you can add that line to your Lisp startup file.

+
cl-prompt: (load "path/to/defsystem.lisp")
+; Loading text file Z:\lisp\defsystem-3.x\defsystem.lisp
+#P"Z:/lisp/defsystem-3.x/defsystem.lisp"
+ +

+If you're not working in the directory where you put the CLARITY +library, you will need to add that path to your registry. Otherwise, +you should +be able to start from "find-system" +

+
cl-prompt: (mk:add-registry-location "/path/to/clarity/")
+cl-prompt: (mk:find-system :clarity)
+System CLARITY not loaded. Shall I try loading it? y
+
+; Loading text file Z:\clarity\clarity.system
+#<DEFSYSTEM: CLARITY>
+
+

+Now just compile and load the system.

+
cl-prompt: (mk:compile-system :clarity)
+
+cl-prompt: (mk:load-system :clarity)
+ +

Getting Started

+ +

+ In the Lispworks Listener, start by creating a handle.
+

cl-prompt: (clarity:make-clarity-handle)
+ Now connect to your database.
+
cl-prompt: (clarity:connect clarity::*current-clarity-handle* "DataSourceName/username/password")
+ +

From here you can call any function in the library, or you can load the GUI with the following command.

+
cl-prompt: (clarity::start-clarity-gui)
+ +

To save your database information for future sessions, Open the clarity-database-setup-interface file and + change the three variables clarity-db-name, clarity-db-user, and clarity-db-password to reflect your setup.

+ + + +

Standalone Version

+ For the standalone graphical interface, you will need the CLARITY database and the CLARITY executable. This option is only available + for those running windows (the database, however can be on either a unix or windows machine). + Follow the steps above for downloading and installing the CLARITY DB, then just start the executable and enter the information for + the database you created. + +

Future Releases

+

In the future the CLARITY may be ported to clsql

+

+ + + + +
+

Questions? Queries? Suggestions? Comments? Please direct them + at me. +

+ +
+
+ + + +
+
+ +

News

+ +

News in chronological order, most recent on top. +

+ +
    +
  • 2006-8-4
    + Page updated. +
  • 2006-07-31
    + Page created. +
  • +
+ +
+
+ + + + + +
+ Added: doc/html/links.html ============================================================================== --- (empty file) +++ doc/html/links.html Wed Aug 16 16:18:39 2006 @@ -0,0 +1,98 @@ + + + CLARITY Links + + + + + + + + +
+
+ CLARITY Links + + +
+
+
+
+ +
+
+ +

CLARITY Links

+ +

The relevant links for the CLARITY project are: +

+ + + +
+

Questions? Queries? Suggestions? Comments? Please direct them + at me. +

+
+
+ +
+
+
+
+ + + +
+ Added: doc/html/style.css ============================================================================== --- (empty file) +++ doc/html/style.css Wed Aug 16 16:18:39 2006 @@ -0,0 +1,349 @@ +/* + * NYU Bioinformatics - Microarray group development + * + * Inspired by www.rhythmbox.org, (c) rhythmbox 2002 + * and http://glish.com/css/ + * + * New code, modifications + * (c) Idan Gazit 2002, and + * (c) Marco Antoniotti, 2003-2004 + * (c) Samantha Kleinberg, 2005-2006 + * NYU Bioinformatics + * Permission is hereby granted to use this style, etc etc etc. + */ + + + + +body +{ + margin:0px 5% 10px 5%; + background: #FFFFFF; + font-family: Verdana, Arial, Helvetica, sans-serif; + font-weight: normal; + color:black; +} + + +#main { + border:2px solid #000000; + background:#FFFFFF; +} + + +#main #menu { + #border-left:0px; + #border-right:1px solid #000; + #border-bottom:1px solid #000; + #border-top:1px solid #000; + float:left; + width:140px; + #background:#EEEEE0; + margin:50px 0px 0px 0px; + padding: 0px 0px 0px 10px; + position: fixed; +} + +#menu p{ +font-size:12px +font-family: Verdana, Arial, Helvetica, sans-serif; +} + + +a.navigation-link-selected +{ + text-decoration: none; + color: #ffffff; + font-weight: normal; + font-style: italic; +} + +a.navigation-link-selected:hover +{ + text-decoration: underline; + color: #ffffff; + font-weight: normal; + font-style: italic; +} + +a.navigation-link +{ + text-decoration: none; + color: #808069; + font-weight: normal; +} + +a.navigation-link:hover +{ + text-decoration: underline; + color: #ffffff; + font-weight: normal; + +} + + +a.menu-link-selected +{ + text-decoration: none; + color: #ffffff; + font-weight: normal; + font-style: italic; +} + +a.menu-link-selected:hover +{ + text-decoration: underline; + color: #ffffff; + font-weight: normal; + font-style: italic; +} + +a.menu-link +{ + text-decoration: none; + color: rgb(100, 100, 100); + font-weight: normal; +} + +a.menu:hover +{ + text-decoration: underline; + color: #ffffff; + font-weight: normal; +} + + +a.return +{ + text-decoration: none; + color: #41286f; + font-size: 8pt; + font-weight: normal; +} + +a +{ + text-decoration: underline; + color: #666600; +} + +a:hover +{ + text-decoration: underline; + color: #68548D; +} + +p +{ + font-family: Verdana, Arial, Helvetica, sans-serif; + font-size: 12px; + color: #000000; + font-weight: normal; +} + +.header +{ + background: #CCCC99; + color: #003300; + height: 40px; + top: 0px; + width: 90%; + right: 5%; + #border: 1px solid #330066; + position: fixed; + font-family: Verdana,Arial,Helvetica; + font-size: 18px; +} + +.navigation +{ + width: 90%; + word-spacing: 5px; + position: relative; + text-align: right; + font-family: Verdana, Arial, Helvetica, sans-serif; + font-size: 12px; + color: #ffffff; + font-weight: normal; + word-spacing: 0px; + } + + + +.sidebar +{ + font-family: Verdana, Arial, Helvetica, sans-serif; + font-size: 12px; + color: #000000; + font-weight: normal; + padding-left: 15px; + padding-right: 5px; + position: fixed; + top: 10ex; + right: 1em; + +} + +.text +{ + font-family: Verdana, Arial, Helvetica, sans-serif; + font-size: 12px; + color: #000000; + font-weight: normal; +} + + + +li +{ + font-family: Verdana, Arial, Helvetica, sans-serif; + font-size: 12px; + color: #000000; + font-weight: normal; +} + + +pre +{ + background: 5px; + background-color: #e0e0e0; +} + + +.label +{ + font-family: Verdana, Arial, Helvetica, sans-serif; + font-size: 12px; + color: #000000; + text-align: center; + font-style: italic; +} + +.command +{ + font-family: Verdana, Arial, Helvetica, sans-serif; + font-size: 12px; + color: #000000; + background: #eae8e3; + font-weight: normal; + margin-bottom: 10px; +} + +.content +{ + background: #ffffff; + margin-top: 40px; + padding: 10px 3% 10px 155px; +} + + + +.toc +{ + font-size: 10px; + background: #ffffff; + padding: 5px; + padding-right: 5px; +} + +.middle-bar +{ + height: 5px; + background: #CC3399; +} + +.black-line +{ + height: 1px; + background: #000000; +} + +.bottom +{ + position: absolute; + right: 5px; + bottom: 5px; +} + +.copyright +{ + font-family:Verdana, Arial, Helvetica, sans-serif; + font-size: 10px; + color: #808080; + font-weight: normal; + padding:5px; + text-align:right; + border-color:#808080; + border-width:0px; + border-style:dotted; + border-top-width:1px; + +} + +.centerblock +{ + font-family:Verdana, Arial, Helvetica, sans-serif; + font-size: 12px; + color: black; + font-weight: normal; +} + + +h1 +{ + font-family:Verdana, Arial, Helvetica, sans-serif; + font-size:18px; + color: #003300; + font-weight:bold; +} + +h2 +{ + font-family:Verdana, Arial, Helvetica, sans-serif; + font-size:16px; + color: #003300; + font-weight:bold; +} + +h3 +{ + font-family:Verdana, Arial, Helvetica, sans-serif; + font-size:14px; + color: #003300; + font-weight:bold; +} + +h4 +{ + font-family:Verdana, Arial, Helvetica, sans-serif; + font-size:12px; + color: #003300; + font-weight:bold; +} + +h5 +{ + font-family:Verdana, Arial, Helvetica, sans-serif; + font-size:10px; + color: #003300; + font-weight:bold; +} + +.captionimg +{ + text-align:right; + font-style: italic; + font-weight: normal; + font-size:10px; + color: #303030; +} + +.indent +{ + padding-left: 50px; +} + +.command +{ + font-family:Courier, serif; +} Added: gui/clarity-database-setup-interface.lisp ============================================================================== --- (empty file) +++ gui/clarity-database-setup-interface.lisp Wed Aug 16 16:18:39 2006 @@ -0,0 +1,212 @@ +;;; -*- Mode: Lisp -*- + +#|CLARITY: Common Lisp Data Alignment Repository +Copyright (c) 2006 Samantha Kleinberg +All rights reserved. + +This library is free software; you can redistribute it and/or modify it under the terms of the GNU +Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the +License, or (at your option) any later version. + +This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser +General Public License for more details. + +You should have received a copy of the GNU Lesser General Public License along with this library; +if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +contact: Samantha AT Bioinformatics DOT nyu DOT edu +715 Broadway, 10th floor +New York, NY 10003|# + +(in-package "CLARITY") + +;;Change these three variables to the appropriate values for your setup. + +(defvar *clarity-db-name* "clarity") +(defvar *clarity-db-user* "CLDB") +(defvar *clarity-db-password* "clear") + +(capi:define-interface clarity-database-setup-interface () + () + (:panes + (notice-pane + capi:display-pane + :text '(;"" + " Please make sure that you can connect to a CLARITY database." + "") + :background :white + :visible-max-width nil) + + (clarity-db-title-pane + capi:title-pane + :text "CLARITY Database Connection" + :font (gp:make-font-description :family "Helvetica" + :size 10 + ;; :weight :bold + ;; :slant :italic + ) + :background :gray30 + :foreground :white + :visible-max-width nil + ) + + (clarity-db-name-pane + capi:text-input-pane + :reader clarity-db-name-pane + :text *clarity-db-name* + :visible-max-width 150) + + (clarity-db-user-pane + capi:text-input-pane + :reader clarity-db-user-pane + :text *clarity-db-user* ; (system:get-user-name) + :visible-max-width 150) + + (clarity-db-password-pane + capi:password-pane + :reader clarity-db-password-pane + :text *clarity-db-password* + :visible-max-width 150) + + + #+win32 + (start-system-data-source-setup-title + capi:title-pane + :text "System Data Source Configuration" + :font (gp:make-font-description :family "Helvetica" + :size 12 + ;; :weight :bold + ;; :slant :italic + ) + :background :gray30 + :foreground :white + :visible-max-width nil + ) + + #+macosx + (start-system-data-source-setup-title + capi:title-pane + :text "System Data Source Configuration" + :font (gp:make-font-description :family #+macosx "helvetica" #-macosx "Helvetica" + :size 10 + ;; :weight :bold + ;; :slant :italic + ) + :background :gray30 + :foreground :white + :visible-max-width nil + ) + + #+win32 + (start-system-data-source-setup-button + capi:push-button + :text "Start Windows ODBC Driver Manager" + :visible-max-width nil + :callback-type :none + :callback 'start-windows-data-source-setup + ) + + #+macosx + (start-system-data-source-setup-button + capi:push-button + :text "Start ODBC Driver Manager" + :visible-max-width nil + :callback-type :none + :callback 'start-macosx-data-source-setup + ) + ) + + + (:layouts + (main-layout + capi:column-layout + '(notice-pane + + clarity-db-title-pane + clarity-db-layout + + #| #+win32 |# start-system-data-source-setup-title + #| #+win32 |# start-system-data-source-setup-button + ) + ) + + (clarity-db-layout + capi:grid-layout + '("Database name" + clarity-db-name-pane + "User" + clarity-db-user-pane + "Password" + clarity-db-password-pane) + :columns 2 + :x-adjust :right + ) + + ) + + + (:default-initargs + :default-x 300 + :default-y 300 + :layout 'main-layout + :title "CLARITY Database Connections" +)) + + + +(defun start-setup-interface () + (flet ((check-fields (setup-pane) + (let ((clarity-db-name + (capi:text-input-pane-text + (clarity-db-name-pane setup-pane))) + (clarity-db-user + (capi:text-input-pane-text + (clarity-db-user-pane setup-pane))) + ) + (and clarity-db-name (string/= clarity-db-name "") + clarity-db-user (string/= clarity-db-user "")) + )) + ) + (multiple-value-bind (setup-pane valid-p) + (capi:popup-confirmer (make-instance 'clarity-database-setup-interface) + "CLARITY Database Connection Setup" + ;; :ok-check #'check-fields + :title "CLARITY" + ) + (when valid-p + (let ((clarity-db-name + (capi:text-input-pane-text + (clarity-db-name-pane setup-pane))) + (clarity-db-user + (capi:text-input-pane-text + (clarity-db-user-pane setup-pane))) + (clarity-db-password + (capi:text-input-pane-text + (clarity-db-password-pane setup-pane))) + ) + (concatenate 'string clarity-db-name "/" clarity-db-user "/" clarity-db-password) + )) + )) + ;(capi:display (make-instance 'clarity-database-setup-interface) + ) +#+win32 +(defun start-windows-data-source-setup () + (handler-case + (system:call-system "C:\\WINDOWS\\system32\\odbcad32.exe") + (error (e) + (declare (ignore e)) + (capi:display-message "Sorry, cannot start the ODBC driver manager."))) + ) + + +#+macosx +(defun start-macosx-data-source-setup () + (handler-case + (system:call-system "/Applications/Utilities/ODBC\\ Administrator.app/Contents/MacOS/ODBC\\ Administrator") + (error (e) + (declare (ignore e)) + (capi:display-message "Sorry, cannot start the ODBC driver manager."))) + ) + + ;;; end of file -- clarity-database-setup-interface.lisp -- Added: gui/clarity-gui.system ============================================================================== --- (empty file) +++ gui/clarity-gui.system Wed Aug 16 16:18:39 2006 @@ -0,0 +1,52 @@ +;;; -*- Mode: Lisp -*- + + +;;; Setting up the logical pathname. + +(eval-when (:load-toplevel :execute) + (setf (logical-pathname-translations "CLARITY") + `(("*.*" ,(make-pathname :name :wild :type :wild + :defaults *load-pathname*)) + ("*.*.*" ,(make-pathname :name :wild :type :wild :version :wild + :defaults *load-pathname*)) + ("**;*.*" ,(merge-pathnames + (make-pathname :directory '(:relative :wild-inferiors) + :name :wild + :type :wild + :version :wild) + *load-pathname* + )) + ("**;*.*.*" ,(merge-pathnames + (make-pathname :directory '(:relative :wild-inferiors) + :name :wild + :type :wild + :version :wild + :version :wild) + *load-pathname* + )) + ))) + + + +;;; Adding registry locations. + +#|(eval-when (:load-toplevel :execute) + (mk:add-registry-location + (merge-pathnames (pathname "gui/") + (make-pathname :name nil :type nil + :defaults *load-pathname*))) + + (mk:add-registry-location (translate-logical-pathname "CLARITY:")))|# + + +(mk:defsystem "CLARITY-GUI" + :components ("clarity-gui-package" + "insert-data-interface" + "clarity-interface" + "clarity-interface-functions" + "start-gui" + "clarity-database-setup-interface" + ) + ) + +;;; end of file -- clarity-gui.system -- Added: gui/clarity-interface-functions.lisp ============================================================================== --- (empty file) +++ gui/clarity-interface-functions.lisp Wed Aug 16 16:18:39 2006 @@ -0,0 +1,261 @@ +;;; -*- Mode: Lisp -*- + +#|CLARITY: Common Lisp Data Alignment Repository +Copyright (c) 2006 Samantha Kleinberg +All rights reserved. + +This library is free software; you can redistribute it and/or modify it under the terms of the GNU +Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the +License, or (at your option) any later version. + +This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser +General Public License for more details. + +You should have received a copy of the GNU Lesser General Public License along with this library; +if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +contact: Samantha AT Bioinformatics DOT nyu DOT edu +715 Broadway, 10th floor +New York, NY 10003|# + +(in-package "CLARITY") + + +(eval-when (:compile-toplevel :load-toplevel :execute) + (require "sql") + (require "odbc")) + + +#.(sql:enable-sql-reader-syntax) + + +(defconstant *up* 0) +(defconstant *down* 1) +(defconstant *neutral* 2) +(defconstant *inactive* 3) + +(defclass phylogeny-item() + ((tree-id :accessor phylogeny-tree-id :initarg :phylogeny-tree-id) + (data-id :accessor phylogeny-data-id :initarg :phylogeny-data-id)) + ) + +(defclass phylogeny-term() + ((term-name :accessor term-name :initarg :term-name) + (data-id :accessor data-id :initarg :data-id) + )) + +(defclass phylogeny-window() + ((term :accessor phylogeny-window-term :initarg :phylogeny-window-term) + (window-start :accessor phylogeny-window-start :initarg :phylogeny-window-start) + (window-end :accessor phylogeny-window-end :initarg :phylogeny-window-end) + (regulation :accessor phylogeny-window-reg :initarg :phylogeny-window-reg) + )) + +(defclass phylogeny-associations() + () + ) + + +(defmethod insert-file-popup ((interface clarity-interface)) + (let ((idi (make-instance 'insert-data-interface))) + (when (capi:display-dialog idi) + (cond ((eq t (capi:button-enabled + (probe-check-box idi))) + (insert-with-probes (clarity-handle interface) + (file-location idi) + (capi:text-input-pane-text (file-date-input idi)))) + (t (insert (clarity-handle interface) + (file-location idi) + (capi:text-input-pane-text (file-date-input idi))))) + ) + )) + + +(defmethod get-filename ((interface insert-data-interface)) + (let ((file (capi:prompt-for-file "Select data file to insert."))) + (setf (file-location interface) file) + + (capi:apply-in-pane-process + (file-location-pane interface) + #'(setf capi:display-pane-text) + (print-partial-filename file) (file-location-pane interface)) + ) + ) + +(defmethod get-phylogeny-root ((clh clarity-handle)) + (let ((root (get-root clh))) + (make-instance 'phylogeny-item + :phylogeny-tree-id root + :phylogeny-data-id (first (sql:with-transaction + (sql:select [|timecourse_data_id|] + :from [|tree|] + :where [= [id] root] + :database (connection clh) + :flatp t + ))) + ))) + +(defmethod get-phylogeny-children ((node phylogeny-item)) + (let ((children (get-children (phylogeny-tree-id node)))) + (if children + (loop for c in children + collecting (make-instance 'phylogeny-item + :phylogeny-tree-id c + :phylogeny-data-id (first (sql:with-transaction + (sql:select [|timecourse_data_id|] + :from [|tree|] + :where [= [id] c] + :database (connection *current-clarity-handle*) + :flatp t + ))))) + nil + ))) + +(defmethod make-phylogeny-terms-roots ((clh clarity-handle) node-id term-list) + (let ((timecourse-id (first (sql:with-transaction + (sql:select [|timecourse_data_id|] + :from [|tree|] + :where [= [id] node-id] + :database (connection clh) + :flatp t)))) + ) + ;;is consensus + (loop for term in term-list + collecting (make-instance 'phylogeny-term + :term-name term + :data-id timecourse-id))) + ) + + +(defmethod get-phylogeny-terms-children (tree-node) + (cond ((typep tree-node 'phylogeny-term) + (loop for (start end num) in (sql:select [|window_start|] [|window_end|] [|data|] + :from [|numerical_data|] + :where [and [= [|timecourse_data_id|] (data-id tree-node)] + [= [|term_name|] (term-name tree-node)]] + :database (connection *current-clarity-handle*) + :distinct t + ) + collecting (make-instance 'phylogeny-window + :phylogeny-window-term tree-node + :phylogeny-window-start start + :phylogeny-window-end end + :phylogeny-window-reg (cond ((> num 0) *up*) + ((< num 0) *down*) + ((= num 0) *neutral*) + (t *inactive*)) + ))) + ((typep tree-node 'phylogeny-window) + (split-sequence:split-sequence #\Space (first (sql:with-transaction + (sql:select [|probe_ids|] + :from [|numerical_data|] + :where [and [= [term_name] (term-name (phylogeny-window-term tree-node))] + [= [window_start] (phylogeny-window-start tree-node)] + [= [window_end] (phylogeny-window-end tree-node)] + [= [timecourse_data_id] + (data-id (phylogeny-window-term tree-node))]] + :database (connection *current-clarity-handle*) + :flatp t))) + :remove-empty-subseqs t)) + (t nil) + )) + +(defmethod phylogeny-window-icon (node) + (cond ((typep node 'phylogeny-window) + (phylogeny-window-reg node)) + (t 4)) + ) + +(defmethod phylogeny-terms-print-function (node) + (cond ((typep node 'phylogeny-term) + (term-name node)) + ((typep node 'phylogeny-window) + (format nil "Window ~a-~a" (phylogeny-window-start node) (phylogeny-window-end node)) + ) + (t node) + ) + ) + +(defmethod database-switch-callback (data (interface clarity-interface)) + (cond ((equal data "View all entries") + (setf (capi:collection-items + (database-all-entries interface)) (get-all-data (clarity-handle interface))) + (capi:apply-in-pane-process + (database-switchable interface) + #'(setf capi:switchable-layout-visible-child) + (database-all-entries interface) (database-switchable interface)) + ) + + ((equal data "Search entries") + (capi:apply-in-pane-process + (database-switchable interface) + #'(setf capi:switchable-layout-visible-child) + (database-single-entry interface) (database-switchable interface))) + )) + +;;should store nodes locally as in cl-godb, will fix this later +(defmethod phylogeny-select-callback ((item phylogeny-item) interface) + (let* ((node-id (phylogeny-tree-id item)) + (children (get-children node-id))) + (if children + ;;is internal node + (let ((consensus (get-node-terms (clarity-handle interface) node-id))) + (setf (capi:collection-items + (consensus-detail interface)) + consensus) + + (setf (capi:tree-view-roots (left-child-detail interface)) + (make-phylogeny-terms-roots (clarity-handle interface) + (first children) + (set-difference (get-node-terms (clarity-handle interface) + (first children)) + consensus + :test #'equal))) + (setf (capi:tree-view-roots (right-child-detail interface)) + (make-phylogeny-terms-roots (clarity-handle interface) + (second children) + (set-difference (get-node-terms (clarity-handle interface) + (second children)) + consensus + :test #'equal)))) + ;;is leaf + (leaf-callback node-id interface) + + ))) + +(defmethod leaf-callback (node-id interface) + (setf (capi:collection-items + (leaf-terms interface)) + (flatten (get-node-terms (clarity-handle interface) node-id))) + (clear-node-data-panes interface) + ) + +(defmethod clear-node-data-panes (interface) + (setf (capi:collection-items + (consensus-detail interface)) + nil) + (setf (capi:tree-view-roots + (right-child-detail interface)) + nil) + (setf (capi:tree-view-roots + (left-child-detail interface)) + nil) + ) + + +(defun print-partial-filename (f) + (let* ((f (pathname f)) + (pd (pathname-directory f)) + (pn (pathname-name f)) + (pt (pathname-type f)) + (last-pd (first (last pd))) + ) + (format nil + "~@[.../~A/~]~@[~A.~A~]" + last-pd + pn + pt))) + + + Added: gui/clarity-interface.lisp ============================================================================== --- (empty file) +++ gui/clarity-interface.lisp Wed Aug 16 16:18:39 2006 @@ -0,0 +1,190 @@ +;;; -*- Mode: Lisp -*- + +#|CLARITY: Common Lisp Data Alignment Repository +Copyright (c) 2006 Samantha Kleinberg +All rights reserved. + +This library is free software; you can redistribute it and/or modify it under the terms of the GNU +Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the +License, or (at your option) any later version. + +This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser +General Public License for more details. + +You should have received a copy of the GNU Lesser General Public License along with this library; +if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +contact: Samantha AT Bioinformatics DOT nyu DOT edu +715 Broadway, 10th floor +New York, NY 10003|# + +(in-package "CLARITY") + +(defvar *my-image-list* + (make-instance 'capi:image-list + :image-sets (list (capi:make-general-image-set + :id #.(gp:read-external-image (lispworks:current-pathname "icons/icons.bmp")) + :image-count 4)) + :image-width 16 + :image-height 16)) + + +(capi:define-interface clarity-interface () + ((clarity-handle :accessor clarity-handle + :initarg :clarity-handle)) + (:panes + (graph-pane-1 + capi:graph-pane + :print-function (lambda (x) (princ-to-string (phylogeny-data-id x))) + :roots (list (get-phylogeny-root *current-clarity-handle*)) + :children-function (lambda (x) (get-phylogeny-children x)) + :layout-function :top-down + :selection-callback 'phylogeny-select-callback + :callback-type :item-interface + :accessor phylogeny-pane) + + (database-buttons + capi:push-button-panel + :title "Database Options" + ; :items '("View all entries" "Search entries") + :items '("View all entries") + :layout-class 'capi:column-layout + :callback-type :data-interface + :selection-callback 'database-switch-callback + ) + + + (database-all-entries + capi:multi-column-list-panel + ; :items + :visible-min-width 300 + :visible-min-height :text-height + :columns '((:title "ID" + :adjust :left + :width (character 15)) + (:title "Filename" + :adjust :left + :visible-min-width (character 20)) + (:title "Date" + :adjust :left + :width (character 20))) + ;:selection-callback + ;mclp-header-callback + :accessor database-all-entries + ) + + (database-single-entry + capi:grid-layout + :accessor database-single-entry + ) + + (database-switchable + capi:switchable-layout + :description '(database-all-entries database-single-entry) + :accessor database-switchable + ) + + (leaf-terms + capi:list-panel + :accessor leaf-terms + :title "Terms" + ) + + (left-child-detail + capi:tree-view + :title "Left child" + :accessor left-child-detail + :children-function (lambda (x) (get-phylogeny-terms-children x)) + ;:children-function (lambda (x) nil) + :print-function (lambda (x) (phylogeny-terms-print-function x)) + :image-lists (list :normal *my-image-list*) + :image-function #'(lambda (x) (phylogeny-window-icon x)) + ) + + (right-child-detail + capi:tree-view + :title "Right child" + :accessor right-child-detail + :children-function (lambda (x) (get-phylogeny-terms-children x)) + ;:children-function (lambda (x) nil) + :print-function (lambda (x) (phylogeny-terms-print-function x)) + :image-lists (list :normal *my-image-list*) + :image-function #'(lambda (x) (phylogeny-window-icon x)) + ) + + + (consensus-detail + capi:list-panel + :title "Consensus" + :accessor consensus-detail + ) + + ) + (:layouts + (column-layout-1 + capi:column-layout + '(tab-layout-1)) + (tab-layout-1 + capi:tab-layout + () + :items '(("Database" database-layout) ("Phylogeny" phylogeny-layout)) + :print-function 'car + :visible-child-function 'second) + (database-layout + capi:row-layout + '(database-buttons + database-switchable) + ) + + (internal-node-detail + capi:row-layout + '(left-child-detail consensus-detail right-child-detail) + ) + + (leaf-layout + capi:row-layout + '(leaf-terms) + ) + + (phylogeny-detail + capi:tab-layout + () + :items '(("Leaf node" leaf-layout) + ("Internal node" internal-node-detail)) + :print-function 'car + :visible-child-function 'second + ) + + (phylogeny-layout + capi:column-layout + '(graph-pane-1 + phylogeny-detail)) + + (column-layout-3 + capi:column-layout + '(graph-pane-1 + phylogeny-detail))) + + (:menu-bar file edit) + (:menus + (edit + "Edit" + ()) + (file + "File" + ((:component + ( ("Insert" :callback 'insert-file-popup + :callback-type :interface)))))) + + (:default-initargs + :best-height 280 + :best-width 300 + :layout 'column-layout-1 + :title "CLARITY")) + +(defun start-clarity-interface () + (let ((gui (make-instance 'clarity-interface + :clarity-handle *current-clarity-handle*))) + (capi:display gui) + )) Added: gui/icons/base.bmp ============================================================================== Binary file. No diff available. Added: gui/icons/down.bmp ============================================================================== Binary file. No diff available. Added: gui/icons/icons.bmp ============================================================================== Binary file. No diff available. Added: gui/icons/inactive.bmp ============================================================================== Binary file. No diff available. Added: gui/icons/neutral.bmp ============================================================================== Binary file. No diff available. Added: gui/icons/up.bmp ============================================================================== Binary file. No diff available. Added: gui/insert-data-interface.lisp ============================================================================== --- (empty file) +++ gui/insert-data-interface.lisp Wed Aug 16 16:18:39 2006 @@ -0,0 +1,89 @@ +;;; -*- Mode: Lisp -*- + +#|CLARITY: Common Lisp Data Alignment Repository +Copyright (c) 2006 Samantha Kleinberg +All rights reserved. + +This library is free software; you can redistribute it and/or modify it under the terms of the GNU +Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the +License, or (at your option) any later version. + +This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser +General Public License for more details. + +You should have received a copy of the GNU Lesser General Public License along with this library; +if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +contact: Samantha AT Bioinformatics DOT nyu DOT edu +715 Broadway, 10th floor +New York, NY 10003|# + +(in-package "CLARITY") + +(capi:define-interface insert-data-interface () + ((file-location :accessor file-location + :initarg :file-location)) + (:panes + (insert-form + capi:title-pane + :text "Fill out form") + (file-location-1 + capi:title-pane + :text "File location:") + (file-location-input-1 + capi:display-pane + :accessor file-location-pane + ) + (file-location-button-1 + capi:push-button + :text "Find file" + :selection-callback 'get-filename + :callback-type :interface + ) + (file-date-1 + capi:title-pane + :text "Creation date") + (file-date-input-1 + capi:text-input-pane + :accessor file-date-input) + (spacer + capi:title-pane + :text "") + (spacer-2 + capi:title-pane + :text "") + (spacer-3 + capi:title-pane + :text "") + + (probe-check-box + capi:check-button + :text "Check if data file includes gene information." + :accessor probe-check-box + ) + + (ok-cancel-panel + capi:push-button-panel + :items '("OK" "Cancel") + :callback-type :data + :callbacks '(capi:exit-dialog + capi:abort-dialog) + :max-height t + :max-width t)) + (:layouts + (column-layout-1 + capi:column-layout + '(insert-form grid-layout-1)) + (grid-layout-1 + capi:grid-layout + '(file-location-1 file-location-input-1 file-location-button-1 + file-date-1 file-date-input-1 spacer + probe-check-box spacer-3 spacer-3 + spacer-2 ok-cancel-panel) + :columns 3)) + (:default-initargs + :best-height 89 + :best-width 424 + :layout 'column-layout-1 + :title "Insert-data-interface")) Added: gui/start-gui.lisp ============================================================================== --- (empty file) +++ gui/start-gui.lisp Wed Aug 16 16:18:39 2006 @@ -0,0 +1,122 @@ +;;; -*- Mode: Lisp -*- + +#|CLARITY: Common Lisp Data Alignment Repository +Copyright (c) 2006 Samantha Kleinberg +All rights reserved. + +This library is free software; you can redistribute it and/or modify it under the terms of the GNU +Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the +License, or (at your option) any later version. + +This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser +General Public License for more details. + +You should have received a copy of the GNU Lesser General Public License along with this library; +if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +contact: Samantha AT Bioinformatics DOT nyu DOT edu +715 Broadway, 10th floor +New York, NY 10003|# + +(in-package "CLARITY") + +(eval-when (:compile-toplevel :load-toplevel :execute) + (require "sql") + (require "odbc")) + + +#.(sql:enable-sql-reader-syntax) + + +;;; Environment setting functions. + +(defun setup-clarity-logical-pathnames () + (let* ((command (first system:*line-arguments-list*)) + (executable-location + (make-pathname :name nil + :type nil + :defaults (pathname command))) + ) + (setf (logical-pathname-translations "CLARITY") + `(("*.*" ,(make-pathname :name :wild + :type :wild + :defaults executable-location)) + ("*.*.*" ,(make-pathname :name :wild + :type :wild + :version :wild + :defaults executable-location)) + ("**;*.*" ,(merge-pathnames + (make-pathname :name :wild + :type :wild + :directory (list :relative :wild-inferiors)) + executable-location)) + ("**;*.*.*" ,(merge-pathnames + (make-pathname :name :wild + :type :wild + :version :wild + :directory (list :relative :wild-inferiors)) + executable-location)) + ) + ))) + + + +;;; Startup functions. + + +(defvar *clarity-init-file* + (make-pathname :name ".clarity-init" + :type nil + :defaults (user-homedir-pathname))) + +(defvar *clarity-init-file-dos* + (make-pathname :name "_clarity-init" + :type nil + :defaults (user-homedir-pathname))) + + +(defun start-clarity-gui (&key(init-file (list *clarity-init-file* + *clarity-init-file-dos*)) + data-file + (reset-logical-pathnames-p t) + ) + (flet ((load-init-file (init-file) + (let ((*package* (find-package "CLARITY"))) + (load init-file :print nil :verbose nil :if-does-not-exist nil))) + ) + (etypecase init-file + (list (some #'load-init-file init-file)) + ((or string pathname) (load-init-file init-file))) + + + (capi:display-message "Starting CLARITY.") + + (clarity:make-clarity-handle) + (clarity:connect clarity::*current-clarity-handle* (clarity::start-setup-interface)) + (capi:display-message "DBS connected.") + + (let ((gui (make-instance 'clarity-interface + :clarity-handle clarity::*current-clarity-handle*))) + (capi:display gui) + (when reset-logical-pathnames-p + (setup-clarity-logical-pathnames)) + (capi:execute-with-interface + gui + (lambda () + (etypecase init-file + (list (some #'load-init-file init-file)) + ((or string pathname) (load-init-file init-file))) + (when reset-logical-pathnames-p + (setup-clarity-logical-pathnames)) + + )) + + (when data-file + (load data-file :print nil :verbose nil)) + gui))) + + +#.(sql:disable-sql-reader-syntax) + +;;; end of file -- start-gui.lisp -- Added: sql/clarity.sql ============================================================================== --- (empty file) +++ sql/clarity.sql Wed Aug 16 16:18:39 2006 @@ -0,0 +1,67 @@ +--************************************************** +--** SQl script for creating CLARITY tables ** +--** clarity.sql ** +--************************************************** + + +--** table for storing phylogenetic tree ** + + +CREATE DATABASE clarity; + +USE clarity; + +CREATE TABLE timecourse_data ( + id INTEGER NOT NULL AUTO_INCREMENT, + datafile_path VARCHAR(100) NOT NULL, + creation_date VARCHAR(45) NOT NULL, + association_file VARCHAR(100) NOT NULL, + patient_id INTEGER, + PRIMARY KEY (id) +); + + +--** table for storing gantt charts ** +CREATE TABLE gantt_chart ( + id INTEGER NOT NULL AUTO_INCREMENT, + timecourse_data_id INTEGER DEFAUlT '0', + term_name VARCHAR(200), + sequence VARCHAR(45) NOT NULL, + PRIMARY KEY(id) +); + + +--** table for storing numerical data ** +CREATE TABLE numerical_data ( + id INTEGER NOT NULL AUTO_INCREMENT, + timecourse_data_id INTEGER, + term_name VARCHAR(100), + window_start FLOAT, + window_end FLOAT, + data FLOAT, + probe_ids TEXT, + PRIMARY KEY(id) +); + + +--** table for storing phylogenetic tree ** +CREATE TABLE tree ( + id INTEGER NOT NULL AUTO_INCREMENT, + timecourse_data_id INTEGER DEFAULT '0', + node_left INTEGER DEFAULT '0', + node_right INTEGER DEFAULT '0', + is_root INTEGER DEFAULT '0', + consensus_id INTEGER DEFAULT '0', + PRIMARY KEY(id) +); + +--** table for storing consensus sequences ** +--** for phylogenetic tree ** + +CREATE TABLE consensus ( + id INTEGER NOT NULL AUTO_INCREMENT, + tree_id INTEGER DEFAULT '0', + term_name VARCHAR(100) NOT NULL, + sequence VARCHAR(45) NOT NULL, + PRIMARY KEY(id) +); Added: utilities/delivery/clarity-4.ico ============================================================================== Binary file. No diff available. Added: utilities/delivery/clarity-icon-3.bmp ============================================================================== Binary file. No diff available. Added: utilities/delivery/clarity-icon-3.ico ============================================================================== Binary file. No diff available. Added: utilities/delivery/clarity-icon-4.bmp ============================================================================== Binary file. No diff available. Added: utilities/delivery/clarity-icon-4.ico ============================================================================== Binary file. No diff available. Added: utilities/delivery/clarity.ico ============================================================================== Binary file. No diff available. Added: utilities/delivery/delivery-script.fsl ============================================================================== Binary file. No diff available. Added: utilities/delivery/delivery-script.lisp ============================================================================== --- (empty file) +++ utilities/delivery/delivery-script.lisp Wed Aug 16 16:18:39 2006 @@ -0,0 +1,143 @@ +;;; -*- Mode: Lisp -*- + +#|CLARITY: Common Lisp Data Alignment Repository +Copyright (c) 2006 Samantha Kleinberg +All rights reserved. + +This library is free software; you can redistribute it and/or modify it under the terms of the GNU +Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the +License, or (at your option) any later version. + +This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even +the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser +General Public License for more details. + +You should have received a copy of the GNU Lesser General Public License along with this library; +if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +contact: Samantha AT Bioinformatics DOT nyu DOT edu +715 Broadway, 10th floor +New York, NY 10003|# + +;;; delivery-script.lisp -- Lispworks dependent delivery script. + +(in-package "COMMON-LISP-USER") + + +;;;=========================================================================== +;;; Setting up the environment. + +(defvar *_mxa-init-file* (merge-pathnames (make-pathname :name ".lispworks") + (user-homedir-pathname))) + + +(unless (find-package "MAKE") + (load *_mxa-init-file*) + ) + + +(defvar *clarity-system-file* + (pathname "z:/lisp/clarity/clarity.system")) + + +(loop until (and (or (stringp *clarity-system-file*) + (pathnamep *clarity-system-file*)) + (probe-file *clarity-system-file*)) + do (cerror ";;; Enter the full path of the CLARITY.system file: " + ";;; CLARITY system file ~S could not be found." + (namestring *clarity-system-file*)) + do (setf *clarity-system-file* (read))) + + +(defvar *clarity-gui-system-file* + (pathname "z:/lisp/clarity/gui/impl-dependent/lwcapi/clarity-gui.system")) + + +(loop until (and (or (stringp *clarity-gui-system-file*) + (pathnamep *clarity-gui-system-file*)) + (probe-file *clarity-gui-system-file*)) + do (cerror ";;; Enter the full path of the CLARITY-GUI.system file: " + ";;; CLARITY-GUI system file ~S could not be found." + (namestring *clarity-gui-system-file*)) + do (setf *clarity-gui-system-file* (read))) + +(defparameter *clarity-application-file* "clarity") + +(proclaim '(optimize (debug 1) (speed 3) (space 2))) ; Turn on Tail Merge. + + +;;;--------------------------------------------------------------------------- +;;; Platform dependent initializations. + +#+(and macosx cocoa) +(compile-file-if-needed (sys:example-file "configuration/macos-application-bundle") + :load t) + +#+(and macosx cocoa) +(setf *xssys-application-file* + (write-macos-application-bundle "~/Applications/XSSYS.app")) + + +;;;=========================================================================== +;;; Loading all the necessary bits and pieces of the application. + +;;; Ensure all the features are loaded. + +(require "sql") +(require "odbc") + +(pushnew :clarity-gui *features*) +(pushnew :clarity *features*) + + + +;;; Load the .system file and compile it. + +(load *clarity-system-file*) +(mk:load-system "Clarity") + +(load *clarity-gui-system-file*) +(mk:load-system "CLARITY-GUI") + + +;;; Ensure that the stupid pprinter is loaded. + +(format t (formatter "~3%;;;~75,,,'=A~@ + ;;; Starting delivery.~@ + ;;; CLARITY system loaded.~%") + #\=) + + +;;; Ensure that all the DBS are disconnected. + +;(clarity::disconnect-clarity-dbs) + + +;;; Turn off interactive debugger switches. + +;(setf clarity::*clarity-has-debugger-present* nil) + + +;;; Deliver the 'clarity' application. + +(deliver 'clarity::start-clarity-gui + + *clarity-application-file* 0 + :interface :capi + :keep-pretty-printer t + :versioninfo (list :binary-version #x0000000100000000 + :version-string "CLARITY version 1.0.0.0" + :company-name "NYU Courant Bioinformatics Group" + :product-name "CLARITY" + :file-description + (format nil + "CLARITY.") + :legal-copyright + (format nil "Copyright (c) 2006 Samantha Kleinberg~@ + All rights reserved.") + ) + :icon-file "clarity-icon-3.ico" + ) +(quit) + +;;; end of file -- delivery-script.lisp -- Added: utilities/delivery/lwdeli.bat ============================================================================== --- (empty file) +++ utilities/delivery/lwdeli.bat Wed Aug 16 16:18:39 2006 @@ -0,0 +1,8 @@ + at echo off +rem lwdeli.bat -- Delivery script for LW. + +echo ;;; GOALIE: building application... + +C:\PROGRA~1\XANALYS\LISPWO~1\LISPWO~1.exe -init delivery-script.lisp + +rem end of file -- lwdeli.bat --