

Plugins would call Cytoscape.getImportHandler().addHandler(fth) to register themselves.Īctions wanting to import files would call Cytoscape.getImportHandler().getReader(filename)įileTypeHandler would be an interface as described above in the Proposal as ImportableFileType. The Cytoscape object will contain the ImportHandler object and will provide access to the class with a getImportHandler() method. Probably a few other methods like getFileTypeDescriptions(), etc. Again, the collection of suffixes is created by the ImportHandler asking each FileTypeHandler to describe itself. GetFileTypeSuffixes() which will return a list of suffixes that can be used in file open dialogs and the like. The file type will be decided by the ImportHandler checking with each FileTypeHandler to see which one of them can read the file. GetReader(String fileName) which provides a reader based on the file type. Here is a slighty more detailed explanation of what I'm thinking.Ĭreate an ImportHandler class with the following methodsĪddHandler(FileTypeHandler fth) which registers the handler type. MikeSmoot - Having thought about it a bit more, I think we want an interface method that registers classes with a handler. Do you think it would be better to search for the classes implementing the interface or have an interface method that registers the classes with a handler?
#Cytoscape supported file type how to
How to add new file type support to Cytoscape. GaryBader - Mar.14.2006 - sounds great! When complete, it would be great to have a wiki page documenting this for plugin developers e.g. I want to import files of type: (fancy new file format). This should be easy to accomplish without breaking any of the public interface.Plugins could seamlessly add themselves to the list of allowable file types by adding a file type object to the loading class.Instead of checking to see if a filename matches a particular file type with mulitple if statements, the loading class would simply loop through it's list of file type objects and then the file type object would see if it could load the file, and do so if possible.Īlternatively, we could centralize this behavior in a single ImportHandler object.The interface will define several methods such as: fileTypeID, fileTypeSuffix, fileTypeDescription, getReader.Īnything that loads files (Cytoscape, ImportGraphFileAction) will include a list of objects that each implements the interface for it's particular file type. There is no mechanism for easily and seamlessly integrating the import of other file types, such as SBML by a plugin.ĭefine an ImportableFileType interface. These file types are hard coded throughout the system (the import action, in Cytoscape.createNetwork, etc.). Take the extra step and propose alternatives.Ĭytoscape is currently able to import 3 types of files, SIF, GML, and XGMML. For example, if you find a part of the RFC makes no sense, please say so, but don't stop there. Try to keep your comments as concrete and constructive as possible. Here is an example to get things started: /Comment. Be sure to include today's date and your name for each comment.

By adding your ideas to the Wiki directly, we can more easily organize everyone's ideas, and keep clear records. To view/add comments, click on any of 'Comment' links below.

This is an official Request for Comment (RFC) for a generic framework to support importing from diverse file types.įor details on RFCs in general, check out the Wikipedia Entry: Request for Comments (RFCs)
