Author: ghannum
Date: 2010-07-28 16:45:31 -0700 (Wed, 28 Jul 2010)
New Revision: 21066

Added:
   
csplugins/trunk/ucsd/ruschein/PanGIA/src/org/idekerlab/PanGIAPlugin/utilities/html/HTMLParagraphBlock.java
Modified:
   
csplugins/trunk/ucsd/ruschein/PanGIA/src/org/idekerlab/PanGIAPlugin/NestedNetworkCreator.java
   
csplugins/trunk/ucsd/ruschein/PanGIA/src/org/idekerlab/PanGIAPlugin/PanGIAPlugin.java
   
csplugins/trunk/ucsd/ruschein/PanGIA/src/org/idekerlab/PanGIAPlugin/SearchParameters.java
   
csplugins/trunk/ucsd/ruschein/PanGIA/src/org/idekerlab/PanGIAPlugin/SearchTask.java
   
csplugins/trunk/ucsd/ruschein/PanGIA/src/org/idekerlab/PanGIAPlugin/ui/SearchPropertyPanel.java
   
csplugins/trunk/ucsd/ruschein/PanGIA/src/org/idekerlab/PanGIAPlugin/utilities/collections/ListOps.java
   
csplugins/trunk/ucsd/ruschein/PanGIA/src/org/idekerlab/PanGIAPlugin/utilities/html/HTMLPage.java
   
csplugins/trunk/ucsd/ruschein/PanGIA/src/org/idekerlab/PanGIAPlugin/utilities/html/HTMLTextBlock.java
Log:


Modified: 
csplugins/trunk/ucsd/ruschein/PanGIA/src/org/idekerlab/PanGIAPlugin/NestedNetworkCreator.java
===================================================================
--- 
csplugins/trunk/ucsd/ruschein/PanGIA/src/org/idekerlab/PanGIAPlugin/NestedNetworkCreator.java
       2010-07-28 23:26:56 UTC (rev 21065)
+++ 
csplugins/trunk/ucsd/ruschein/PanGIA/src/org/idekerlab/PanGIAPlugin/NestedNetworkCreator.java
       2010-07-28 23:45:31 UTC (rev 21066)
@@ -93,7 +93,7 @@
        
        /////////////// Node Attribute Names /////////////
        // This is common prefix for all finders.
-       private static final String MODULE_FINDER_PREFIX = "Module Finder.";
+       private static final String MODULE_FINDER_PREFIX = "PanGIA.";
        
        // Number of nodes in a module
        private static final String GENE_COUNT = MODULE_FINDER_PREFIX + "member 
count";
@@ -140,20 +140,17 @@
                        final TypedLinkNetwork<String, Float> geneticNetwork,
                        final double cutoff, final TaskMonitor taskMonitor,
                        final float remainingPercentage,
-                       Map<TypedLinkNodeModule<String, BFEdge>,String> 
module_name)
+                       Map<TypedLinkNodeModule<String, BFEdge>,String> 
module_name,
+                       String networkName
+                       )
        {
                // Network attributes created here is required for managing 
Visual Styles.
                final CyAttributes networkAttr = 
Cytoscape.getNetworkAttributes();
                
                moduleToCyNodeMap = new HashMap<TypedLinkNodeModule<String, 
BFEdge>, CyNode>();
 
-               final Set<CyEdge> selectedEdges = new HashSet<CyEdge>();
-               final Set<CyNode> selectedNodes = new HashSet<CyNode>();
-
                overviewNetwork = Cytoscape.createNetwork(
-                               findNextAvailableNetworkName("Module Search 
Results: "
-                                               + new java.util.Date()),
-                               /* create_view = */false);
+                               findNextAvailableNetworkName(networkName),      
/* create_view = */false);
                networkAttr.setAttribute(overviewNetwork.getIdentifier(), 
                                
VisualStyleObserver.NETWORK_TYPE_ATTRIBUTE_NAME, NetworkType.OVERVIEW.name());
                
