Author: rodche
Date: 2010-07-27 11:17:57 -0700 (Tue, 27 Jul 2010)
New Revision: 21035
Modified:
coreplugins/trunk/BioPAX/lib/paxtools-core.jar
coreplugins/trunk/BioPAX/lib/paxtools-simple-io.jar
coreplugins/trunk/BioPAX/src/cytoscape/coreplugins/biopax/BioPaxGraphReader.java
coreplugins/trunk/BioPAX/src/cytoscape/coreplugins/biopax/MapBioPaxToCytoscape.java
coreplugins/trunk/BioPAX/src/cytoscape/coreplugins/biopax/util/
coreplugins/trunk/BioPAX/src/cytoscape/coreplugins/biopax/util/BioPaxUtil.java
coreplugins/trunk/BioPAX/test/cytoscape/coreplugins/biopax/TestBioPaxUtil.java
Log:
Removed "parent pathway" node attribute (may take too long to calculate or
needs to be calculated in advance.., i.e., requires some re-factoring);
paxtools libraries are updated.
Modified: coreplugins/trunk/BioPAX/lib/paxtools-core.jar
===================================================================
(Binary files differ)
Modified: coreplugins/trunk/BioPAX/lib/paxtools-simple-io.jar
===================================================================
(Binary files differ)
Modified:
coreplugins/trunk/BioPAX/src/cytoscape/coreplugins/biopax/BioPaxGraphReader.java
===================================================================
---
coreplugins/trunk/BioPAX/src/cytoscape/coreplugins/biopax/BioPaxGraphReader.java
2010-07-27 17:45:37 UTC (rev 21034)
+++
coreplugins/trunk/BioPAX/src/cytoscape/coreplugins/biopax/BioPaxGraphReader.java
2010-07-27 18:17:57 UTC (rev 21035)
@@ -140,16 +140,20 @@
if(candidateName == null || "".equalsIgnoreCase(candidateName))
{
candidateName = fileName;
+ if(log.isDebugging())
+ log.debug("Network name will be the file name:
" + candidateName);
+ } else if(candidateName.length() > 100) {
+ if(log.isDebugging())
+ candidateName = fileName + " - " +
candidateName.substring(0, 100);
+ log.debug("Based on multiple pathways network
name is too long; " +
+ "it will be truncated: " +
candidateName);
}
// Take appropriate adjustments, if name already exists
String name =
CyNetworkNaming.getSuggestedNetworkTitle(candidateName);
+ if(log.isDebugging())
+ log.debug("Network name is: " + name);
- if(log.isDebugging()) {
- log.debug("Network name (adjusted) : " + candidateName
- + " (" + name + ")");
- }
-
return name;
}
Modified:
coreplugins/trunk/BioPAX/src/cytoscape/coreplugins/biopax/MapBioPaxToCytoscape.java
===================================================================
---
coreplugins/trunk/BioPAX/src/cytoscape/coreplugins/biopax/MapBioPaxToCytoscape.java
2010-07-27 17:45:37 UTC (rev 21034)
+++
coreplugins/trunk/BioPAX/src/cytoscape/coreplugins/biopax/MapBioPaxToCytoscape.java
2010-07-27 18:17:57 UTC (rev 21035)
@@ -1141,8 +1141,6 @@
* @param nodeList Nodes
*/
public static void mapTheRest(Model model, Collection<CyNode> nodeList)
{
- log.setDebug(true);
-
// get the node attributes
CyAttributes nodeAttributes = Cytoscape.getNodeAttributes();
initAttributes(nodeAttributes);
@@ -1157,8 +1155,6 @@
mapNodeAttribute(resource, model, nodeID);
}
-
- log.setDebug(false);
}
/**
@@ -1289,9 +1285,11 @@
}
// pathway name
+ /*
stringRef = BioPaxUtil.getParentPathwayName(element, model)
.toString().replaceAll("\\]|\\[", "").trim();
nodeAttributes.setAttribute(nodeID, BIOPAX_PATHWAY_NAME,
stringRef);
+ */
// add all xref ids for global lookup
List<ExternalLink> xList = BioPaxUtil.getAllXRefs(element);
Property changes on:
coreplugins/trunk/BioPAX/src/cytoscape/coreplugins/biopax/util
___________________________________________________________________
Name: svn:ignore
+ LayoutUtil.java
Modified:
coreplugins/trunk/BioPAX/src/cytoscape/coreplugins/biopax/util/BioPaxUtil.java
===================================================================
---
coreplugins/trunk/BioPAX/src/cytoscape/coreplugins/biopax/util/BioPaxUtil.java
2010-07-27 17:45:37 UTC (rev 21034)
+++
coreplugins/trunk/BioPAX/src/cytoscape/coreplugins/biopax/util/BioPaxUtil.java
2010-07-27 18:17:57 UTC (rev 21035)
@@ -485,7 +485,11 @@
try {
Object bs = getValue(bpe, "ORGANISM", "organism");
if (bs instanceof BioSource) {
- taxonomyId =
Integer.parseInt(((BioSource)bs).getTaxonXref().getId());
+ Set<Xref> xrefs = ((BioSource)bs).getXref();
+ if(!xrefs.isEmpty()) {
+ Xref tx = xrefs.iterator().next();
+ taxonomyId =
Integer.parseInt(tx.getId());
+ }
} else if(bs instanceof bioSource){
taxonomyId =
Integer.parseInt(((bioSource)bs).getTAXON_XREF().getID());
}
@@ -752,8 +756,8 @@
if(model.getLevel() == BioPAXLevel.L3) {
Collection<Pathway> pws =
model.getObjects(Pathway.class);
for(Pathway pw: pws) {
- if(pw.getPathwayComponentsOf().isEmpty()
- &&
pw.getParticipantsOf().isEmpty()
+ if(pw.getPathwayComponentOf().isEmpty()
+ &&
pw.getParticipantOf().isEmpty()
&&
pw.getControlledOf().isEmpty()) {
modelName.append("
").append(getNodeName(pw));
}
@@ -761,9 +765,9 @@
if(modelName.length()==0) {
Collection<Interaction> itrs =
model.getObjects(Interaction.class);
for(Interaction it: itrs) {
- if(it.getPathwayComponentsOf().isEmpty()
+ if(it.getPathwayComponentOf().isEmpty()
&&
it.getControlledOf().isEmpty()
- &&
it.getParticipantsOf().isEmpty()) {
+ &&
it.getParticipantOf().isEmpty()) {
modelName.append("
").append(getNodeName(it));
}
}
@@ -818,6 +822,7 @@
* @param model
* @return
*/
+ /* TODO re-factoring (pre-calculate pathway membership for all
entities, save in the Map, get from the Map...)
public static Set<String> getParentPathwayName(BioPAXElement bpe, Model
model) {
Set<String> pathwayNames = new HashSet<String>();
@@ -832,8 +837,8 @@
&& ((pathway)p).isCONTROLLEDOf().isEmpty())
||
(p instanceof Pathway
- &&
((Pathway)p).getPathwayComponentsOf().isEmpty()
- && ((Pathway)p).getParticipantsOf().isEmpty()
+ &&
((Pathway)p).getPathwayComponentOf().isEmpty()
+ && ((Pathway)p).getParticipantOf().isEmpty()
&& ((Pathway)p).getControlledOf().isEmpty()))
{
topPathways.add(p);
@@ -864,8 +869,8 @@
&&
((interaction)itr).isCONTROLLEDOf().isEmpty())
||
(itr instanceof Interaction
- &&
((Interaction)itr).getPathwayComponentsOf().isEmpty()
- &&
((Interaction)itr).getParticipantsOf().isEmpty()
+ &&
((Interaction)itr).getPathwayComponentOf().isEmpty()
+ &&
((Interaction)itr).getParticipantOf().isEmpty()
&&
((Interaction)itr).getControlledOf().isEmpty()))
{
topPathways.add(itr);
@@ -882,6 +887,7 @@
return pathwayNames;
}
+ */
/**
* Finds element's parents (CyNode names) in the collection.
Modified:
coreplugins/trunk/BioPAX/test/cytoscape/coreplugins/biopax/TestBioPaxUtil.java
===================================================================
---
coreplugins/trunk/BioPAX/test/cytoscape/coreplugins/biopax/TestBioPaxUtil.java
2010-07-27 17:45:37 UTC (rev 21034)
+++
coreplugins/trunk/BioPAX/test/cytoscape/coreplugins/biopax/TestBioPaxUtil.java
2010-07-27 18:17:57 UTC (rev 21035)
@@ -61,6 +61,7 @@
assertEquals(8, model.getObjects(physicalEntity.class).size());
assertEquals(4, model.getObjects(interaction.class).size());
assertEquals(1, model.getObjects(pathway.class).size());
+ /* TODO re-factor because BioPaxUtil.getParentPathwayName is
removed
String pathways = BioPaxUtil.getParentPathwayName(
model.getByID("http://www.biopax.org/examples/simple-demo-pathway#catalysis43"),
model)
.toString();
@@ -72,6 +73,7 @@
model.getByID("http://www.biopax.org/examples/simple-demo-pathway#protein45"),
model)
.toString();
assertTrue(pathways.contains("glycolysis"));
+ */
}
/**
@@ -79,6 +81,7 @@
*
* @throws Exception All Exceptions.
*/
+ /* TODO re-factor because BioPaxUtil.getParentPathwayName is removed
public void testUtil2() throws Exception {
Model model =
BioPaxUtil.readFile("test-resources/biopax_complex.owl");
Set<String> pathways = BioPaxUtil.getParentPathwayName(
@@ -86,6 +89,7 @@
System.out.println("PARENT PROCESSes NAMES: " + pathways);
assertTrue(pathways.size()==0);
}
+ /
/**
* Tests the BioPAX Utility Class on a third sample data file.
@@ -98,6 +102,7 @@
*
* @throws Exception All Exceptions.
*/
+ /* TODO re-factor because BioPaxUtil.getParentPathwayName is removed
public void testUtil3() throws Exception {
Model model =
BioPaxUtil.readFile("test-resources/Apoptosis.owl");
String pathways = BioPaxUtil.getParentPathwayName(
@@ -106,5 +111,6 @@
System.out.println("PARENT PW NAMES: " + pathways);
assertTrue(pathways.contains("FasL/ CD95L signaling"));
}
+ */
}
--
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.