Package org.biopax.paxtools.model.level3

Examples of org.biopax.paxtools.model.level3.Pathway


    {
      BioPAXGraph graph = (BioPAXGraph) root;

      if (graph.isMechanistic() && graph.getPathway() == null)
      {
        pathway p = createNewPathway();
        if (graph.getName() != null)
        {
          p.setNAME(adviceTabName(graph.getName()));
        }
        else
        {
          p.setNAME(adviceTabName(null));
        }
        graph.setName(p.getNAME());

        graph.setName(p.getNAME());
        graph.setPathway(p);
        graph.registerContentsToPathway();
        allPathwayNames.add(p.getNAME());
      }
      else
      {
        graph.setName(graph.getPathway() != null ? graph.getPathway().getNAME() :
          adviceTabName(graph.getName()));
View Full Code Here


    return name;
  }

  private pathway createNewPathway()
  {
    pathway p = ((Level2Factory) BioPAXLevel.L2.getDefaultFactory()).createPathway();
    p.setRDFId("http://www.chisio.org/user#" + System.currentTimeMillis());
    this.getOwlModel().add(p);
    return p;
  }
View Full Code Here

    Object compmod = tabToViewerMap.get(tab).getContents().getModel();
    if (compmod instanceof BioPAXGraph)
    {
      BioPAXGraph graph = (BioPAXGraph) compmod;
      pathway p = graph.getPathway();

      if (p != null)
      {
        p.setNAME(newName);
      }
      graph.setName(newName);
    }
    tab.setText(newName);
View Full Code Here

    {
      BioPAXGraph graph = (BioPAXGraph) root;

      if (graph.isMechanistic() && graph.getPathway() == null)
      {
        pathway p = createNewPathway();
        if (graph.getName() != null)
        {
          p.setNAME(adviceTabName(graph.getName()));
        }
        else
        {
          p.setNAME(adviceTabName(null));
        }
        graph.setName(p.getNAME());

        graph.setName(p.getNAME());
        graph.setPathway(p);
        graph.registerContentsToPathway();
        allPathwayNames.add(p.getNAME());
      }
      else
      {
        graph.setName(graph.getPathway() != null ? graph.getPathway().getNAME() :
          adviceTabName(graph.getName()));
View Full Code Here

    return name;
  }

  private pathway createNewPathway()
  {
    pathway p = ((Level2Factory) BioPAXLevel.L2.getDefaultFactory()).createPathway();
    p.setRDFId("http://www.chisio.org/user#" + System.currentTimeMillis());
    this.getOwlModel().add(p);
    return p;
  }
View Full Code Here

    Object compmod = tabToViewerMap.get(tab).getContents().getModel();
    if (compmod instanceof BioPAXGraph)
    {
      BioPAXGraph graph = (BioPAXGraph) compmod;
      pathway p = graph.getPathway();

      if (p != null)
      {
        p.setNAME(newName);
      }
      graph.setName(newName);
    }
    tab.setText(newName);
View Full Code Here

        return;
      }

      original.recordLayout();
      pathway p = original.getPathway();
      BioPAXGraph graph = main.getRootGraph().excise(p);
      graph.setPathway(null);

      String name = p.getNAME();

      // If the name contains a copy number at the end (like "pathway name (2)"), remove it

      if (name.indexOf(" ") > 0)
      {
        String last = name.substring(name.lastIndexOf(" ") + 1);
        if (last.indexOf("(") == 0 && last.indexOf(")") == last.length() - 1)
        {
          boolean isdigit = true;
          for (int i = 1; isdigit && i < last.length() - 1; i++)
          {
            isdigit = Character.isDigit(last.charAt(i));
          }

          if (isdigit) name = name.substring(0, name.lastIndexOf(" "));
        }
      }

      graph.setName(name);
      main.createNewTab(graph);
      graph.fetchLayout(p.getRDFId());
    }
  }
View Full Code Here

      if (graph.isMechanistic())
      {
        graph.forgetLayout();
        Model model = graph.getBiopaxModel();
        pathway p = graph.getPathway();
        model.remove(p);

        main.getAllPathwayNames().remove(p.getNAME());
      }
    }
  }
View Full Code Here

    // Record layout
    graph.recordLayout();

    // Create updated graph
    pathway p = graph.getPathway();
    BioPAXGraph newGraph = main.getRootGraph().excise(p);
    newGraph.setName(p.getNAME());
    newGraph.setAsRoot();

    // Replace the graph
    viewer.setContents(newGraph);
View Full Code Here

    // Record layout
    graph.recordLayout();

    // Create updated graph
    pathway p = graph.getPathway();

    // Update pathway components if update needed

    if (withContent != null)
    {
      for (pathwayComponent pc : new HashSet<pathwayComponent>(p.getPATHWAY_COMPONENTS()))
      {
        p.removePATHWAY_COMPONENTS(pc);
      }
     
      Set<conversion> convSet = new HashSet<conversion>();

      for (GraphObject go : withContent)
      {
        if (go instanceof Conversion)
        {
          Conversion conv = (Conversion) go;
          conversion cnv = conv.getConversion();
          convSet.add(cnv);
        }
      }

      Set<pathwayComponent> components = p.getPATHWAY_COMPONENTS();

      for (conversion cnv : convSet)
      {
        if (!components.contains(cnv))
        {
          p.addPATHWAY_COMPONENTS(cnv);
        }
      }
    }

    // Excise pathway

    BioPAXGraph newGraph = main.getRootGraph().excise(p);
    newGraph.setName(p.getNAME());
    newGraph.setAsRoot();

    // Replace the graph
    viewer.setContents(newGraph);
View Full Code Here

TOP

Related Classes of org.biopax.paxtools.model.level3.Pathway

Copyright © 2018 www.massapicom. 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.