networkAttr.setUserVisible(VisualStyleObserver.NETWORK_TYPE_ATTRIBUTE_NAME, 
false);
@@ -234,27 +231,22 @@
                        final double pValue = edge.value().linkMerge();
                        edgeAttribs.setAttribute(newEdge.getIdentifier(), 
EDGE_PVALUE, Double
                                        .valueOf(pValue));
-                       if (pValue < cutoff) {
-                               selectedEdges.add(newEdge);
-                               selectedNodes.add((CyNode) newEdge.getSource());
-                               selectedNodes.add((CyNode) newEdge.getTarget());
-                       }
-
+                       
                        final int gConnectedness = 
geneticNetwork.getConnectedness(
                                        sourceModule.asStringSet(), 
targetModule.asStringSet());
                        edgeAttribs.setAttribute(newEdge.getIdentifier(),
-                                       "genetic interaction count", 
Integer.valueOf(gConnectedness));
+                                       "PanGIA.genetic interaction count", 
Integer.valueOf(gConnectedness));
                        final int pConnectedness = 
physicalNetwork.getConnectedness(
                                        sourceModule.asStringSet(), 
targetModule.asStringSet());
                        edgeAttribs.setAttribute(newEdge.getIdentifier(),
-                                       "physical interaction count", 
Integer.valueOf(pConnectedness));
-                       edgeAttribs.setAttribute(newEdge.getIdentifier(), 
"source size",
+                                       "PanGIA.physical interaction count", 
Integer.valueOf(pConnectedness));
+                       edgeAttribs.setAttribute(newEdge.getIdentifier(), 
"PanGIA.source size",
                                        Integer.valueOf(sourceModule.size()));
