Author: rodche
Date: 2012-02-01 16:22:50 -0800 (Wed, 01 Feb 2012)
New Revision: 28180
Modified:
core3/impl/trunk/cpath2-impl/src/main/java/org/cytoscape/cpath2/internal/task/ExecuteGetRecordByCPathId.java
core3/impl/trunk/cpath2-impl/src/main/java/org/cytoscape/cpath2/internal/task/GetParentInteractions.java
core3/impl/trunk/cpath2-impl/src/main/java/org/cytoscape/cpath2/internal/task/GetParentInteractionsTaskFactory.java
core3/impl/trunk/cpath2-impl/src/main/java/org/cytoscape/cpath2/internal/web_service/CPathWebServiceImpl.java
Log:
Polishing
Modified:
core3/impl/trunk/cpath2-impl/src/main/java/org/cytoscape/cpath2/internal/task/ExecuteGetRecordByCPathId.java
===================================================================
---
core3/impl/trunk/cpath2-impl/src/main/java/org/cytoscape/cpath2/internal/task/ExecuteGetRecordByCPathId.java
2012-02-02 00:20:18 UTC (rev 28179)
+++
core3/impl/trunk/cpath2-impl/src/main/java/org/cytoscape/cpath2/internal/task/ExecuteGetRecordByCPathId.java
2012-02-02 00:22:50 UTC (rev 28180)
@@ -135,7 +135,7 @@
taskMonitor.setStatusMessage("Retrieving " +
networkTitle + ".");
}
- // Store BioPAX to Temp File
+ // Get and Store BioPAX or SIF data to a temp file
String tmpDir = System.getProperty("java.io.tmpdir");
// Branch based on download mode setting.
File tmpFile;
@@ -145,15 +145,15 @@
tmpFile = File.createTempFile("temp", ".sif",
new File(tmpDir));
}
tmpFile.deleteOnExit();
-
// Get Data, and write to temp file.
String data = webApi.getRecordsByIds(ids, format,
taskMonitor);
FileWriter writer = new FileWriter(tmpFile);
writer.write(data);
writer.close();
- CyNetworkReader reader =
cPathFactory.getCyNetworkViewReaderManager().getReader(tmpFile.toURI(),
- tmpFile.getName());
+ // read the network from the temp file (the reader is
auto-detected by the file extension or content)
+ CyNetworkReader reader =
cPathFactory.getCyNetworkViewReaderManager()
+ .getReader(tmpFile.toURI(),
tmpFile.getName());
if (taskMonitor != null) {
taskMonitor.setStatusMessage("Creating
Cytoscape Network...");
taskMonitor.setProgress(0);
@@ -248,10 +248,6 @@
* Cytoscape Network Object.
*/
private void postProcessingBinarySif(final CyNetworkView view,
TaskMonitor taskMonitor) {
- // Init the node attribute meta data, e.g. description,
visibility, etc.
- // TODO: What happened to attribute descriptions?
- // BioPaxMapper.initAttributes(nodeAttributes);
-
final CyNetwork cyNetwork = view.getModel();
// Set the Quick Find Default Index
@@ -444,10 +440,10 @@
if(e instanceof EntityReference
|| e instanceof Complex
||
e.getModelInterface().equals(PhysicalEntity.class)) {
- String id =
e.getRDFId().replaceFirst(model.getXmlBase(), "");
- if (id != null) {
- id =
id.replaceAll("CPATH-", "");
- CyNode node =
nodes.get(id);
+ String cpathId =
e.getRDFId().replaceFirst(model.getXmlBase(), "");
+ if (cpathId != null) {
+ cpathId =
cpathId.replaceAll("CPATH-", "");
+ CyNode node =
nodes.get(cpathId);
if(node != null)
BioPaxUtil.createAttributesFromProperties(e, node, cyNetwork);
// - this will also
update the 'name' attribute (to a biol. label)
Modified:
core3/impl/trunk/cpath2-impl/src/main/java/org/cytoscape/cpath2/internal/task/GetParentInteractions.java
===================================================================
---
core3/impl/trunk/cpath2-impl/src/main/java/org/cytoscape/cpath2/internal/task/GetParentInteractions.java
2012-02-02 00:20:18 UTC (rev 28179)
+++
core3/impl/trunk/cpath2-impl/src/main/java/org/cytoscape/cpath2/internal/task/GetParentInteractions.java
2012-02-02 00:22:50 UTC (rev 28180)
@@ -17,6 +17,7 @@
import org.cytoscape.work.Task;
import org.cytoscape.work.TaskMonitor;
+// TODO seems, in practice, this class is never called!
public class GetParentInteractions implements Task {
private long cpathId;
private CPathWebService webApi = CPathWebServiceImpl.getInstance();
@@ -26,8 +27,10 @@
private final CPath2Factory factory;
public GetParentInteractions (CyNetwork network, CyNode node,
CPath2Factory factory) {
- // TODO: Investigate what alternatives we can use for getIdentifier()
- this.cpathId = node.getSUID();
+ // TODO: Debug, investigate this cPath1 (Pathway Commons, BioPAX Level2
webservice specific code...)
+ String cpathId = network.getRow(node).get(CyNode.NAME, String.class);
// TODO actually, - must be from "shared name" virtual attr. column
+// this.cpathId = node.getSUID();
+ this.cpathId = Integer.parseInt(cpathId); //well, well
this.node = node;
this.network = network;
this.factory = factory;
Modified:
core3/impl/trunk/cpath2-impl/src/main/java/org/cytoscape/cpath2/internal/task/GetParentInteractionsTaskFactory.java
===================================================================
---
core3/impl/trunk/cpath2-impl/src/main/java/org/cytoscape/cpath2/internal/task/GetParentInteractionsTaskFactory.java
2012-02-02 00:20:18 UTC (rev 28179)
+++
core3/impl/trunk/cpath2-impl/src/main/java/org/cytoscape/cpath2/internal/task/GetParentInteractionsTaskFactory.java
2012-02-02 00:22:50 UTC (rev 28180)
@@ -6,7 +6,7 @@
import org.cytoscape.task.AbstractNodeViewTaskFactory;
import org.cytoscape.work.TaskIterator;
-// TODO: Wire this in OSGi
+// TODO: Wire this in OSGi; this class is never called... (remove?)
public class GetParentInteractionsTaskFactory extends
AbstractNodeViewTaskFactory {
private final CPath2Factory factory;
Modified:
core3/impl/trunk/cpath2-impl/src/main/java/org/cytoscape/cpath2/internal/web_service/CPathWebServiceImpl.java
===================================================================
---
core3/impl/trunk/cpath2-impl/src/main/java/org/cytoscape/cpath2/internal/web_service/CPathWebServiceImpl.java
2012-02-02 00:20:18 UTC (rev 28179)
+++
core3/impl/trunk/cpath2-impl/src/main/java/org/cytoscape/cpath2/internal/web_service/CPathWebServiceImpl.java
2012-02-02 00:22:50 UTC (rev 28180)
@@ -119,7 +119,6 @@
protocol = new CPathProtocol();
protocol.setCommand(CPathProtocol.COMMAND_GET_PARENTS);
protocol.setFormat(CPathResponseFormat.GENERIC_XML);
-
protocol.setQuery(Long.toString(primaryId));
SummaryResponseType summaryResponse;
--
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.