Author: ruschein
Date: 2010-01-13 15:42:04 -0800 (Wed, 13 Jan 2010)
New Revision: 18899
Modified:
csplugins/trunk/ucsd/ruschein/DenovoPGNetworkAlignment/build.xml
csplugins/trunk/ucsd/ruschein/DenovoPGNetworkAlignment/src/data/FloatVector.java
csplugins/trunk/ucsd/ruschein/DenovoPGNetworkAlignment/src/data/IntMatrix.java
csplugins/trunk/ucsd/ruschein/DenovoPGNetworkAlignment/src/networks/matrixNetworks/FloatMatrixNetwork.java
csplugins/trunk/ucsd/ruschein/DenovoPGNetworkAlignment/src/org/cytoscape/DenovoPGNetworkAlignmentPlugin/ConvertCyNetworkToSFNetworks.java
csplugins/trunk/ucsd/ruschein/DenovoPGNetworkAlignment/src/org/cytoscape/DenovoPGNetworkAlignmentPlugin/NestedNetworkCreator.java
csplugins/trunk/ucsd/ruschein/DenovoPGNetworkAlignment/src/utilities/ByteConversion.java
csplugins/trunk/ucsd/ruschein/DenovoPGNetworkAlignment/src/utilities/collections/ListOps.java
Log:
Fixed compiler warnings.
Modified: csplugins/trunk/ucsd/ruschein/DenovoPGNetworkAlignment/build.xml
===================================================================
--- csplugins/trunk/ucsd/ruschein/DenovoPGNetworkAlignment/build.xml
2010-01-13 23:28:31 UTC (rev 18898)
+++ csplugins/trunk/ucsd/ruschein/DenovoPGNetworkAlignment/build.xml
2010-01-13 23:42:04 UTC (rev 18899)
@@ -86,9 +86,7 @@
deprecation="${deprecation}"
optimize="${optimize}"
fork="${fork}">
-<!--
<compilerarg line="-Xlint:all -Xlint:-path"/>
--->
</javac>
<echo message="Successfully ran compile task!"/>
</target>
Modified:
csplugins/trunk/ucsd/ruschein/DenovoPGNetworkAlignment/src/data/FloatVector.java
===================================================================
---
csplugins/trunk/ucsd/ruschein/DenovoPGNetworkAlignment/src/data/FloatVector.java
2010-01-13 23:28:31 UTC (rev 18898)
+++
csplugins/trunk/ucsd/ruschein/DenovoPGNetworkAlignment/src/data/FloatVector.java
2010-01-13 23:42:04 UTC (rev 18899)
@@ -250,7 +250,7 @@
}
public float getAsFloat(int i) {
- return (float) get(i);
+ return get(i);
}
public float get(int i) {
Modified:
csplugins/trunk/ucsd/ruschein/DenovoPGNetworkAlignment/src/data/IntMatrix.java
===================================================================
---
csplugins/trunk/ucsd/ruschein/DenovoPGNetworkAlignment/src/data/IntMatrix.java
2010-01-13 23:28:31 UTC (rev 18898)
+++
csplugins/trunk/ucsd/ruschein/DenovoPGNetworkAlignment/src/data/IntMatrix.java
2010-01-13 23:42:04 UTC (rev 18899)
@@ -164,7 +164,7 @@
for (int i=0;i<dim(0);i++)
for (int j=0;j<dim(1);j++)
- da[i][j] = (int)get(i,j);
+ da[i][j] = get(i,j);
return da;
}
@@ -1091,7 +1091,7 @@
public int getAsInteger(int i, int j)
{
- return((int)data[i][j]);
+ return data[i][j];
}
public IntMatrix xxT()
Modified:
csplugins/trunk/ucsd/ruschein/DenovoPGNetworkAlignment/src/networks/matrixNetworks/FloatMatrixNetwork.java
===================================================================
---
csplugins/trunk/ucsd/ruschein/DenovoPGNetworkAlignment/src/networks/matrixNetworks/FloatMatrixNetwork.java
2010-01-13 23:28:31 UTC (rev 18898)
+++
csplugins/trunk/ucsd/ruschein/DenovoPGNetworkAlignment/src/networks/matrixNetworks/FloatMatrixNetwork.java
2010-01-13 23:42:04 UTC (rev 18899)
@@ -129,12 +129,12 @@
for (int i=0;i<this.connectivity.length;i++)
for (int j=0;j<this.connectivity[i].length;j++)
- out[i][j] = (float)this.connectivity[i][j];
+ out[i][j] = this.connectivity[i][j];
if (!this.directed)
for (int i=0;i<this.connectivity.length;i++)
for (int j=0;j<this.connectivity[i].length;j++)
- out[j][i] =
(float)this.connectivity[i][j];
+ out[j][i] = this.connectivity[i][j];
if (!this.selfOk)
for (int i=0;i<this.connectivity.length;i++)
Modified:
csplugins/trunk/ucsd/ruschein/DenovoPGNetworkAlignment/src/org/cytoscape/DenovoPGNetworkAlignmentPlugin/ConvertCyNetworkToSFNetworks.java
===================================================================
---
csplugins/trunk/ucsd/ruschein/DenovoPGNetworkAlignment/src/org/cytoscape/DenovoPGNetworkAlignmentPlugin/ConvertCyNetworkToSFNetworks.java
2010-01-13 23:28:31 UTC (rev 18898)
+++
csplugins/trunk/ucsd/ruschein/DenovoPGNetworkAlignment/src/org/cytoscape/DenovoPGNetworkAlignmentPlugin/ConvertCyNetworkToSFNetworks.java
2010-01-13 23:42:04 UTC (rev 18899)
@@ -72,22 +72,23 @@
geneticNetwork = new FloatHashNetwork(/* selfOk = */false, /*
directed = */
false, /* startsize = */1);
- for (final CyEdge edge : (List<CyEdge>)
inputNetwork.edgesList()) {
+ @SuppressWarnings("unchecked") List<CyEdge> edges =
(List<CyEdge>)inputNetwork.edgesList();
+ for (final CyEdge edge : edges) {
final String edgeID = edge.getIdentifier();
- final Double physicalAttrValue =
edgeAttributes.getDoubleAttribute(
- edgeID, physicalNetworkAttrName);
+ final Double physicalAttrValue =
+ edgeAttributes.getDoubleAttribute(edgeID,
physicalNetworkAttrName);
if (physicalAttrValue != null)
-
physicalNetwork.add(edge.getSource().getIdentifier(), edge
- .getTarget().getIdentifier(),
physicalAttrValue
- .floatValue());
+
physicalNetwork.add(edge.getSource().getIdentifier(),
+
edge.getTarget().getIdentifier(),
+
physicalAttrValue.floatValue());
- final Double geneticAttrValue =
edgeAttributes.getDoubleAttribute(
- edgeID, geneticNetworkAttrName);
+ final Double geneticAttrValue =
+ edgeAttributes.getDoubleAttribute(edgeID,
geneticNetworkAttrName);
if (geneticAttrValue != null)
-
geneticNetwork.add(edge.getSource().getIdentifier(), edge
- .getTarget().getIdentifier(),
geneticAttrValue
- .floatValue());
+
geneticNetwork.add(edge.getSource().getIdentifier(),
+
edge.getTarget().getIdentifier(),
+
geneticAttrValue.floatValue());
}
}
Modified:
csplugins/trunk/ucsd/ruschein/DenovoPGNetworkAlignment/src/org/cytoscape/DenovoPGNetworkAlignmentPlugin/NestedNetworkCreator.java
===================================================================
---
csplugins/trunk/ucsd/ruschein/DenovoPGNetworkAlignment/src/org/cytoscape/DenovoPGNetworkAlignmentPlugin/NestedNetworkCreator.java
2010-01-13 23:28:31 UTC (rev 18898)
+++
csplugins/trunk/ucsd/ruschein/DenovoPGNetworkAlignment/src/org/cytoscape/DenovoPGNetworkAlignmentPlugin/NestedNetworkCreator.java
2010-01-13 23:42:04 UTC (rev 18899)
@@ -20,10 +20,11 @@
import cytoscape.view.CyNetworkView;
/**
+ * @author ruschein
* Creates an overview network for the detected complexes and nested networks
* for each complex.
*/
-public class NestedNetworkCreator {
+...@suppresswarnings("unchecked") public class NestedNetworkCreator {
// Package private constants.
static final String GENE_COUNT = "gene count";
@@ -44,8 +45,11 @@
* the network that the overview network was generated from
*/
NestedNetworkCreator(
- final TypedLinkNetwork<TypedLinkNodeModule<String,
BFEdge>, BFEdge> networkOfModules,
- final CyNetwork originalNetwork) {
+ final TypedLinkNetwork<TypedLinkNodeModule<String, BFEdge>,
BFEdge> networkOfModules,
+ final CyNetwork originalNetwork,
+ final TypedLinkNetwork<String, Float> physicalNetwork,
+ final TypedLinkNetwork<String, Float> geneticNetwork)
+ {
moduleToCyNodeMap = new HashMap<TypedLinkNodeModule<String,
BFEdge>, CyNode>();
overviewNetwork = Cytoscape.createNetwork(
@@ -84,11 +88,29 @@
final CyEdge newEdge = Cytoscape.getCyEdge(sourceNode,
targetNode,
Semantics.INTERACTION,
"complex-complex",
/* create = */true);
-
- edgeAttribs.setAttribute(newEdge.getIdentifier(),
EDGE_SCORE,
- Double.valueOf(edge.value().link()));
overviewNetwork.addEdge(newEdge);
+ // Add various edge attributes.
+ final double edgeScore = edge.value().link();
+ edgeAttribs.setAttribute(newEdge.getIdentifier(), "edge
score",
+ Double.valueOf(edgeScore));
+ final int gConnectedness =
+
geneticNetwork.getConnectedness(sourceModule.asStringSet(),
+
targetModule.asStringSet());
+ edgeAttribs.setAttribute(newEdge.getIdentifier(),
"genetic link count",
+
Integer.valueOf(gConnectedness));
+ final int pConnectedness =
+
physicalNetwork.getConnectedness(sourceModule.asStringSet(),
+
targetModule.asStringSet());
+ edgeAttribs.setAttribute(newEdge.getIdentifier(),
"physical link count",
+
Integer.valueOf(pConnectedness));
+ edgeAttribs.setAttribute(newEdge.getIdentifier(),
"source size",
+
Integer.valueOf(sourceModule.size()));
+ edgeAttribs.setAttribute(newEdge.getIdentifier(),
"target size",
+
Integer.valueOf(targetModule.size()));
+ final double density = edgeScore / (sourceModule.size()
* targetModule.size());
+ edgeAttribs.setAttribute(newEdge.getIdentifier(),
"density",
+ Double.valueOf(density));
}
applyNetworkLayout(overviewNetwork,
VisualStyleBuilder.getVisualStyle()
.getName());
Modified:
csplugins/trunk/ucsd/ruschein/DenovoPGNetworkAlignment/src/utilities/ByteConversion.java
===================================================================
---
csplugins/trunk/ucsd/ruschein/DenovoPGNetworkAlignment/src/utilities/ByteConversion.java
2010-01-13 23:28:31 UTC (rev 18898)
+++
csplugins/trunk/ucsd/ruschein/DenovoPGNetworkAlignment/src/utilities/ByteConversion.java
2010-01-13 23:42:04 UTC (rev 18899)
@@ -262,14 +262,10 @@
/* ========================= */
public static int toInt(byte[] data) {
- if (data == null || data.length != 4) return 0x0;
- // ----------
- return (int)( // NOTE: type cast not necessary for int
- (0xff & data[0]) << 24 |
- (0xff & data[1]) << 16 |
- (0xff & data[2]) << 8 |
- (0xff & data[3]) << 0
- );
+ if (data == null || data.length != 4)
+ return 0x0;
+
+ return (0xff & data[0]) << 24 | (0xff & data[1]) << 16 |
(0xff & data[2]) << 8 | (0xff & data[3]) << 0;
}
public static int[] toIntA(byte[] data) {
@@ -291,7 +287,7 @@
public static long toLong(byte[] data) {
if (data == null || data.length != 8) return 0x0;
// ----------
- return (long)(
+ return (
// (Below) convert to longs before shift because digits
// are lost with ints beyond the 32-bit limit
(long)(0xff & data[0]) << 56 |
Modified:
csplugins/trunk/ucsd/ruschein/DenovoPGNetworkAlignment/src/utilities/collections/ListOps.java
===================================================================
---
csplugins/trunk/ucsd/ruschein/DenovoPGNetworkAlignment/src/utilities/collections/ListOps.java
2010-01-13 23:28:31 UTC (rev 18898)
+++
csplugins/trunk/ucsd/ruschein/DenovoPGNetworkAlignment/src/utilities/collections/ListOps.java
2010-01-13 23:42:04 UTC (rev 18899)
@@ -163,12 +163,12 @@
return hs.toArray(new String[hs.size()]);
}
- public static List<String> intersect(List<String> s1, List<String> s2)
+ @SuppressWarnings("unchecked") public static List<String>
intersect(List<String> s1, List<String> s2)
{
return new ArrayList<String>(ListUtils.intersection(s1, s2));
}
- public static List<String> union(List<String> s1, List<String> s2)
+ @SuppressWarnings("unchecked") public static List<String>
union(List<String> s1, List<String> s2)
{
return new ArrayList<String>(ListUtils.union(s1, s2));
}
--
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.