-                       edgeAttribs.setAttribute(newEdge.getIdentifier(), 
"target size",
+                       edgeAttribs.setAttribute(newEdge.getIdentifier(), 
"PanGIA.target size",
                                        Integer.valueOf(targetModule.size()));
                        final double density = edgeScore
                                        / (sourceModule.size() * 
targetModule.size());
-                       edgeAttribs.setAttribute(newEdge.getIdentifier(), 
"density", Double
+                       edgeAttribs.setAttribute(newEdge.getIdentifier(), 
"PanGIA.genetic interaction density", Double
                                        .valueOf(density));
                }
 
@@ -263,10 +255,6 @@
                Cytoscape.createNetworkView(overviewNetwork);
                applyNetworkLayout(overviewNetwork, cutoff, maxScore);
 
-               // Visually mark selected edges and nodes:
-               overviewNetwork.setSelectedEdgeState(selectedEdges, true);
-               overviewNetwork.setSelectedNodeState(selectedNodes, true);
-
                taskMonitor.setStatus("5. Generating network views");
                int networkViewCount = 0;
                NetworkAndScore network;
@@ -355,7 +343,7 @@
                for (final CyEdge edge : edges)
                {
                        nestedNetwork.addEdge(edge);
-                       cyEdgeAttrs.setAttribute(edge.getIdentifier(), "Module 
Finder.Interaction Type", "Physical");
+                       cyEdgeAttrs.setAttribute(edge.getIdentifier(), 
"PanGIA.Interaction Type", "Physical");
                }
 
                // Add the edges induced by "origGenNetwork" to our new nested 
network.
@@ -364,7 +352,7 @@
                for (final CyEdge edge : edges)
                {
                        nestedNetwork.addEdge(edge);
-                       cyEdgeAttrs.setAttribute(edge.getIdentifier(), "Module 
Finder.Interaction Type", "Genetic");
+                       cyEdgeAttrs.setAttribute(edge.getIdentifier(), 
"PanGIA.Interaction Type", "Genetic");
                }
 
                if (createNetworkView) {

Modified: 
csplugins/trunk/ucsd/ruschein/PanGIA/src/org/idekerlab/PanGIAPlugin/PanGIAPlugin.java
===================================================================
--- 
csplugins/trunk/ucsd/ruschein/PanGIA/src/org/idekerlab/PanGIAPlugin/PanGIAPlugin.java
       2010-07-28 23:26:56 UTC (rev 21065)
+++ 
csplugins/trunk/ucsd/ruschein/PanGIA/src/org/idekerlab/PanGIAPlugin/PanGIAPlugin.java
       2010-07-28 23:45:31 UTC (rev 21066)
@@ -35,6 +35,7 @@
        private final VisualStyleObserver vsObserver;
        
        private static final String PLUGIN_NAME = "PanGIA";
+       public static final String VERSION = "1.0";
 
 
        public PanGIAPlugin() {

Modified: 
csplugins/trunk/ucsd/ruschein/PanGIA/src/org/idekerlab/PanGIAPlugin/SearchParameters.java
===================================================================
--- 
csplugins/trunk/ucsd/ruschein/PanGIA/src/org/idekerlab/PanGIAPlugin/SearchParameters.java
   2010-07-28 23:26:56 UTC (rev 21065)
+++ 
csplugins/trunk/ucsd/ruschein/PanGIA/src/org/idekerlab/PanGIAPlugin/SearchParameters.java
   2010-07-28 23:45:31 UTC (rev 21066)
@@ -176,6 +176,6 @@
        
        public String getReportPath()
        {
-               return this.getReportPath();
+               return this.reportPath;
        }
 }

Modified: 
csplugins/trunk/ucsd/ruschein/PanGIA/src/org/idekerlab/PanGIAPlugin/SearchTask.java
===================================================================
--- 
csplugins/trunk/ucsd/ruschein/PanGIA/src/org/idekerlab/PanGIAPlugin/SearchTask.java
 2010-07-28 23:26:56 UTC (rev 21065)
+++ 
csplugins/trunk/ucsd/ruschein/PanGIA/src/org/idekerlab/PanGIAPlugin/SearchTask.java
 2010-07-28 23:45:31 UTC (rev 21066)
@@ -1,6 +1,8 @@
 package org.idekerlab.PanGIAPlugin;
 
 
+import org.idekerlab.PanGIAPlugin.utilities.html.*;
+
 import java.util.ArrayList;
 import java.util.HashMap;
 import java.util.HashSet;
@@ -13,12 +15,13 @@
 import org.idekerlab.PanGIAPlugin.ModFinder.HCSearch2;
 import org.idekerlab.PanGIAPlugin.ModFinder.SouravScore;
 import org.idekerlab.PanGIAPlugin.ModFinder.BFEdge.InteractionType;
-import org.idekerlab.PanGIAPlugin.data.DoubleVector;
+import org.idekerlab.PanGIAPlugin.data.*;
 import org.idekerlab.PanGIAPlugin.networks.SFNetwork;
 import org.idekerlab.PanGIAPlugin.networks.SNodeModule;
 import org.idekerlab.PanGIAPlugin.networks.hashNetworks.FloatHashNetwork;
 import org.idekerlab.PanGIAPlugin.networks.linkedNetworks.*;
 import org.idekerlab.PanGIAPlugin.utilities.collections.HashMapUtil;
+import org.idekerlab.PanGIAPlugin.utilities.collections.ListOps;
 import org.idekerlab.PanGIAPlugin.utilities.collections.SetUtil;
 
 import cytoscape.CyEdge;
@@ -32,6 +35,8 @@
 import org.idekerlab.PanGIAPlugin.util.Scaler;
 import org.idekerlab.PanGIAPlugin.util.ScalerFactory;
 
+import java.io.*;
+
 import javax.swing.*;
 
 /**
@@ -81,7 +86,38 @@
                
                if (needsToHalt) return;
                
+               
+               //Load trainingComplexes
+               List<SNodeModule> trainingComplexes = null;
+               if (parameters.getComplexTrainingPhysical() || 
parameters.getComplexTrainingGenetic() || parameters.getComplexAnnotation())
+               {
+                       final CyAttributes nodeAttr = 
Cytoscape.getNodeAttributes();
+                       Map<String,Set<String>> annot_node = new 
HashMap<String,Set<String>>(1000);
+                       
+                       for (String gnode : geneticNetwork.nodeIterator())
+                               for (Object annot : 
nodeAttr.getListAttribute(gnode, parameters.getAnnotationAttrName()))
+                                       HashMapUtil.updateMapSet(annot_node, 
annot.toString(), gnode);
+                       
+                       trainingComplexes = new 
ArrayList<SNodeModule>(annot_node.size());
+                       
+                       for (String annot : annot_node.keySet())
+                               trainingComplexes.add(new 
SNodeModule(annot,annot_node.get(annot)));
+               }
+               
+               if (needsToHalt) return;
+               
+               //Perform training
+               if (parameters.getComplexTrainingPhysical()) physicalNetwork = 
ComplexRegression.complexRegress(physicalNetwork, trainingComplexes, true);
+               if (parameters.getComplexTrainingGenetic()) geneticNetwork = 
ComplexRegression.complexRegress(geneticNetwork, trainingComplexes, true);
+               
+               
+               if (needsToHalt) return;
+               
                //Apply the degree filter
+               int pnetNodes1 = physicalNetwork.numNodes();
+               int pnetEdges1 = physicalNetwork.numEdges();
+               
+               
                int degreeFilter = parameters.getPhysicalNetworkFilterDegree();
                if (degreeFilter!=-1)
                {
@@ -89,6 +125,9 @@
                        Set<String> pnodes = physicalNetwork.getNodes();
                        physicalNetwork = new 
FloatHashNetwork(ptlnet.subNetwork(pnodes, degreeFilter));
                }
+               
+               int pnetNodes2 = physicalNetwork.numNodes();
+               int pnetEdges2 = physicalNetwork.numEdges();
                                
                if (needsToHalt) return;
                
@@ -109,32 +148,7 @@
                
                if (needsToHalt) return;
                
-               //Load trainingComplexes
-               List<SNodeModule> trainingComplexes = null;
-               if (parameters.getComplexTrainingPhysical() || 
parameters.getComplexTrainingGenetic() || parameters.getComplexAnnotation())
-               {
-                       final CyAttributes nodeAttr = 
Cytoscape.getNodeAttributes();
-                       Map<String,Set<String>> annot_node = new 
HashMap<String,Set<String>>(1000);
-                       
-                       for (String gnode : geneticNetwork.nodeIterator())
-                               for (Object annot : 
nodeAttr.getListAttribute(gnode, parameters.getAnnotationAttrName()))
-                                       HashMapUtil.updateMapSet(annot_node, 
annot.toString(), gnode);
-                       
-                       trainingComplexes = new 
ArrayList<SNodeModule>(annot_node.size());
-                       
-                       for (String annot : annot_node.keySet())
-                               trainingComplexes.add(new 
SNodeModule(annot,annot_node.get(annot)));
-               }
                
-               if (needsToHalt) return;
-               
-               //Perform training
-               if (parameters.getComplexTrainingPhysical()) physicalNetwork = 
ComplexRegression.complexRegress(physicalNetwork, trainingComplexes, true);
-               if (parameters.getComplexTrainingGenetic()) geneticNetwork = 
ComplexRegression.complexRegress(geneticNetwork, trainingComplexes, true);
-               
-               
-               if (needsToHalt) return;
-               
                //Initialize the scoring function
                final HCScoringFunction hcScoringFunction =
                        new SouravScore(physicalNetwork, geneticNetwork,
@@ -234,10 +248,11 @@
                final TypedLinkNetwork<String, Float> pNet = 
physicalNetwork.asTypedLinkNetwork();
                final TypedLinkNetwork<String, Float> gNet = 
geneticNetwork.asTypedLinkNetwork();
 
+               String networkName = "PanGIA Results: "+ new java.util.Date();
                final NestedNetworkCreator nnCreator =
                        new NestedNetworkCreator(results, physicalInputNetwork, 
geneticInputNetwork,
                                                 pNet, gNet, pValueThreshold, 
taskMonitor,
-                                                100.0f - 
COMPUTE_SIG_PERCENTAGE, module_name);
+                                                100.0f - 
COMPUTE_SIG_PERCENTAGE, module_name, networkName);
 
                setStatus("Search finished!\n\n" + "Number of modules = "
                          + nnCreator.getOverviewNetwork().getNodeCount() + 
"\n\n"
@@ -262,7 +277,7 @@
                }
                
                //Generate report
-               if (!parameters.getReportPath().equals("")) 
generateReport(parameters.getReportPath());
+               if (!parameters.getReportPath().equals("")) 
generateReport(parameters.getReportPath(), networkName, pnetNodes1, pnetNodes2, 
pnetEdges1, pnetEdges2, geneticNetwork.numNodes(), geneticNetwork.numEdges(), 
trainingComplexes);
        }
 
        private static int getNumberOfSharedNodes(CyNetwork networkA, CyNetwork 
networkB){
@@ -501,8 +516,64 @@
                return scaledEdgeAttribValues;
        }
        
-       private static void generateReport(String path)
+       private void generateReport(String path, String networkName, int 
pnetNodes1, int pnetNodes2, int pnetEdges1, int pnetEdges2, int gnetNodes, int 
gnetEdges, List<SNodeModule> trainingComplexes)
        {
+               HTMLPage report = new HTMLPage();
+               report.setTitle("PanGIA report: "+networkName);
                
+               HTMLParagraphBlock b = new HTMLParagraphBlock(10);
+               b.add("PanGIA v. "+PanGIAPlugin.VERSION);
+               b.add("Please cite! ...");
+               b.add(networkName);
+               b.add("");
+               b.add("Physical network:");
+               b.add(parameters.getPhysicalNetwork().getIdentifier());
+               boolean isBinary = parameters.getPhysicalEdgeAttrName() == null 
|| parameters.getPhysicalEdgeAttrName().length() == 0;
+               if (isBinary) b.add(parameters.getPhysicalEdgeAttrName()+"  
(binary)");
+               else b.add(parameters.getPhysicalEdgeAttrName()+"  (numeric, 
scaling="+parameters.getPhysicalScalingMethod()+")");
+               b.add("Nodes: "+pnetNodes1+", Edges: "+pnetEdges1+"");
+               int nfd = parameters.getPhysicalNetworkFilterDegree();
+               if (nfd==-1) b.add("Network filter degree: None");
+               else b.add("Network filter degree: "+nfd+"   (Nodes: 
"+pnetNodes2+", Edges: "+pnetEdges2+")");
+               b.add("");
+               
+               b.add("Genetic network:");
+               b.add(parameters.getGeneticNetwork().getIdentifier());
+               isBinary = parameters.getGeneticEdgeAttrName() == null || 
parameters.getGeneticEdgeAttrName().length() == 0;
+               if (isBinary) b.add(parameters.getGeneticEdgeAttrName()+"  
(binary)");
+               else b.add(parameters.getGeneticEdgeAttrName()+"  (numeric, 
scaling="+parameters.getGeneticScalingMethod()+")");
+               b.add("Nodes: "+gnetNodes+", Edges: "+gnetEdges+"");
+               b.add("");
+               
+               if (parameters.getComplexTrainingPhysical() || 
parameters.getComplexTrainingGenetic() || parameters.getComplexAnnotation())
+               {
+                       b.add("Annotation: 
"+parameters.getAnnotationAttrName()+"  ("+trainingComplexes.size()+" 
entries)");
+                       b.add("");
+                       
+                       if (parameters.getComplexTrainingPhysical())
+                       {
+                               b.add("Physical interaction annotation 
enrichment");
+                               float[] x = new 
FloatVector(DoubleVector.getScale(0,100,2).getData()).getData();
+                               float[] y = new 
FloatVector(DoubleVector.times(DoubleVector.rUnif(51),100)).getData();
+                               
+                               b.add("<IMG 
src=\"http://chart.apis.google.com/chart?cht=lxy&chs=500x300&chd=t:"+ListOps.collectionToString(x,",")+"|"+ListOps.collectionToString(y,",")+"&chxr=0,-25,10,5&chxt=x,x,y,y&chxl=1:|Interaction_Score|2:|10^-2|10^-1|10^0|10^1|10^2|10^3|3:|Enrichment&chxp=1,60|3,50&chco=0000FF&chxs=0,000000,12,0,lt|1,000000,12,1,lt|2,000000,12,2,lt|3,000000,12,3,lt&chg=0,100,3,3,0,40\">");
+                               b.add("");
+                       }
+                       
+                       
+               }
+               
+               
+               b.add("Search parameters: alpha="+parameters.getAlpha()+",  
alphaMultiplier="+parameters.getAlphaMultiplier());
+               b.add("Edge filtering: 
pval="+parameters.getPValueThreshold()+",  
samples="+parameters.getNumberOfSamples());
+               
+               //What else to report?
+
+               
+               
+               
+               report.addToBody(b);
+               
+               report.write(path);
        }
 }

Modified: 
csplugins/trunk/ucsd/ruschein/PanGIA/src/org/idekerlab/PanGIAPlugin/ui/SearchPropertyPanel.java
===================================================================
--- 
csplugins/trunk/ucsd/ruschein/PanGIA/src/org/idekerlab/PanGIAPlugin/ui/SearchPropertyPanel.java
     2010-07-28 23:26:56 UTC (rev 21065)
+++ 
csplugins/trunk/ucsd/ruschein/PanGIA/src/org/idekerlab/PanGIAPlugin/ui/SearchPropertyPanel.java
     2010-07-28 23:45:31 UTC (rev 21066)
@@ -734,10 +734,10 @@
        private void 
reportPathButtionActionPerformed(java.awt.event.ActionEvent evt) {
                
                JFileChooser reportFileChooser = new JFileChooser(".");
-               
reportFileChooser.setFileSelectionMode(JFileChooser.FILES_AND_DIRECTORIES);
+               reportFileChooser.setFileSelectionMode(JFileChooser.FILES_ONLY);
                reportFileChooser.setMultiSelectionEnabled(false);
-               reportFileChooser.setDialogTitle("Choose a report folder path");
-               reportFileChooser.setSelectedFile(new File("PanGIA_Report"));
+               reportFileChooser.setDialogTitle("Choose a report path");
+               reportFileChooser.setSelectedFile(new File(new 
File("PanGIA_Report.html").getAbsoluteFile().getName()));
                int returnVal = 
reportFileChooser.showSaveDialog(reportPathButton);
                
                if (returnVal==JFileChooser.APPROVE_OPTION)
@@ -755,6 +755,8 @@
                        reportPathTextField.setToolTipText("");
                        reportPathTextField.setEnabled(false);
                }               
+               
+               updateSearchButtonState();
        }
        
        
@@ -829,7 +831,7 @@
     private JLabel reportPathLabel;
     private JTextField reportPathTextField;
     private JButton reportPathButton;
-    private String reportPath;
+    private String reportPath="";
         
     private JLabel parameterErrorLabel;
     // End of variables declaration                     
@@ -1171,7 +1173,14 @@
                        }
                }
                
+               if (!reportPath.equals("") && new File(reportPath).exists() && 
new File(reportPath).isDirectory())
+               {
+                       searchButton.setEnabled(false);
+                       parameterErrorLabel.setText("Error: Report path cannot 
be a directory.");
+                       return;
+               }
                
+               
                parameterErrorLabel.setText("");
                searchButton.setEnabled(true);
        }

Modified: 
csplugins/trunk/ucsd/ruschein/PanGIA/src/org/idekerlab/PanGIAPlugin/utilities/collections/ListOps.java
===================================================================
--- 
csplugins/trunk/ucsd/ruschein/PanGIA/src/org/idekerlab/PanGIAPlugin/utilities/collections/ListOps.java
      2010-07-28 23:26:56 UTC (rev 21065)
+++ 
csplugins/trunk/ucsd/ruschein/PanGIA/src/org/idekerlab/PanGIAPlugin/utilities/collections/ListOps.java
      2010-07-28 23:45:31 UTC (rev 21066)
@@ -201,7 +201,33 @@
 
                return out;
        }
+       
+       
 
+       public static String collectionToString(double[] st, String delim) {
+               if (st.length == 0)
+                       return "";
+
+               String out = String.valueOf(st[0]);
+
+               for (int i = 1; i < st.length; i++)
+                       out += delim + st[i];
+
+               return out;
+       }
+       
+       public static String collectionToString(float[] st, String delim) {
+               if (st.length == 0)
+                       return "";
+
+               String out = String.valueOf(st[0]);
+
+               for (int i = 1; i < st.length; i++)
+                       out += delim + st[i];
+
+               return out;
+       }
+
        public static String collectionToString(Collection<String> st, String 
delim) {
                String out = "";
 

Modified: 
csplugins/trunk/ucsd/ruschein/PanGIA/src/org/idekerlab/PanGIAPlugin/utilities/html/HTMLPage.java
===================================================================
--- 
csplugins/trunk/ucsd/ruschein/PanGIA/src/org/idekerlab/PanGIAPlugin/utilities/html/HTMLPage.java
    2010-07-28 23:26:56 UTC (rev 21065)
+++ 
csplugins/trunk/ucsd/ruschein/PanGIA/src/org/idekerlab/PanGIAPlugin/utilities/html/HTMLPage.java
    2010-07-28 23:45:31 UTC (rev 21066)
@@ -30,6 +30,11 @@
                body.add(new HTMLTable(st,border,al,width));
        }
        
+       public void addToBody(HTMLBlock b)
+       {
+               body.add(b);
+       }
+       
        public void write(String file)
        {
                BufferedWriter bw = FileUtil.getBufferedWriter(file, false);

Added: 
csplugins/trunk/ucsd/ruschein/PanGIA/src/org/idekerlab/PanGIAPlugin/utilities/html/HTMLParagraphBlock.java
===================================================================
--- 
csplugins/trunk/ucsd/ruschein/PanGIA/src/org/idekerlab/PanGIAPlugin/utilities/html/HTMLParagraphBlock.java
                          (rev 0)
+++ 
csplugins/trunk/ucsd/ruschein/PanGIA/src/org/idekerlab/PanGIAPlugin/utilities/html/HTMLParagraphBlock.java
  2010-07-28 23:45:31 UTC (rev 21066)
@@ -0,0 +1,34 @@
+package org.idekerlab.PanGIAPlugin.utilities.html;
+
+import java.io.BufferedWriter;
+import java.io.IOException;
+
+public class HTMLParagraphBlock extends HTMLTextBlock
+{
+       
+       public HTMLParagraphBlock()
+       {
+               super();
+       }
+       
+       public HTMLParagraphBlock(int numLines)
+       {
+               super(numLines);
+       }
+       
+       protected void write(BufferedWriter bw, int depth)
+       {
+               String tabs = "";
+               for (int i=0;i<depth;i++) tabs+="\t";
+               
+               try
+               {
+                       bw.write(tabs+"<P>\n");
+                       
+                       for (String line : text)
+                               bw.write(tabs+line+"<BR>\n");
+                       
+                       bw.write(tabs+"</P>\n");
+               }catch (IOException e) {e.printStackTrace();}
+       }
+}

Modified: 
csplugins/trunk/ucsd/ruschein/PanGIA/src/org/idekerlab/PanGIAPlugin/utilities/html/HTMLTextBlock.java
===================================================================
--- 
csplugins/trunk/ucsd/ruschein/PanGIA/src/org/idekerlab/PanGIAPlugin/utilities/html/HTMLTextBlock.java
       2010-07-28 23:26:56 UTC (rev 21065)
+++ 
csplugins/trunk/ucsd/ruschein/PanGIA/src/org/idekerlab/PanGIAPlugin/utilities/html/HTMLTextBlock.java
       2010-07-28 23:45:31 UTC (rev 21066)
@@ -38,6 +38,6 @@
                {
                        for (String line : text)
                                bw.write(tabs+line+"\n");
-               }catch (IOException e) {System.out.println("Error 
HTMLPage.write(String): "+e);System.exit(0);}
+               }catch (IOException e) {e.printStackTrace();}
        }
 }

-- 
You received this message because you are subscribed to the Google Groups 
"cytoscape-cvs" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/cytoscape-cvs?hl=en.

Reply via email to