Author: kono
Date: 2011-12-08 13:10:41 -0800 (Thu, 08 Dec 2011)
New Revision: 27744
Modified:
core3/impl/trunk/property-impl/src/main/resources/bookmarks.xml
core3/impl/trunk/psi-mi-impl/src/main/java/org/cytoscape/psi_mi/internal/plugin/PsiMiTabCyFileFilter.java
Log:
Minor bugs fixed.
Modified: core3/impl/trunk/property-impl/src/main/resources/bookmarks.xml
===================================================================
--- core3/impl/trunk/property-impl/src/main/resources/bookmarks.xml
2011-12-08 21:09:48 UTC (rev 27743)
+++ core3/impl/trunk/property-impl/src/main/resources/bookmarks.xml
2011-12-08 21:10:41 UTC (rev 27744)
@@ -337,21 +337,24 @@
</category>
</category>
<category name="network">
- <dataSource name="Human Interactome: BioGRID Release 3.1.83
(11/25/2011)"
-
xlink:href="http://www.cytoscape.org/datasets/BIOGRID-ORGANISM-Homo_sapiens-3.1.83.mitab"
- format="mitab" />
- <dataSource name="Yeast Interactome: BioGRID Release 3.1.83
(11/25/2011)"
-
xlink:href="http://www.cytoscape.org/datasets/BIOGRID-ORGANISM-Saccharomyces_cerevisiae-3.1.83.mitab"
- format="mitab" />
- <dataSource name="Mouse Interactome: BioGRID Release 3.1.83
(11/25/2011)"
-
xlink:href="http://www.cytoscape.org/datasets/BIOGRID-ORGANISM-Mus_musculus-3.1.83.mitab"
- format="mitab" />
- <dataSource name="Fly Interactome: BioGRID Release 3.1.83
(11/25/2011)"
-
xlink:href="http://www.cytoscape.org/datasets/BIOGRID-ORGANISM-Drosophila_melanogaster-3.1.83.mitab"
- format="mitab" />
<dataSource name="Yeast Protein-Protein: Ideker, T. et al.
(galFiltered.sif)"
-
xlink:href="http://www.cytoscape.org/datasets/galFiltered.sif"
+
xlink:href="http://chianti.ucsd.edu/kono/data/galFiltered.sif"
format="sif" />
+ <dataSource name="Human Protein-Protein: HPRD Literature
Curated Interactions"
+ xlink:href="http://cytoscape.org/datasets/HPRD.sif"
+ format="sif" />
+ <dataSource name="Human Protein-Protein: Rual et al. Toward a
proteome-scale map of the human protein-protein interaction network. Nature
2005."
+ xlink:href="http://cytoscape.org/datasets/rual.sif"
+ format="sif" />
+ <dataSource name="Human Protein-Protein: Rual et al.
(Subnetwork for tutorial)"
+
xlink:href="http://www.cytoscape.org/tut/getting.started/RUAL.subset.sif"
+ format="sif" />
+ <dataSource name="Human Protein-Protein: Stelzl et al. A human
protein-protein interaction network: a resource for annotating the proteome.
Cell 2005."
+ xlink:href="http://cytoscape.org/datasets/stelzl.sif"
+ format="sif" />
+ <dataSource name="Yeast Protein-Protein: Ptacek et al. Global
analysis of protein phosphorylation in yeast. Nature 2005"
+ xlink:href="http://cytoscape.org/datasets/ptacek.sif"
+ format="sif" />
</category>
<category name="table">
Modified:
core3/impl/trunk/psi-mi-impl/src/main/java/org/cytoscape/psi_mi/internal/plugin/PsiMiTabCyFileFilter.java
===================================================================
---
core3/impl/trunk/psi-mi-impl/src/main/java/org/cytoscape/psi_mi/internal/plugin/PsiMiTabCyFileFilter.java
2011-12-08 21:09:48 UTC (rev 27743)
+++
core3/impl/trunk/psi-mi-impl/src/main/java/org/cytoscape/psi_mi/internal/plugin/PsiMiTabCyFileFilter.java
2011-12-08 21:10:41 UTC (rev 27744)
@@ -1,12 +1,17 @@
package org.cytoscape.psi_mi.internal.plugin;
+import java.io.BufferedReader;
+import java.io.IOException;
import java.io.InputStream;
+import java.io.InputStreamReader;
import java.net.URI;
import java.util.HashSet;
import java.util.Set;
import org.cytoscape.io.CyFileFilter;
import org.cytoscape.io.DataCategory;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
public class PsiMiTabCyFileFilter implements CyFileFilter {
@@ -21,7 +26,7 @@
contentTypes = new HashSet<String>();
contentTypes.add("text/psi-mi-tab");
- this.description = "PSI-MI TAB file";
+ this.description = "PSI-MI TAB 2.5 file";
}
@Override
@@ -29,7 +34,8 @@
if (!category.equals(DataCategory.NETWORK))
return false;
- if(extensions.contains(getExtension(uri.toString())))
+ final String ext = getExtension(uri.toString());
+ if(extensions.contains(ext))
return true;
else
return false;
@@ -38,7 +44,30 @@
@Override
public boolean accepts(InputStream stream, DataCategory category) {
- // Not supported.
+ if (!category.equals(DataCategory.NETWORK)) {
+ return false;
+ }
+ try {
+ return checkFirstLine(stream);
+ } catch (IOException e) {
+ Logger logger = LoggerFactory.getLogger(getClass());
+ logger.error("Error while checking header", e);
+ return false;
+ }
+ }
+
+ private boolean checkFirstLine(InputStream stream) throws IOException {
+ final BufferedReader reader = new BufferedReader(new
InputStreamReader(stream));
+ final String line = reader.readLine();
+
+ if (line != null) {
+ String[] parts = line.split("\t");
+ if(parts.length >= 15)
+ return true;
+ else {
+ return false;
+ }
+ }
return false;
}
--
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.