Author: kono
Date: 2010-01-12 11:24:23 -0800 (Tue, 12 Jan 2010)
New Revision: 18876
Removed:
csplugins/trunk/ucsd/ruschein/DenovoPGNetworkAlignment/src/data/GWAS.java
csplugins/trunk/ucsd/ruschein/DenovoPGNetworkAlignment/src/networks/denovoPGNetworkAlignment/CopyOfBFEdge.java
csplugins/trunk/ucsd/ruschein/DenovoPGNetworkAlignment/src/org/cytoscape/DenovoPGNetworkAlignmentPlugin/ResultsPanel.java
csplugins/trunk/ucsd/ruschein/DenovoPGNetworkAlignment/src/structures/Duo.java
csplugins/trunk/ucsd/ruschein/DenovoPGNetworkAlignment/src/utilities/Timing.java
Modified:
csplugins/trunk/ucsd/ruschein/DenovoPGNetworkAlignment/src/data/matrixMath/CholeskyDecomposition.java
csplugins/trunk/ucsd/ruschein/DenovoPGNetworkAlignment/src/data/matrixMath/XXTRunner.java
csplugins/trunk/ucsd/ruschein/DenovoPGNetworkAlignment/src/networks/SDNetwork.java
csplugins/trunk/ucsd/ruschein/DenovoPGNetworkAlignment/src/structures/IntPair.java
csplugins/trunk/ucsd/ruschein/DenovoPGNetworkAlignment/src/utilities/IIterator.java
csplugins/trunk/ucsd/ruschein/DenovoPGNetworkAlignment/src/utilities/MemoryReporter.java
csplugins/trunk/ucsd/ruschein/DenovoPGNetworkAlignment/src/utilities/ThreadPriorityFactory.java
csplugins/trunk/ucsd/ruschein/DenovoPGNetworkAlignment/src/utilities/text/DataFormatter.java
Log:
Some of the unused classes removed.
Deleted:
csplugins/trunk/ucsd/ruschein/DenovoPGNetworkAlignment/src/data/GWAS.java
===================================================================
--- csplugins/trunk/ucsd/ruschein/DenovoPGNetworkAlignment/src/data/GWAS.java
2010-01-12 19:12:43 UTC (rev 18875)
+++ csplugins/trunk/ucsd/ruschein/DenovoPGNetworkAlignment/src/data/GWAS.java
2010-01-12 19:24:23 UTC (rev 18876)
@@ -1,243 +0,0 @@
-package data;
-
-import java.io.BufferedInputStream;
-import java.io.BufferedOutputStream;
-import java.io.BufferedReader;
-import java.io.ByteArrayOutputStream;
-import java.io.DataInputStream;
-import java.io.DataOutputStream;
-import java.io.Externalizable;
-import java.io.FileInputStream;
-import java.io.FileOutputStream;
-import java.io.IOException;
-import java.io.ObjectInput;
-import java.io.ObjectOutput;
-import java.util.zip.Deflater;
-import java.util.zip.DeflaterOutputStream;
-import java.util.zip.InflaterInputStream;
-
-import utilities.files.FileUtil;
-
-/**
- * This class is meant to deal with cases and controls for WTCCC data-set
- * @author rsrivas
- *
- */
-public class GWAS implements Externalizable
-{
-
- private ByteMatrix caseMatrix;
- private ByteMatrix controlMatrix;
- public static final byte lineDelimiter = 3;
- public static final int chrm10 = 16437;
- public static final int chrm11 = 14629;
- public static final int chrm12 = 13271;
- public static final int chrm13 = 9058;
- public static final int chrm14 = 8135;
- public static final int chrm15 = 8205;
- public static final int chrm16 = 7749;
- public static final int chrm17 = 7534;
- public static final int chrm18 = 6723;
- public static final int chrm19 = 4669;
- public static final int chrm1 = 25786;
- public static final int chrm20 = 7634;
- public static final int chrm21 = 3943;
- public static final int chrm22 = 4178;
- public static final int chrm2 = 21138;
- public static final int chrm3 = 18288;
- public static final int chrm4 = 13915;
- public static final int chrm5 = 14902;
- public static final int chrm6 = 17988;
- public static final int chrm7 = 15093;
- public static final int chrm8 = 12561;
- public static final int chrm9 = 13151;
- public static final int chrmX = 5539;
- public static final int ALL = 270526;
- public static final int BD = 1868;
- public static final int CAD = 1926;
- public static final int CD = 1748;
- public static final int control_58C = 1480;
- public static final int control_NBS = 1458;
- public static final int combinedControls =
GWAS.control_58C+GWAS.control_NBS;
- public static final int HT = 1952;
- public static final int RA = 1860;
- public static final int T1D = 1963;
- public static final int T2D = 1924;
- public static final int allDiseases = 16179;
-
-
- public GWAS(String caseMatrixFile, String controlMatrixFile, int
markerSet, int diseaseSet, int controlSet)
- {
-
- caseMatrix = GWAS.readInBinaryFile(caseMatrixFile, markerSet,
diseaseSet);
- controlMatrix = GWAS.readInBinaryFile(controlMatrixFile,
markerSet, controlSet);
- }
-
- public GWAS(String caseMatrixFile, String controlMatrixFile, int
markerSet, int diseaseSet)
- {
- caseMatrix = GWAS.readInBinaryFile(caseMatrixFile, markerSet,
diseaseSet);
- controlMatrix = GWAS.readInBinaryFile(controlMatrixFile,
markerSet, GWAS.combinedControls);
- }
-
- public GWAS(String caseMatrixFile, String controlMatrixFile, int
diseaseSet)
- {
- caseMatrix = GWAS.readInBinaryFile(caseMatrixFile, GWAS.ALL,
diseaseSet);
- controlMatrix = GWAS.readInBinaryFile(caseMatrixFile, GWAS.ALL,
GWAS.combinedControls);
- }
-
- /**
- * Copy constructor
- * @param newCaseMatrix Case matrix to copy
- * @param newControlMatrix Control matrix to copy
- */
- public GWAS(ByteMatrix newCaseMatrix, ByteMatrix newControlMatrix)
- {
- caseMatrix = new ByteMatrix(newCaseMatrix);
- controlMatrix = new ByteMatrix(newControlMatrix);
- }
-
- /**
- * Utility function in order to
- * @param fileName
- */
- public static ByteMatrix readInBinaryFile (String fileName, int
markers, int disease)
- {
- ByteMatrix data = new ByteMatrix(markers,disease,0);
- try
- {
- DataInputStream stream = new DataInputStream(new
BufferedInputStream(new
FileInputStream("/cellar/users/rsrivas/Data/WTCCC/Data/full_data_files/BD/test2.dat")));
- InflaterInputStream in = new
InflaterInputStream(stream);
- ByteArrayOutputStream bout = new
ByteArrayOutputStream(1024);
- int b;
- int row = 0;
- while((b=in.read())!=-1)
- {
- if(b!=GWAS.lineDelimiter)
- bout.write(b);
- else
- {
- data.setRow(row, new
ByteVector(bout.toByteArray()));
- row++;
- bout = new ByteArrayOutputStream(1024);
- }
- }
- in.close();
- bout.close();
-
- /*BinaryFile bin = new BinaryFile(fileName,"r");
- boolean EOF = false;
- int row=0;
- int col=0;
- while(!EOF)
- {
- try
- {
- byte read = bin.readByte();
- //System.out.println(blah1);
- if(read!=GWAS.lineDelimiter)
- {
-
//System.out.println(read+"\t"+col);
- data.set(row, col, read);
- col+=1;
- }
- else
- {
- System.out.println(read);
- row+=1;
- if(row%10000==0)
System.out.println(row+" out of "+markers);
- col=0;
- }
- }
- catch (EOFException e)
- {
- EOF = true;
- }
- }*/
- return data;
- }
- catch (IOException e)
- {
- System.out.println(e.getMessage());
- System.exit(0);
- return null;
- }
- }
-
- /**
- * Utility function in order to convert tab delimited files to a single
binary file
- */
- public static void convertAllTabFiles2BinaryFile (String tabFileDir,
int markerCount, int peopleCount, String diseaseID, String outputFileName)
- {
- //Initialize Byte Matrix
- ByteMatrix data = new ByteMatrix(GWAS.chrm1,GWAS.BD);
-
- //Iterate through all chromosomes in order to read in massive
byte matrix
- System.out.println("Official read in : ");
- //for(Chromosomes chrm : Chromosomes.values())
- String chrm = "1";
- for(int k=0; k<1; k++)
- {
- BufferedReader in =
FileUtil.getBufferedReader(tabFileDir+"/"+diseaseID+"_"+chrm.toString()+".txt");
- System.out.println("Working on "+chrm.toString());
- String line;
- int lineNum = 0;
- int total =
FileUtil.countLines(tabFileDir+"/"+diseaseID+"_"+chrm.toString()+".txt");
- try {
- //while((line=in.readLine())!=null)
- for(int i=0; i<GWAS.chrm1; i++)
- {
- line = in.readLine();
- String[] fields = line.split("\t");
- for(int col=0; col<fields.length; col++)
- //for(int col=0; col<5; col++)
- {
- byte b =
Byte.valueOf(fields[col]);
- data.set(lineNum, col, b);
- }
- lineNum+=1;
- if(lineNum%1000==0)
System.out.println("\t"+lineNum+" out of "+total);
- }
- } catch (IOException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- }
- }
-
- //Output to binary file
- System.out.println("Outputting!");
-
- try
- {
- Deflater d = new Deflater(Deflater.HUFFMAN_ONLY);
- DataOutputStream out = new DataOutputStream(new
BufferedOutputStream(new
FileOutputStream("/cellar/users/rsrivas/Data/WTCCC/Data/full_data_files/BD/test2.dat")));
- DeflaterOutputStream dout = new
DeflaterOutputStream(out,d);
- for(int i=0; i<data.dim(0); i++)
- {
- for(int j=0; j<data.dim(1); j++)
-
dout.write(data.getRow(i).asByteArray());
- dout.write(GWAS.lineDelimiter);
- if(i%10==0) System.out.println("\t"+i+" out of
"+data.dim(0));
- }
- dout.close();
- }
- catch(IOException e)
- {
- System.out.println(e.getMessage());
- System.exit(0);
- }
- }
-
- @Override
- public void readExternal(ObjectInput in) throws
IOException,ClassNotFoundException
- {
-
- }
-
- @Override
- public void writeExternal(ObjectOutput out) throws IOException
- {
-
- }
-
-
-}
Modified:
csplugins/trunk/ucsd/ruschein/DenovoPGNetworkAlignment/src/data/matrixMath/CholeskyDecomposition.java
===================================================================
---
csplugins/trunk/ucsd/ruschein/DenovoPGNetworkAlignment/src/data/matrixMath/CholeskyDecomposition.java
2010-01-12 19:12:43 UTC (rev 18875)
+++
csplugins/trunk/ucsd/ruschein/DenovoPGNetworkAlignment/src/data/matrixMath/CholeskyDecomposition.java
2010-01-12 19:24:23 UTC (rev 18876)
@@ -1,69 +1,63 @@
package data.matrixMath;
-import data.*;
+import data.DoubleMatrix;
+import data.DoubleVector;
-public class CholeskyDecomposition
-{
+public class CholeskyDecomposition {
private double[][] L;
-
- public CholeskyDecomposition(DoubleMatrix a)
- {
+
+ public CholeskyDecomposition(DoubleMatrix a) {
decompose(a);
}
-
- private void decompose(DoubleMatrix a)
- {
+
+ private void decompose(DoubleMatrix a) {
L = new double[a.numRows()][];
-
- for (int i=0;i<a.numRows();i++)
- L[i] = new double[i+1];
-
+
+ for (int i = 0; i < a.numRows(); i++)
+ L[i] = new double[i + 1];
+
L[0][0] = Math.sqrt(a.get(0, 0));
-
- for (int i=1;i<a.numRows();i++)
- {
- for (int j=0;j<L[i].length-1;j++)
- {
+
+ for (int i = 1; i < a.numRows(); i++) {
+ for (int j = 0; j < L[i].length - 1; j++) {
double sum = 0;
-
- for (int k=0;k<j;k++)
- sum += L[i][k]*L[j][k];
-
- L[i][j] = (a.get(i, j)-sum)/L[j][j];
+
+ for (int k = 0; k < j; k++)
+ sum += L[i][k] * L[j][k];
+
+ L[i][j] = (a.get(i, j) - sum) / L[j][j];
}
-
- double sum=0;
- for (int k=0;k<i;k++)
- sum += L[i][k]*L[i][k];
-
-
- if (a.get(i, i)<sum)
- {
- System.err.println("Error
CholeskyDecomposition.decompose(DoubleMatrix): Sqrt(-#) encountered. Entry
matrix is poorly conditioned.");
- }
- else L[i][i] = Math.sqrt(a.get(i, i)-sum);
+
+ double sum = 0;
+ for (int k = 0; k < i; k++)
+ sum += L[i][k] * L[i][k];
+
+ if (a.get(i, i) < sum) {
+ System.err
+ .println("Error
CholeskyDecomposition.decompose(DoubleMatrix): Sqrt(-#) encountered. Entry
matrix is poorly conditioned.");
+ } else
+ L[i][i] = Math.sqrt(a.get(i, i) - sum);
}
-
+
}
-
- public DoubleVector solve(DoubleVector b)
- {
+
+ public DoubleVector solve(DoubleVector b) {
DoubleVector out = b.clone();
-
- for (int j=0;j<L.length-1;j++)
- for (int i=j+1;i<L.length;i++)
-
out.set(i,out.get(i)-L[i][j]/L[j][j]*out.get(j));
-
- for (int i=0;i<out.size();i++)
- out.set(i,out.get(i)/L[i][i]);
-
- for (int i=L.length-1;i>=1;i--)
- for (int j=i-1;j>=0;j--)
-
out.set(j,out.get(j)-L[i][j]/L[i][i]*out.get(i));
-
- for (int i=0;i<out.size();i++)
- out.set(i,out.get(i)/L[i][i]);
-
+
+ for (int j = 0; j < L.length - 1; j++)
+ for (int i = j + 1; i < L.length; i++)
+ out.set(i, out.get(i) - L[i][j] / L[j][j] *
out.get(j));
+
+ for (int i = 0; i < out.size(); i++)
+ out.set(i, out.get(i) / L[i][i]);
+
+ for (int i = L.length - 1; i >= 1; i--)
+ for (int j = i - 1; j >= 0; j--)
+ out.set(j, out.get(j) - L[i][j] / L[i][i] *
out.get(i));
+
+ for (int i = 0; i < out.size(); i++)
+ out.set(i, out.get(i) / L[i][i]);
+
return out;
}
}
Modified:
csplugins/trunk/ucsd/ruschein/DenovoPGNetworkAlignment/src/data/matrixMath/XXTRunner.java
===================================================================
---
csplugins/trunk/ucsd/ruschein/DenovoPGNetworkAlignment/src/data/matrixMath/XXTRunner.java
2010-01-12 19:12:43 UTC (rev 18875)
+++
csplugins/trunk/ucsd/ruschein/DenovoPGNetworkAlignment/src/data/matrixMath/XXTRunner.java
2010-01-12 19:24:23 UTC (rev 18876)
@@ -1,59 +1,51 @@
package data.matrixMath;
-import data.*;
-public class XXTRunner implements Runnable
-{
+public class XXTRunner implements Runnable {
private final double[][] datad;
private final double[][] outd;
private final float[][] dataf;
private final float[][] outf;
private final int i;
-
- public XXTRunner(double[][] data, double[][] out, int i)
- {
+
+ public XXTRunner(double[][] data, double[][] out, int i) {
this.datad = data;
this.outd = out;
this.dataf = null;
this.outf = null;
this.i = i;
}
-
- public XXTRunner(float[][] data, float[][] out, int i)
- {
+
+ public XXTRunner(float[][] data, float[][] out, int i) {
this.dataf = data;
this.outf = out;
this.datad = null;
this.outd = null;
this.i = i;
}
-
- public void run()
- {
- if (datad != null)
- {
- for (int j=0;j<datad.length;j++)
- {
+
+ public void run() {
+ if (datad != null) {
+ for (int j = 0; j < datad.length; j++) {
double sum = 0;
- for (int k=0;k<datad[0].length;k++)
- sum+=datad[j][k]*datad[i][k];
-
+ for (int k = 0; k < datad[0].length; k++)
+ sum += datad[j][k] * datad[i][k];
+
outd[i][j] = sum;
}
}
-
- if (dataf != null)
- {
- for (int j=0;j<dataf.length;j++)
- {
+
+ if (dataf != null) {
+ for (int j = 0; j < dataf.length; j++) {
float sum = 0;
- for (int k=0;k<dataf[0].length;k++)
- sum+=dataf[j][k]*dataf[i][k];
-
+ for (int k = 0; k < dataf[0].length; k++)
+ sum += dataf[j][k] * dataf[i][k];
+
outf[i][j] = sum;
}
}
-
- if (i%100==0) System.out.println(i);
+
+ if (i % 100 == 0)
+ System.out.println(i);
}
}
Modified:
csplugins/trunk/ucsd/ruschein/DenovoPGNetworkAlignment/src/networks/SDNetwork.java
===================================================================
---
csplugins/trunk/ucsd/ruschein/DenovoPGNetworkAlignment/src/networks/SDNetwork.java
2010-01-12 19:12:43 UTC (rev 18875)
+++
csplugins/trunk/ucsd/ruschein/DenovoPGNetworkAlignment/src/networks/SDNetwork.java
2010-01-12 19:24:23 UTC (rev 18876)
@@ -1,25 +1,20 @@
package networks;
-import java.util.*;
-
+import networks.linkedNetworks.TypedLinkNetwork;
import utilities.IIterator;
-import networks.linkedNetworks.*;
-import networks.hashNetworks.*;
-public abstract class SDNetwork extends SNetwork
-{
+public abstract class SDNetwork extends SNetwork {
public abstract double edgeValue(String n1, String n2);
- public abstract TypedLinkNetwork<String,Double> asTypedLinkNetwork();
-
+
+ public abstract TypedLinkNetwork<String, Double> asTypedLinkNetwork();
+
public abstract IIterator<? extends SDEdge> edgeIterator();
-
- public SDNetwork(boolean selfOk, boolean directed)
- {
- super(selfOk,directed);
+
+ public SDNetwork(boolean selfOk, boolean directed) {
+ super(selfOk, directed);
}
-
- public SDNetwork(SNetwork net)
- {
+
+ public SDNetwork(SNetwork net) {
super(net);
}
}
Deleted:
csplugins/trunk/ucsd/ruschein/DenovoPGNetworkAlignment/src/networks/denovoPGNetworkAlignment/CopyOfBFEdge.java
===================================================================
---
csplugins/trunk/ucsd/ruschein/DenovoPGNetworkAlignment/src/networks/denovoPGNetworkAlignment/CopyOfBFEdge.java
2010-01-12 19:12:43 UTC (rev 18875)
+++
csplugins/trunk/ucsd/ruschein/DenovoPGNetworkAlignment/src/networks/denovoPGNetworkAlignment/CopyOfBFEdge.java
2010-01-12 19:24:23 UTC (rev 18876)
@@ -1,238 +0,0 @@
-package networks.denovoPGNetworkAlignment;
-
-import java.util.*;
-
-import networks.linkedNetworks.*;
-
-/***
- * An edge object for use with ONetworks to track statistics for the
HCNetsearch algorithm.
- */
-public class CopyOfBFEdge implements Finalish{
-
- private float link; //Current link score
-
- //Hypothetical merge scores
-
- //Set of new link scores. Each linkscore is a Map<Int,Float>, where the
Int
- //refers to a node and the float is the link score connecting the new
module
- //to that node.
- private
Map<TypedLinkNode<TypedLinkNodeModule<String,CopyOfBFEdge>,CopyOfBFEdge>,Float>
linkscores;
-
- private float complexMerge; //The new complex score
- private float linkMerge; //The sum of all new link scores
- private float global; //The global score change
-
- //Set of interaction types (ie. physical, genetic, etc.)
- private Set<InteractionType> types = new HashSet<InteractionType>(3,1);
-
- public enum InteractionType {Physical, Genetic}
-
- public CopyOfBFEdge()
- {
- }
-
- /**
- * Copy constructor.
- */
- public CopyOfBFEdge(CopyOfBFEdge edge)
- {
- complexMerge = edge.complexMerge;
- linkMerge = edge.linkMerge;
- global = edge.global;
- link = edge.link;
- linkscores = edge.linkscores;
- types = edge.types;
- }
-
- /**
- * Preferred constructor. Initializes the linkscores object for
physical interactions.
- * @param type
- */
- public CopyOfBFEdge(InteractionType type)
- {
- this.types.add(type);
- if (type.equals(InteractionType.Physical)) linkscores = new
HashMap<TypedLinkNode<TypedLinkNodeModule<String,CopyOfBFEdge>,CopyOfBFEdge>,Float>(30);
- }
-
- public float complexMerge()
- {
- return complexMerge;
- }
-
- public float linkMerge()
- {
- return linkMerge;
- }
-
- public float global()
- {
- return global;
- }
-
- public float link()
- {
- return link;
- }
-
- public boolean isType(InteractionType type)
- {
- return types.contains(type);
- }
-
- public void setComplexMerge(float merge)
- {
- this.complexMerge = merge;
- }
-
- public void setLinkMerge(float merge)
- {
- this.linkMerge = merge;
- }
-
- public void setGlobal(float global)
- {
- this.global = global;
- }
-
- public void setLink(float link)
- {
- this.link = link;
- }
-
- /**
- * Adds a given interaction type.
- * If the edge newly becomes physical, this initializes the linkscores
object.
- */
- public void addType(InteractionType type)
- {
- if (!this.isType(InteractionType.Physical))
- {
- this.types.add(type);
- if (this.isType(InteractionType.Physical)) linkscores =
new
HashMap<TypedLinkNode<TypedLinkNodeModule<String,CopyOfBFEdge>,CopyOfBFEdge>,Float>(30);
- }
- else this.types.add(type);
-
- }
-
- /**
- * Adds a set of interaction types.
- * If the edge newly becomes physical, this initializes the linkscores
object.
- */
- public void addType(Set<InteractionType> types)
- {
- if (!this.isType(InteractionType.Physical))
- {
- this.types.addAll(types);
- if (this.isType(InteractionType.Physical)) linkscores =
new
HashMap<TypedLinkNode<TypedLinkNodeModule<String,CopyOfBFEdge>,CopyOfBFEdge>,Float>(30);
- }
- else this.types.addAll(types);
- }
-
- public void
addLinkScore(TypedLinkNode<TypedLinkNodeModule<String,CopyOfBFEdge>,CopyOfBFEdge>
node, float linkscore)
- {
- linkscores.put(node, linkscore);
- }
-
- public void
removeLinkScore(TypedLinkNode<TypedLinkNodeModule<String,CopyOfBFEdge>,CopyOfBFEdge>
node)
- {
- linkscores.remove(node);
- }
-
- public float
getLinkScore(TypedLinkNode<TypedLinkNodeModule<String,CopyOfBFEdge>,CopyOfBFEdge>
node)
- {
- return linkscores.get(node);
- }
-
- public Set<InteractionType> getTypes()
- {
- return types;
- }
-
- public boolean
hasLinkScore(TypedLinkNode<TypedLinkNodeModule<String,CopyOfBFEdge>,CopyOfBFEdge>
node)
- {
- if (linkscores==null) return false;
- return linkscores.containsKey(node);
- }
-
- public float sumPositiveLinkScores()
- {
- float sum = 0;
- for (Float f : this.linkscores.values())
- if (f>0) sum+=f;
-
- return sum;
- }
-
- public float sumLinkScores()
- {
- float sum = 0;
- for (Float f : this.linkscores.values())
- sum+=f;
-
- return sum;
- }
-
- public void clearLinkScores()
- {
- if (linkscores!=null) linkscores = new
HashMap<TypedLinkNode<TypedLinkNodeModule<String,CopyOfBFEdge>,CopyOfBFEdge>,Float>(linkscores.size());
- }
-
- public String toString()
- {
- if (this.types.size()==0) return "";
-
- String out = "";
-
- Iterator<InteractionType> iti = types.iterator();
- out += iti.next().toString();
-
- while (iti.hasNext()) out += ","+iti.next().toString();
-
-
- return out;
- }
-
- public static
Map<TypedLinkNode<TypedLinkNodeModule<String,CopyOfBFEdge>,CopyOfBFEdge>,Float>
mergeLinkScores(CopyOfBFEdge e1, CopyOfBFEdge e2)
- {
-
Map<TypedLinkNode<TypedLinkNodeModule<String,CopyOfBFEdge>,CopyOfBFEdge>,Float>
out = new
HashMap<TypedLinkNode<TypedLinkNodeModule<String,CopyOfBFEdge>,CopyOfBFEdge>,Float>(100);
-
- for
(TypedLinkNode<TypedLinkNodeModule<String,CopyOfBFEdge>,CopyOfBFEdge> node :
e1.linkscores.keySet())
- {
- Float f1 = e1.linkscores.get(node);
- Float f2 = e2.linkscores.get(node);
-
-
- if (f2==null) out.put(node, f1);
- else out.put(node, f1+f2);
- }
-
- for
(TypedLinkNode<TypedLinkNodeModule<String,CopyOfBFEdge>,CopyOfBFEdge> node :
e2.linkscores.keySet())
- {
- Float f1 = e1.linkscores.get(node);
- if (f1==null) out.put(node, e2.linkscores.get(node));
- }
-
- return out;
- }
-
- public void
setLinkScores(Map<TypedLinkNode<TypedLinkNodeModule<String,CopyOfBFEdge>,CopyOfBFEdge>,Float>
hif)
- {
- this.linkscores = hif;
- }
-
- /*Can't think of a useful hashcode that is finalish.
- public int hashCode()
- {
- return linkscores.hashCode();
- }*/
-
- public boolean equals(Object other)
- {
- return this==other;
- }
-
- public int countLinkScores()
- {
- return this.linkscores.size();
- }
-}
Deleted:
csplugins/trunk/ucsd/ruschein/DenovoPGNetworkAlignment/src/org/cytoscape/DenovoPGNetworkAlignmentPlugin/ResultsPanel.java
===================================================================
---
csplugins/trunk/ucsd/ruschein/DenovoPGNetworkAlignment/src/org/cytoscape/DenovoPGNetworkAlignmentPlugin/ResultsPanel.java
2010-01-12 19:12:43 UTC (rev 18875)
+++
csplugins/trunk/ucsd/ruschein/DenovoPGNetworkAlignment/src/org/cytoscape/DenovoPGNetworkAlignmentPlugin/ResultsPanel.java
2010-01-12 19:24:23 UTC (rev 18876)
@@ -1,290 +0,0 @@
-package org.cytoscape.DenovoPGNetworkAlignmentPlugin;
-
-import java.util.*;
-import javax.swing.*;
-import javax.swing.table.*;
-import java.awt.*;
-import java.awt.event.*;
-
-import cytoscape.Cytoscape;
-import cytoscape.CyNetwork;
-import cytoscape.util.CyNetworkNaming;
-import cytoscape.view.cytopanels.CytoPanel;
-import giny.model.Node;
-import giny.model.RootGraph;
-
-public class ResultsPanel extends JPanel
-{
- enum NewNetworkType { SINGLE_NETWORK, MULTIPLE_NETWORKS };
-
- CyNetwork parentNetwork;
- java.util.List<Result> results;
- NewNetworkType newNetworkType = NewNetworkType.MULTIPLE_NETWORKS;
- ResultsTable resultsTable;
- OptionsDialog optionsDialog = new OptionsDialog();
- JButton createNetworkButton;
-
- public ResultsPanel(CyNetwork parentNetwork, java.util.List<Result>
results)
- {
- this.parentNetwork = parentNetwork;
- this.results = results;
-
- resultsTable = new ResultsTable();
- JScrollPane resultsScrollPane = new JScrollPane(resultsTable);
- createNetworkButton = new JButton("Create Selected Networks");
- createNetworkButton.setEnabled(false);
- createNetworkButton.addActionListener(new
CreateNetworkAction());
- JButton createAllNetworksButton = new JButton("Create All
Networks");
- createAllNetworksButton.addActionListener(new
CreateAllNetworksAction());
- JButton optionsButton = new JButton("Options...");
- optionsButton.addActionListener(new OptionsListener());
- JButton closeButton = new JButton("Close");
- closeButton.addActionListener(new CloseAction());
-
- JPanel buttonsPanel = new JPanel(new FlowLayout());
- buttonsPanel.add(createNetworkButton);
- buttonsPanel.add(createAllNetworksButton);
- buttonsPanel.add(optionsButton);
- buttonsPanel.add(closeButton);
-
- setLayout(new GridBagLayout());
- GridBagConstraints c = new GridBagConstraints();
- c.insets = new Insets(5,5,5,5);
- c.gridx = 0; c.gridy = 0;
- c.gridwidth = 1; c.gridheight = 1;
- c.fill = GridBagConstraints.BOTH;
- c.weightx = 1.0; c.weighty = 1.0;
- add(resultsScrollPane, c);
-
- c.gridx = 0; c.gridy = 1;
- c.weightx = 1.0; c.weighty = 0.0;
- add(buttonsPanel, c);
- }
-
- private class OptionsListener implements ActionListener
- {
- public void actionPerformed(ActionEvent e)
- {
- optionsDialog.setVisible(true);
- }
- }
-
- private class CloseAction implements ActionListener
- {
- public void actionPerformed(ActionEvent e)
- {
- CytoPanel cytoPanel =
Cytoscape.getDesktop().getCytoPanel(SwingConstants.EAST);
- cytoPanel.remove(ResultsPanel.this);
- }
- }
-
- private class CreateNetworkAction implements ActionListener
- {
- public void actionPerformed(ActionEvent e)
- {
- int[] rows = resultsTable.getSelectedRows();
- ArrayList<Result> modules = new ArrayList<Result>();
- for (int i = 0; i < rows.length; i++)
- modules.add(results.get(rows[i]));
- createNetworks(modules);
- }
- }
-
- private class CreateAllNetworksAction implements ActionListener
- {
- public void actionPerformed(ActionEvent e)
- {
- createNetworks(results);
- }
- }
-
- private void createNetworks(java.util.List<Result> modules)
- {
- if (newNetworkType == NewNetworkType.SINGLE_NETWORK)
- {
- Set moduleNodes = new HashSet();
- Iterator parentNodes = parentNetwork.nodesIterator();
- while (parentNodes.hasNext())
- {
- Node node = (Node) parentNodes.next();
- for (Result module : modules)
- if
(module.memberNodes.contains(node.getIdentifier()))
- moduleNodes.add(node);
- }
-
- CyNetwork newNetwork =
Cytoscape.createNetwork(moduleNodes, parentNetwork.getConnectingEdges(new
ArrayList(moduleNodes)),
CyNetworkNaming.getSuggestedSubnetworkTitle(parentNetwork), parentNetwork);
-
- if
(Cytoscape.getNetworkView(newNetwork.getIdentifier()) != null)
-
Cytoscape.getNetworkView(newNetwork.getIdentifier()).redrawGraph(true, true);
- }
- else if (newNetworkType == NewNetworkType.MULTIPLE_NETWORKS)
- {
- for (Result module : modules)
- {
- Set moduleNodes = new HashSet();
- Iterator parentNodes =
parentNetwork.nodesIterator();
- while (parentNodes.hasNext())
- {
- Node node = (Node) parentNodes.next();
- if
(module.memberNodes.contains(node.getIdentifier()))
- moduleNodes.add(node);
- }
-
- CyNetwork newNetwork =
Cytoscape.createNetwork(moduleNodes, parentNetwork.getConnectingEdges(new
ArrayList(moduleNodes)), module.startNode, parentNetwork);
-
- if
(Cytoscape.getNetworkView(newNetwork.getIdentifier()) != null)
-
Cytoscape.getNetworkView(newNetwork.getIdentifier()).redrawGraph(true, true);
- }
- }
- }
-
- class OptionsDialog extends JDialog
- {
- JComboBox newNetworkComboBox;
- public OptionsDialog()
- {
- super(Cytoscape.getDesktop(), "DenovoPGNetworkAlignment
Results: Options");
-
- JLabel newNetworkLabel = new JLabel("Create a new
network:");
- String[] newNetworkOptions = { "For each module", "With
all modules" };
- newNetworkComboBox = new JComboBox(newNetworkOptions);
- if (newNetworkType == NewNetworkType.SINGLE_NETWORK)
- newNetworkComboBox.setSelectedIndex(1);
- else if (newNetworkType ==
NewNetworkType.MULTIPLE_NETWORKS)
- newNetworkComboBox.setSelectedIndex(0);
- JButton okButton = new JButton(" OK ");
- okButton.addActionListener(new OKAction());
- JButton cancelButton = new JButton("Cancel");
- cancelButton.addActionListener(new CancelAction());
-
- JPanel newNetworkPanel = new JPanel(new
FlowLayout(FlowLayout.LEFT));
-
newNetworkPanel.setBorder(BorderFactory.createTitledBorder("New Network"));
- newNetworkPanel.add(newNetworkLabel);
- newNetworkPanel.add(newNetworkComboBox);
-
- JPanel buttonsPanel = new JPanel(new
FlowLayout(FlowLayout.RIGHT));
- buttonsPanel.add(cancelButton);
- buttonsPanel.add(okButton);
-
- setLayout(new GridBagLayout());
- GridBagConstraints c = new GridBagConstraints();
- c.insets = new Insets(5,5,5,5);
-
- c.gridx = 0; c.gridy = 0;
- c.gridwidth = 1; c.gridheight = 1;
- c.fill = GridBagConstraints.HORIZONTAL;
- c.weightx = 1.0; c.weighty = 0.0;
- add(newNetworkPanel, c);
-
- c.gridx = 0; c.gridy = 1;
- c.weightx = 1.0; c.weighty = 1.0;
- c.anchor = GridBagConstraints.LAST_LINE_END;
- add(buttonsPanel, c);
-
- setDefaultCloseOperation(JDialog.HIDE_ON_CLOSE);
- pack();
- }
-
- class OKAction implements ActionListener
- {
- public void actionPerformed(ActionEvent e)
- {
- if (newNetworkComboBox.getSelectedIndex() == 0)
- newNetworkType =
NewNetworkType.MULTIPLE_NETWORKS;
- else if (newNetworkComboBox.getSelectedIndex()
== 1)
- newNetworkType =
NewNetworkType.SINGLE_NETWORK;
- OptionsDialog.this.setVisible(false);
- }
- }
-
- class CancelAction implements ActionListener
- {
- public void actionPerformed(ActionEvent e)
- {
- OptionsDialog.this.setVisible(false);
- }
- }
- }
-
- class ResultsTable extends JTable
- {
- private final String[] columnNames = {"Start Node", "Module
Score", "ST1 P-Value", "ST2 P-Value", "ST3 P-Value"};
-
- public ResultsTable()
- {
- setModel(new ResultsTableModel());
- addMouseListener(new ResultsTableMouseListener());
- }
-
- class ResultsTableModel extends AbstractTableModel
- {
- public String getColumnName(int c)
- {
- return columnNames[c];
- }
-
- public int getRowCount()
- {
- return results.size();
- }
-
- public int getColumnCount()
- {
- return columnNames.length;
- }
-
- public Class getColumnClass(int c)
- {
- return String.class;
- }
-
- public Object getValueAt(int row, int col)
- {
- Result result = results.get(row);
- switch (col)
- {
- case 0: return result.startNode;
- case 1: return
Double.toString(result.moduleScore);
- case 2: return
Double.toString(result.st1Pval);
- case 3: return
Double.toString(result.st2Pval);
- case 4: return
Double.toString(result.st3Pval);
- }
- return null;
- }
-
- public boolean isCellEditable(int row, int col)
- {
- return false;
- }
- }
-
- class ResultsTableMouseListener extends MouseAdapter
- {
- public void mouseClicked(MouseEvent e)
- {
- int row =
ResultsTable.this.rowAtPoint(e.getPoint());
- Result module = results.get(row);
- parentNetwork.unselectAllNodes();
- parentNetwork.unselectAllEdges();
-
- Iterator nodes = parentNetwork.nodesIterator();
- while (nodes.hasNext())
- {
- Node node = (Node) nodes.next();
- if
(module.memberNodes.contains(node.getIdentifier()))
-
parentNetwork.setSelectedNodeState(node, true);
- }
-
-
Cytoscape.getNetworkView(parentNetwork.getIdentifier()).redrawGraph(true,
false);
- }
-
- public void mouseReleased(MouseEvent e)
- {
- if (ResultsTable.this.getSelectedRowCount() ==
0)
- createNetworkButton.setEnabled(false);
- else
- createNetworkButton.setEnabled(true);
- }
- }
- }
-}
Deleted:
csplugins/trunk/ucsd/ruschein/DenovoPGNetworkAlignment/src/structures/Duo.java
===================================================================
---
csplugins/trunk/ucsd/ruschein/DenovoPGNetworkAlignment/src/structures/Duo.java
2010-01-12 19:12:43 UTC (rev 18875)
+++
csplugins/trunk/ucsd/ruschein/DenovoPGNetworkAlignment/src/structures/Duo.java
2010-01-12 19:24:23 UTC (rev 18876)
@@ -1,80 +0,0 @@
-package structures;
-
-public class Duo<T1,T2> {
-
- protected T1 i1;
- protected T2 i2;
-
- /**
- * Copy constructor
- * @param inter Interaction you wish to copy
- */
- public Duo(Duo<T1,T2> inter)
- {
- i1 = inter.getI1();
- i2 = inter.getI2();
- }
-
- public Duo(T1 s1, T2 s2)
- {
- i1 = s1;
- i2 = s2;
- }
-
- public T1 getI1()
- {
- return i1;
- }
-
- public T2 getI2()
- {
- return i2;
- }
-
- public void setI1(T1 val)
- {
- i1 = val;
- }
-
- public void setI2(T2 val)
- {
- i2 = val;
- }
-
- public boolean contains(Object o)
- {
- return (i1.equals(o) || i2.equals(o));
- }
-
- @SuppressWarnings("unchecked")
- @Override
- public boolean equals(Object inter)
- {
- if (inter == null) return false;
- if (inter instanceof Duo)
- {
- Duo other = (Duo)inter;
- if (i1.equals(other.getI1()) &&
i2.equals(other.getI2())) return true;
- else return false;
- }else return false;
- }
-
- @Override
- public int hashCode()
- {
- return i1.hashCode()+i2.hashCode();
- }
-
- @Override
- public Duo<T1,T2> clone()
- {
- Duo<T1,T2> newint = new Duo<T1,T2>(i1,i2);
-
- return newint;
- }
-
- public String toString()
- {
- return i1.toString()+"-"+i2.toString();
- }
-}
Modified:
csplugins/trunk/ucsd/ruschein/DenovoPGNetworkAlignment/src/structures/IntPair.java
===================================================================
---
csplugins/trunk/ucsd/ruschein/DenovoPGNetworkAlignment/src/structures/IntPair.java
2010-01-12 19:12:43 UTC (rev 18875)
+++
csplugins/trunk/ucsd/ruschein/DenovoPGNetworkAlignment/src/structures/IntPair.java
2010-01-12 19:24:23 UTC (rev 18876)
@@ -1,77 +1,76 @@
package structures;
+import java.io.BufferedWriter;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
-import utilities.files.*;
-import java.io.*;
+import utilities.files.FileIterator;
+import utilities.files.FileUtil;
public class IntPair {
public final int n1;
public final int n2;
- public IntPair(int n1, int n2)
- {
+ public IntPair(int n1, int n2) {
this.n1 = n1;
this.n2 = n2;
}
-
- public int hashCode()
- {
- return n1+n2;
+
+ public int hashCode() {
+ return n1 + n2;
}
-
- public boolean equals(Object p)
- {
- if (p == null) return false;
- if (p instanceof IntPair)
- {
- IntPair other = (IntPair)p;
- if ((other.n1 == this.n1 && other.n2 == this.n2) ||
(other.n1 == this.n2 && other.n2 == this.n1)) return true;
- else return false;
- }else return false;
+
+ public boolean equals(Object p) {
+ if (p == null)
+ return false;
+ if (p instanceof IntPair) {
+ IntPair other = (IntPair) p;
+ if ((other.n1 == this.n1 && other.n2 == this.n2)
+ || (other.n1 == this.n2 && other.n2 ==
this.n1))
+ return true;
+ else
+ return false;
+ } else
+ return false;
}
-
- public String toString()
- {
- return n1+"-"+n2;
+
+ public String toString() {
+ return n1 + "-" + n2;
}
-
- public String toStringInOrder()
- {
- return (n1<n2 ? this.toString():n2+"-"+n1);
+
+ public String toStringInOrder() {
+ return (n1 < n2 ? this.toString() : n2 + "-" + n1);
}
-
- public int size()
- {
- return n2-n1+1;
+
+ public int size() {
+ return n2 - n1 + 1;
}
-
- public static List<IntPair> loadList(String file)
- {
+
+ public static List<IntPair> loadList(String file) {
List<IntPair> out = new
ArrayList<IntPair>(FileUtil.countLines(file));
-
- for (String line : new FileIterator(file))
- {
+
+ for (String line : new FileIterator(file)) {
String[] cols = line.split("\t");
- out.add(new
IntPair(Integer.valueOf(cols[0]),Integer.valueOf(cols[1])));
+ out.add(new IntPair(Integer.valueOf(cols[0]), Integer
+ .valueOf(cols[1])));
}
-
+
return out;
}
-
- public static void saveList(Collection<IntPair> pairs, String file)
- {
+
+ public static void saveList(Collection<IntPair> pairs, String file) {
BufferedWriter bw = FileUtil.getBufferedWriter(file, false);
-
- try
- {
+
+ try {
for (IntPair ip : pairs)
- bw.write(ip.n1+"\t"+ip.n2+"\n");
-
+ bw.write(ip.n1 + "\t" + ip.n2 + "\n");
+
bw.close();
- }catch (Exception e) {System.out.println(e.getMessage());
e.printStackTrace();}
+ } catch (Exception e) {
+ System.out.println(e.getMessage());
+ e.printStackTrace();
+ }
}
}
Modified:
csplugins/trunk/ucsd/ruschein/DenovoPGNetworkAlignment/src/utilities/IIterator.java
===================================================================
---
csplugins/trunk/ucsd/ruschein/DenovoPGNetworkAlignment/src/utilities/IIterator.java
2010-01-12 19:12:43 UTC (rev 18875)
+++
csplugins/trunk/ucsd/ruschein/DenovoPGNetworkAlignment/src/utilities/IIterator.java
2010-01-12 19:24:23 UTC (rev 18876)
@@ -2,24 +2,18 @@
import java.util.Iterator;
-public final class IIterator<T> implements Iterable<T>
-{
+public final class IIterator<T> implements Iterable<T> {
private final Iterator<T> iter;
-
-
- public IIterator(Iterator<T> iterator)
- {
+
+ public IIterator(Iterator<T> iterator) {
this.iter = iterator;
}
-
- public Iterator<T> iterator()
- {
+
+ public Iterator<T> iterator() {
return iter;
}
- public T next()
- {
+ public T next() {
return iter.next();
}
}
-
Modified:
csplugins/trunk/ucsd/ruschein/DenovoPGNetworkAlignment/src/utilities/MemoryReporter.java
===================================================================
---
csplugins/trunk/ucsd/ruschein/DenovoPGNetworkAlignment/src/utilities/MemoryReporter.java
2010-01-12 19:12:43 UTC (rev 18875)
+++
csplugins/trunk/ucsd/ruschein/DenovoPGNetworkAlignment/src/utilities/MemoryReporter.java
2010-01-12 19:24:23 UTC (rev 18876)
@@ -6,21 +6,21 @@
public class MemoryReporter {
- public static void reportMemoryUsage()
- {
+ public static void reportMemoryUsage() {
List<MemoryPoolMXBean> mp =
ManagementFactory.getMemoryPoolMXBeans();
-
+
long used = 0;
long committed = 0;
long mmax = 0;
-
- for (MemoryPoolMXBean mpb : mp)
- {
+
+ for (MemoryPoolMXBean mpb : mp) {
used += mpb.getUsage().getUsed();
committed += mpb.getUsage().getCommitted();
mmax += mpb.getUsage().getMax();
}
-
- System.out.println("Memory Usage:
"+used/1048576+"M/"+committed/1048576+"M/"+mmax/1048576+"M,
"+(float)used/mmax*100+"%");
+
+ System.out.println("Memory Usage: " + used / 1048576 + "M/" +
committed
+ / 1048576 + "M/" + mmax / 1048576 + "M, " +
(float) used / mmax
+ * 100 + "%");
}
}
Modified:
csplugins/trunk/ucsd/ruschein/DenovoPGNetworkAlignment/src/utilities/ThreadPriorityFactory.java
===================================================================
---
csplugins/trunk/ucsd/ruschein/DenovoPGNetworkAlignment/src/utilities/ThreadPriorityFactory.java
2010-01-12 19:12:43 UTC (rev 18875)
+++
csplugins/trunk/ucsd/ruschein/DenovoPGNetworkAlignment/src/utilities/ThreadPriorityFactory.java
2010-01-12 19:24:23 UTC (rev 18876)
@@ -1,22 +1,18 @@
package utilities;
-import java.util.concurrent.*;
+import java.util.concurrent.ThreadFactory;
-public final class ThreadPriorityFactory implements ThreadFactory
-{
- private final int priority;
-
- public ThreadPriorityFactory(int priority)
- {
+public final class ThreadPriorityFactory implements ThreadFactory {
+ private final int priority;
+
+ public ThreadPriorityFactory(int priority) {
this.priority = priority;
}
-
-
- public Thread newThread(Runnable r)
- {
+
+ public Thread newThread(Runnable r) {
Thread t = new Thread(r);
t.setPriority(priority);
return t;
}
-
+
}
Deleted:
csplugins/trunk/ucsd/ruschein/DenovoPGNetworkAlignment/src/utilities/Timing.java
===================================================================
---
csplugins/trunk/ucsd/ruschein/DenovoPGNetworkAlignment/src/utilities/Timing.java
2010-01-12 19:12:43 UTC (rev 18875)
+++
csplugins/trunk/ucsd/ruschein/DenovoPGNetworkAlignment/src/utilities/Timing.java
2010-01-12 19:24:23 UTC (rev 18876)
@@ -1,147 +0,0 @@
-package utilities;
-
-import java.util.ArrayList;
-import java.util.List;
-
-public class Timing {
-
- private long starttime;
- private long runtime=0;
- private String name="";
- private List<Timing> blocks=new ArrayList<Timing>();
- private boolean running=false;
-
- public Timing(String name)
- {
- this.name = name;
- }
-
- public Timing()
- {
- }
-
- public void start()
- {
- running = true;
- starttime = System.nanoTime();
- }
-
- public void start(String name)
- {
- Timing t = get(name);
-
- if (t==null)
- {
- Timing newt = new Timing(name);
- blocks.add(newt);
- newt.start();
-
- //return newt;
- }else
- {
- t.start();
- }
-
- //return this;
- }
-
- public void startblock(String name)
- {
- if (blocks.size()>0)
- {
- Timing runner = getRunner();
- if (runner!=null) runner.startblock(name);
- else this.start(name);
- }else this.start(name);
- }
-
- public void stopblock()
- {
- if (blocks.size()>0)
- {
- Timing runner = getRunner();
- if (runner!=null) runner.stopblock();
- else this.stop();
- }else this.stop();
- }
-
- private Timing getRunner()
- {
- for (Timing t : blocks)
- if (t.running) return t;
-
- return null;
- }
-
- public void stop()
- {
- if (!this.running) return;
-
- runtime += System.nanoTime()-starttime;
-
- this.running = false;
-
- for (Timing t : blocks)
- t.stop();
- }
-
- public String toString()
- {
- return this.name+": "+getReadableTime(this.runtime);
- }
-
- /*
- public void stop(String name)
- {
- this.get(name).stop();
- }*/
-
- public Timing get(String name)
- {
- for (Timing t : blocks)
- if (t.name == name) return t;
-
- return null;
- }
-
- public long runtime()
- {
- return runtime;
- }
-
- public void printResults()
- {
- printResults(0,this.runtime);
- }
-
- private void printResults(int level, long totalruntime)
- {
- for (int leveltemp = level;leveltemp>0;leveltemp--)
- System.out.print("->");
-
- System.out.printf(this.name+":
"+getReadableTime(this.runtime)+",
%3.3f%%\n",((double)this.runtime/totalruntime*100.0));
-
- for (Timing t : blocks)
- t.printResults(level+1,totalruntime);
- }
-
- public static String getReadableTime(long time)
- {
- if (time>8.64e13) return time/8.64e13 + " (day)";
- if (time>3.6e12) return time/3.6e12 + " (hr)";
- if (time>6e10) return time/6e10 + " (min)";
- if (time>1e9) return time/1e9+" (sec)";
- if (time>1e6) return time/1e6+" (ms)";
- if (time>1e3) return time/1e3+" (us)";
- return time+" (ns)";
- }
-
- public static String getReadableTime(int milliseconds)
- {
- if (milliseconds>8.64e7) return milliseconds/8.64e7 + " (day)";
- if (milliseconds>3.6e6) return milliseconds/3.6e6 + " (hr)";
- if (milliseconds>6e4) return milliseconds/6e4 + " (min)";
- if (milliseconds>1e3) return milliseconds/1e3+" (sec)";
- return milliseconds+" (ms)";
- }
-}
Modified:
csplugins/trunk/ucsd/ruschein/DenovoPGNetworkAlignment/src/utilities/text/DataFormatter.java
===================================================================
---
csplugins/trunk/ucsd/ruschein/DenovoPGNetworkAlignment/src/utilities/text/DataFormatter.java
2010-01-12 19:12:43 UTC (rev 18875)
+++
csplugins/trunk/ucsd/ruschein/DenovoPGNetworkAlignment/src/utilities/text/DataFormatter.java
2010-01-12 19:24:23 UTC (rev 18876)
@@ -2,12 +2,12 @@
import java.text.NumberFormat;
-public class DataFormatter
-{
- public static String printRatio(Number n1, Number n2)
- {
- String frac =
String.valueOf(n1.doubleValue()/n2.doubleValue()*100);
- return NumberFormat.getInstance().format(n1)+" /
"+NumberFormat.getInstance().format(n2)+"
("+frac.substring(0,frac.indexOf("."))+"%)";
+public class DataFormatter {
+ public static String printRatio(Number n1, Number n2) {
+ String frac = String.valueOf(n1.doubleValue() /
n2.doubleValue() * 100);
+ return NumberFormat.getInstance().format(n1) + " / "
+ + NumberFormat.getInstance().format(n2) + " ("
+ + frac.substring(0, frac.indexOf(".")) + "%)";
}
-
+
}
--
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.