[Jtreeview-cvs] jtreeview commit notification
Brought to you by:
alokito
From: Alex S. <av...@us...> - 2004-08-13 23:11:45
|
Update of /cvsroot/jtreeview/LinkedView/src/edu/stanford/genetics/treeview/model In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3146/src/edu/stanford/genetics/treeview/model Modified Files: Tag: SpellmanBeta TVModelLoader.java TVModel.java KnnModel.java FlatFileParser.java ProgressTrackable.java LoadProgress.java AtrTVModelLoader.java AtrTVModel.java LoadProgress2.java FlatFileStreamTokenizer.java Log Message: Spellman Beta. Final commit for summer of 2004. Features added to JTreeView: -Annotations seperated into columns. -Seperate links now possible for different annotation columns. (This was done by adding a TextViewManager class which encapsulated a set of n TextViews, where n is the number of annotations.) -Wildcarded "header" column in the UrlPreset window allows the user to choose different presets based on different links. -Enable checkbox allows user to disable or enable a particular header specific behavior. -Default preset is used if no other matches are found. -Currently selected gene annotations are now saved into the .jtv, as are column widths of the annoations columbs. -Ability to compare two different datasets in Linked View. This is done by appending one file to the data model of the other, and then removing it when the user chooses to turn of the comparison mode. -A column of NODATA elements is added to seperate the two data setes. -Currently the tree of the second data set is not displayed and there are some minor annoyances (bugs) in the way selection is done when comparison mode is enabled. Index: LoadProgress.java =================================================================== RCS file: /cvsroot/jtreeview/LinkedView/src/edu/stanford/genetics/treeview/model/LoadProgress.java,v retrieving revision 1.1.2.3 retrieving revision 1.1.2.4 diff -C2 -d -r1.1.2.3 -r1.1.2.4 *** LoadProgress.java 1 Jul 2004 22:43:20 -0000 1.1.2.3 --- LoadProgress.java 13 Aug 2004 23:11:04 -0000 1.1.2.4 *************** *** 8,12 **** * * This file is part of Java TreeView ! * Copyright (C) 2001-2003 Alok Saldanha, All Rights Reserved. * * This software is provided under the GNU GPL Version 2. In particular, --- 8,12 ---- * * This file is part of Java TreeView ! * Copyright (C) 2001-2003 Alok Saldanha, All Rights Reserved. Modified by Alex Segal 2004/08/13. Modifications Copyright (C) Lawrence Berkeley Lab. * * This software is provided under the GNU GPL Version 2. In particular, Index: AtrTVModelLoader.java =================================================================== RCS file: /cvsroot/jtreeview/LinkedView/src/edu/stanford/genetics/treeview/model/Attic/AtrTVModelLoader.java,v retrieving revision 1.1.2.1 retrieving revision 1.1.2.2 diff -C2 -d -r1.1.2.1 -r1.1.2.2 *** AtrTVModelLoader.java 1 Jul 2004 20:36:19 -0000 1.1.2.1 --- AtrTVModelLoader.java 13 Aug 2004 23:11:04 -0000 1.1.2.2 *************** *** 8,12 **** * * This file is part of Java TreeView ! * Copyright (C) 2001-2003 Alok Saldanha, All Rights Reserved. * * This software is provided under the GNU GPL Version 2. In particular, --- 8,12 ---- * * This file is part of Java TreeView ! * Copyright (C) 2001-2003 Alok Saldanha, All Rights Reserved. Modified by Alex Segal 2004/08/13. Modifications Copyright (C) Lawrence Berkeley Lab. * * This software is provided under the GNU GPL Version 2. In particular, Index: FlatFileParser.java =================================================================== RCS file: /cvsroot/jtreeview/LinkedView/src/edu/stanford/genetics/treeview/model/FlatFileParser.java,v retrieving revision 1.1.2.3 retrieving revision 1.1.2.4 diff -C2 -d -r1.1.2.3 -r1.1.2.4 *** FlatFileParser.java 1 Jul 2004 22:43:20 -0000 1.1.2.3 --- FlatFileParser.java 13 Aug 2004 23:11:04 -0000 1.1.2.4 *************** *** 8,12 **** * * This file is part of Java TreeView ! * Copyright (C) 2001-2003 Alok Saldanha, All Rights Reserved. * * This software is provided under the GNU GPL Version 2. In particular, --- 8,12 ---- * * This file is part of Java TreeView ! * Copyright (C) 2001-2003 Alok Saldanha, All Rights Reserved. Modified by Alex Segal 2004/08/13. Modifications Copyright (C) Lawrence Berkeley Lab. * * This software is provided under the GNU GPL Version 2. In particular, Index: TVModelLoader.java =================================================================== RCS file: /cvsroot/jtreeview/LinkedView/src/edu/stanford/genetics/treeview/model/TVModelLoader.java,v retrieving revision 1.13.2.3 retrieving revision 1.13.2.4 diff -C2 -d -r1.13.2.3 -r1.13.2.4 *** TVModelLoader.java 1 Jul 2004 22:43:19 -0000 1.13.2.3 --- TVModelLoader.java 13 Aug 2004 23:11:04 -0000 1.13.2.4 *************** *** 8,12 **** * * This file is part of Java TreeView ! * Copyright (C) 2001-2003 Alok Saldanha, All Rights Reserved. * * This software is provided under the GNU GPL Version 2. In particular, --- 8,12 ---- * * This file is part of Java TreeView ! * Copyright (C) 2001-2003 Alok Saldanha, All Rights Reserved. Modified by Alex Segal 2004/08/13. Modifications Copyright (C) Lawrence Berkeley Lab. * * This software is provided under the GNU GPL Version 2. In particular, Index: AtrTVModel.java =================================================================== RCS file: /cvsroot/jtreeview/LinkedView/src/edu/stanford/genetics/treeview/model/Attic/AtrTVModel.java,v retrieving revision 1.1.2.1 retrieving revision 1.1.2.2 diff -C2 -d -r1.1.2.1 -r1.1.2.2 *** AtrTVModel.java 1 Jul 2004 20:36:19 -0000 1.1.2.1 --- AtrTVModel.java 13 Aug 2004 23:11:04 -0000 1.1.2.2 *************** *** 8,12 **** * * This file is part of Java TreeView ! * Copyright (C) 2001-2003 Alok Saldanha, All Rights Reserved. * * This software is provided under the GNU GPL Version 2. In particular, --- 8,12 ---- * * This file is part of Java TreeView ! * Copyright (C) 2001-2003 Alok Saldanha, All Rights Reserved. Modified by Alex Segal 2004/08/13. Modifications Copyright (C) Lawrence Berkeley Lab. * * This software is provided under the GNU GPL Version 2. In particular, Index: TVModel.java =================================================================== RCS file: /cvsroot/jtreeview/LinkedView/src/edu/stanford/genetics/treeview/model/TVModel.java,v retrieving revision 1.11.2.3 retrieving revision 1.11.2.4 diff -C2 -d -r1.11.2.3 -r1.11.2.4 *** TVModel.java 1 Jul 2004 22:43:20 -0000 1.11.2.3 --- TVModel.java 13 Aug 2004 23:11:04 -0000 1.11.2.4 *************** *** 8,12 **** * * This file is part of Java TreeView ! * Copyright (C) 2001-2003 Alok Saldanha, All Rights Reserved. * * This software is provided under the GNU GPL Version 2. In particular, --- 8,12 ---- * * This file is part of Java TreeView ! * Copyright (C) 2001-2003 Alok Saldanha, All Rights Reserved. Modified by Alex Segal 2004/08/13. Modifications Copyright (C) Lawrence Berkeley Lab. * * This software is provided under the GNU GPL Version 2. In particular, *************** *** 39,45 **** * where it is not enough to know that we've got a DataModel. */ ! public String getType() { ! return "TVModel"; ! } // accessor methods public HeaderInfo getGeneHeaderInfo() { --- 39,64 ---- * where it is not enough to know that we've got a DataModel. */ ! ! ! TVModel compareModel = null; ! int extraCompareExpr = 0; ! public String getType() { ! return "TVModel"; ! } ! ! public void setModelForCompare(DataModel m) ! { ! if(m == null) ! { ! compareModel = null; ! extraCompareExpr = 0; ! } ! else ! { ! compareModel = (TVModel)m; ! extraCompareExpr = compareModel.nExpr() + 2; ! } ! hasChanged(); ! } // accessor methods public HeaderInfo getGeneHeaderInfo() { *************** *** 50,53 **** --- 69,77 ---- } public DataMatrix getDataMatrix() { + + if(compareModel != null) + { + + } return dataMatrix; } *************** *** 64,78 **** public int nGene() {return ngene;} void nGene(int newVal) {ngene = newVal;} ! public int nExpr() {return nexpr;} void nExpr(int newVal) {nexpr = newVal;} public void setExprData(double [] newData) {exprData = newData;} ! public double getValue(int x, int y) { ! if ((x < nexpr && y < ngene) && ! (x >= 0 && y >= 0)) ! { ! return exprData[x + y*nexpr]; ! } ! return NODATA; } public boolean aidFound() { --- 88,110 ---- public int nGene() {return ngene;} void nGene(int newVal) {ngene = newVal;} ! public int nExpr() {return nexpr + extraCompareExpr;} void nExpr(int newVal) {nexpr = newVal;} public void setExprData(double [] newData) {exprData = newData;} ! ! public double getValue(int x, int y) { ! if(x >= nexpr + 2) ! { ! return compareModel.getValue(x - (nexpr + 2), y); // check offsets ! } ! else if(x >= nexpr && y < ngene) ! { ! return 0; // gray border ! } ! if ((x < nexpr && y < ngene) && (x >= 0 && y >= 0)) ! { ! return exprData[x + y*nexpr]; ! } ! return NODATA; } public boolean aidFound() { *************** *** 165,169 **** public void reorderArrays(int [] ordering) { ! if(ordering == null || ordering.length != aHeaders.length) // make sure input to function makes sense { return; --- 197,201 ---- public void reorderArrays(int [] ordering) { ! if(ordering == null || ordering.length != dataMatrix.getNumUnappendedCol()) // make sure input to function makes sense { return; *************** *** 175,184 **** for(int j = 0; j < data.getNumRow(); j++) { ! double [] temp = new double[data.getNumCol()]; ! for(int i = 0; i < data.getNumCol(); i++) { temp[i] = data.getValue(ordering[i], j); } ! for(int i = 0; i < data.getNumCol(); i++) { data.setValue(temp[i], i, j); --- 207,216 ---- for(int j = 0; j < data.getNumRow(); j++) { ! double [] temp = new double[data.getNumUnappendedCol()]; ! for(int i = 0; i < ordering.length; i++) { temp[i] = data.getValue(ordering[i], j); } ! for(int i = 0; i < ordering.length; i++) { data.setValue(temp[i], i, j); *************** *** 190,194 **** for(int i = 0; i < aHeaders.length; i++) { ! temp2[i] = aHeaders[ordering[i]]; } setArrayHeaders(temp2); --- 222,233 ---- for(int i = 0; i < aHeaders.length; i++) { ! if(i < ordering.length) ! { ! temp2[i] = aHeaders[ordering[i]]; ! } ! else ! { ! temp2[i] = aHeaders[i]; ! } } setArrayHeaders(temp2); *************** *** 224,228 **** int [] temp = new int[aHeaders.length]; ! for(int i = 0; i < aHeaders.length; i++) { prevVal = order.getAttribute("Position" + ordering[i], -1); --- 263,267 ---- int [] temp = new int[aHeaders.length]; ! for(int i = 0; i < dataMatrix.getNumUnappendedCol(); i++) { prevVal = order.getAttribute("Position" + ordering[i], -1); *************** *** 238,242 **** //System.out.print("Saved ordering: "); ! for(int i = 0; i < aHeaders.length; i++) { order.setAttribute("Position" + i, temp[i], -1); --- 277,281 ---- //System.out.print("Saved ordering: "); ! for(int i = 0; i < dataMatrix.getNumUnappendedCol(); i++) { order.setAttribute("Position" + i, temp[i], -1); *************** *** 259,263 **** ConfigNode order = documentConfig.getNode("ArrayOrder"); ! int [] ordering = new int[aHeaders.length]; int prevVal = 0; --- 298,302 ---- ConfigNode order = documentConfig.getNode("ArrayOrder"); ! int [] ordering = new int[dataMatrix.getNumUnappendedCol()]; int prevVal = 0; *************** *** 391,395 **** --- 430,537 ---- } */ + + public void removeAppended() + { + if(appendIndex == -1) + { + return; + } + + double [] temp = new double[ngene*appendIndex]; + + int i = 0; + + for(int g = 0; g < this.dataMatrix.getNumRow(); g++) + { + for(int e = 0; e < nexpr; e++) + { + if(e < appendIndex) + { + temp[i++] = getValue(e, g); + } + } + } + exprData = temp; + + String [][] tempS = new String[appendIndex][]; + + for(int j = 0; j < appendIndex; j++) + { + tempS[j] = aHeaders[j]; + } + + aHeaders = tempS; + nexpr = appendIndex; + appendIndex = -1; + setChanged(); + } + + /** + * Appends a second matrix to this one provided they have the same height. Used for comparison of two data sets where the data is displayed side by side. + * + */ + public void append(DataModel m) + { + if(m == null || m.getDataMatrix().getNumRow() != ngene || appendIndex != -1) + { + System.out.println("Could not compare."); + return; + } + + double [] temp = new double[exprData.length + m.getDataMatrix().getNumRow()*(m.getDataMatrix().getNumCol() + 1)]; + + int i = 0; + + for(int g = 0; g < m.getDataMatrix().getNumRow(); g++) + { + for(int e = 0; e < nexpr + m.getDataMatrix().getNumCol() + 1; e++) + { + if(e < nexpr) + { + temp[i++] = getValue(e, g); + } + else if(e < nexpr + 1) + { + temp[i++] = DataModel.NODATA; + } + else + { + temp[i++] = m.getDataMatrix().getValue(e - nexpr - 1, g); + } + + } + } + + String [][] tempS = new String[getArrayHeaderInfo().getNumHeaders() + m.getArrayHeaderInfo().getNumHeaders() + 1][]; + + i = 0; + for(int j = 0; j < getArrayHeaderInfo().getNumHeaders(); j++) + { + tempS[i++] = getArrayHeaderInfo().getHeader(j); + } + + tempS[i] = new String[getArrayHeaderInfo().getNumNames()]; + + for(int j = 0; j < tempS[i].length; j++) + { + tempS[i][j] = "-----------------------"; + } + i++; + + for(int j = 0; j < getArrayHeaderInfo().getNumHeaders(); j++) + { + tempS[i++] = getArrayHeaderInfo().getHeader(j); + } + + + aHeaders = tempS; + appendIndex = nexpr; + nexpr += m.getDataMatrix().getNumCol() + 1; + exprData = temp; + setChanged(); + } + int appendIndex = -1; + protected Frame frame; protected FileSet source = null; *************** *** 431,435 **** class TVDataMatrix implements DataMatrix { ! public double getValue(int x, int y) { if ((x < nexpr) && (y < ngene) && (x >= 0) && (y >= 0)) { --- 573,577 ---- class TVDataMatrix implements DataMatrix { ! public double getValue(int x, int y) { if ((x < nexpr) && (y < ngene) && (x >= 0) && (y >= 0)) { *************** *** 439,442 **** --- 581,585 ---- } } + public void setValue(double value, int x, int y) { *************** *** 448,452 **** } public int getNumCol() { ! return nexpr; } } --- 591,600 ---- } public int getNumCol() { ! return nExpr(); ! } ! ! public int getNumUnappendedCol() ! { ! return appendIndex == -1?getNumCol():appendIndex; } } *************** *** 505,511 **** return aHeaders[arrayIndex][index]; } public int getNumHeaders() { ! return TVModel.this.nexpr; } public int getIndex(String header) { --- 653,660 ---- return aHeaders[arrayIndex][index]; } + public int getNumHeaders() { ! return TVModel.this.dataMatrix.getNumUnappendedCol(); } public int getIndex(String header) { Index: LoadProgress2.java =================================================================== RCS file: /cvsroot/jtreeview/LinkedView/src/edu/stanford/genetics/treeview/model/LoadProgress2.java,v retrieving revision 1.2.2.3 retrieving revision 1.2.2.4 diff -C2 -d -r1.2.2.3 -r1.2.2.4 *** LoadProgress2.java 1 Jul 2004 22:43:20 -0000 1.2.2.3 --- LoadProgress2.java 13 Aug 2004 23:11:05 -0000 1.2.2.4 *************** *** 8,12 **** * * This file is part of Java TreeView ! * Copyright (C) 2001-2003 Alok Saldanha, All Rights Reserved. * * This software is provided under the GNU GPL Version 2. In particular, --- 8,12 ---- * * This file is part of Java TreeView ! * Copyright (C) 2001-2003 Alok Saldanha, All Rights Reserved. Modified by Alex Segal 2004/08/13. Modifications Copyright (C) Lawrence Berkeley Lab. * * This software is provided under the GNU GPL Version 2. In particular, Index: FlatFileStreamTokenizer.java =================================================================== RCS file: /cvsroot/jtreeview/LinkedView/src/edu/stanford/genetics/treeview/model/FlatFileStreamTokenizer.java,v retrieving revision 1.1.2.3 retrieving revision 1.1.2.4 diff -C2 -d -r1.1.2.3 -r1.1.2.4 *** FlatFileStreamTokenizer.java 1 Jul 2004 22:43:20 -0000 1.1.2.3 --- FlatFileStreamTokenizer.java 13 Aug 2004 23:11:05 -0000 1.1.2.4 *************** *** 8,12 **** * * This file is part of Java TreeView ! * Copyright (C) 2001-2003 Alok Saldanha, All Rights Reserved. * * This software is provided under the GNU GPL Version 2. In particular, --- 8,12 ---- * * This file is part of Java TreeView ! * Copyright (C) 2001-2003 Alok Saldanha, All Rights Reserved. Modified by Alex Segal 2004/08/13. Modifications Copyright (C) Lawrence Berkeley Lab. * * This software is provided under the GNU GPL Version 2. In particular, Index: KnnModel.java =================================================================== RCS file: /cvsroot/jtreeview/LinkedView/src/edu/stanford/genetics/treeview/model/KnnModel.java,v retrieving revision 1.4.2.3 retrieving revision 1.4.2.4 diff -C2 -d -r1.4.2.3 -r1.4.2.4 *** KnnModel.java 1 Jul 2004 22:43:20 -0000 1.4.2.3 --- KnnModel.java 13 Aug 2004 23:11:04 -0000 1.4.2.4 *************** *** 8,12 **** * * This file is part of Java TreeView ! * Copyright (C) 2001-2003 Alok Saldanha, All Rights Reserved. * * This software is provided under the GNU GPL Version 2. In particular, --- 8,12 ---- * * This file is part of Java TreeView ! * Copyright (C) 2001-2003 Alok Saldanha, All Rights Reserved. Modified by Alex Segal 2004/08/13. Modifications Copyright (C) Lawrence Berkeley Lab. * * This software is provided under the GNU GPL Version 2. In particular, Index: ProgressTrackable.java =================================================================== RCS file: /cvsroot/jtreeview/LinkedView/src/edu/stanford/genetics/treeview/model/ProgressTrackable.java,v retrieving revision 1.1.2.3 retrieving revision 1.1.2.4 diff -C2 -d -r1.1.2.3 -r1.1.2.4 *** ProgressTrackable.java 1 Jul 2004 22:43:20 -0000 1.1.2.3 --- ProgressTrackable.java 13 Aug 2004 23:11:04 -0000 1.1.2.4 *************** *** 9,13 **** * * This file is part of Java TreeView ! * Copyright (C) 2001-2003 Alok Saldanha, All Rights Reserved. * * This software is provided under the GNU GPL Version 2. In particular, --- 9,13 ---- * * This file is part of Java TreeView ! * Copyright (C) 2001-2003 Alok Saldanha, All Rights Reserved. Modified by Alex Segal 2004/08/13. Modifications Copyright (C) Lawrence Berkeley Lab. * * This software is provided under the GNU GPL Version 2. In particular, |