Examples of BioPAXIOHandler


Examples of org.biopax.paxtools.io.BioPAXIOHandler

      assert model == null || filename == null : "One and only one must be null";
      assert model != null || filename != null : "One and only one must be null";

      if (model == null)
      {
        BioPAXIOHandler reader = new SimpleIOHandler();
        model = reader.convertFromOWL(new FileInputStream(filename));
      }

      // Don't do anything if the source model does not contain anything
      if (model.getObjects().isEmpty())
      {
        MessageDialog.openInformation(main.getShell(), "No Data!",
          "The file is empty.");
        return;
      }

      // Typical merging process
      sources.add(model);
      Model target = main.getOwlModel();

      if (merger == null)
      {
        merger = new Merger(SimpleEditorMap.get(target.getLevel()));
      }
     
      merger.merge(target, sources.toArray(new Model[sources.size()]));

      BioPAXReader reader = new BioPAXReader(target);
      BioPAXGraph graph = (BioPAXGraph) reader.readXMLFile(null);

      if (createNewPathway)
      {
        List<String> intids = getInteractionIDs(model);
        newPathwayName = graph.createPathway(
View Full Code Here

Examples of org.biopax.paxtools.io.BioPAXIOHandler

      /*  UK: If a CPATH_ID is given instead of a OWL file, look up PathwayCommons Database and acquire pathway
       *   This is particularly useful when giving the users a long list of pathways and letting them choose which pathway to
       *   visualize on the spot, which can be very useful in JWS deployment.  */
      else if (filename.matches("\\d*")){
        try {
          BioPAXIOHandler reader = new SimpleIOHandler();
          PathwayCommonsIOHandler pcIOHandler  = new PathwayCommonsIOHandler(reader);
          Model model = pcIOHandler.retrieveByID(filename);
          LoadBioPaxModelAction action = new LoadBioPaxModelAction(window, model);
          window.firstAction = action;
         
View Full Code Here

Examples of org.biopax.paxtools.io.BioPAXIOHandler

            graph.recordLayout();
          }
        }
      }

      BioPAXIOHandler exporter = new SimpleIOHandler(main.getOwlModel().getLevel());

      FileOutputStream stream = new FileOutputStream(filename);
      exporter.convertToOWL(main.getOwlModel(), stream);
      stream.close();

      main.setOwlFileName(filename);
      main.markSaved();
      this.saved = true;
View Full Code Here

Examples of org.biopax.paxtools.io.BioPAXIOHandler

    try
    {
      if (model == null)
      {
        BioPAXIOHandler reader = new SimpleIOHandler();
        model = reader.convertFromOWL(new FileInputStream(xmlFile));
      }

      if (model != null)
      {
        BioPAXLevel level = model.getLevel();
        if (level == BioPAXLevel.L2)
        {
          root = new BioPAXL2Graph(model);
          BioPAXL2Reader reader = new BioPAXL2Reader(model);
          reader.createGraph((BioPAXL2Graph) root);
        }
        else if (level == BioPAXLevel.L3)
        {
          root = new BioPAXL3Graph(model);
          BioPAXL3Reader reader = new BioPAXL3Reader(model);
          reader.createGraph((BioPAXL3Graph) root);
        }
      }
    }
    catch (Exception e)
    {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.