Background

  • GpmlDiff is a tool for comparing two pathways and creating a changeset.
  • GpmlPatch is a tool for applying a changeset to a pathway.

Together, GpmlDiff and GpmlPatch can be used for merging, i.e. extracting the changes between two pathways and applying them to a third pathway, or for filtering unwanted changes.

Warning GpmlDiff and GpmlPatch are developer tools. They are not user friendly, and we provide only limited support for them.

Output

The output for gpmldiff and the input for gpmlpatch is in dgpml (or delta-gpml) format. Here you see an example in dgpml format:

<?xml version="1.0" encoding="ISO-8859-1"?>
<Delta>
  <Modify>
    <Line xmlns="http://genmapp.org/GPML/2008a" Style="Solid" GraphId="c434e">
      <Graphics ZOrder="12288" Color="000000">
        <Point x="3495.0" y="4590.0" />
        <Point x="6270.0" y="4590.0" ArrowHead="Arrow" />
      </Graphics>
    </Line>
    <Change attr="GraphId" old="c434e" new="b6a8a" />
  </Modify>
  <Modify>
    <Label xmlns="http://genmapp.org/GPML/2008a" TextLabel="Compound" GraphId="bbd">
      <Graphics FontSize="150" Color="000000" CenterX="7196.5" CenterY="4608.0" Width="1087.0" Height="234.0" ZOrder="28672" />
    </Label>
    <Change attr="CenterX" old="7196.5" new="7101.0" />
    <Change attr="Width" old="1087.0" new="1278.0" />
    <Change attr="TextLabel" old="Compound" new="Compound 2" />
  </Modify>
  <Modify>
    <Label xmlns="http://genmapp.org/GPML/2008a" TextLabel="Compound" GraphId="f40">
      <Graphics FontSize="150" Color="000000" CenterX="2591.5" CenterY="4563.0" Width="1087.0" Height="234.0" ZOrder="28672" />
    </Label>
    <Change attr="CenterX" old="2591.5" new="2496.0" />
    <Change attr="Width" old="1087.0" new="1278.0" />
    <Change attr="TextLabel" old="Compound" new="Compound 1" />
  </Modify>
</Delta>

The above example describes a change of attribute GraphId? on a Line element, and changes of CenterX, Width and TextLabel? attributes on two Label elements.

Running from the command line

Checkout the pathvisio source code and compile using ant.

GpmlDiff and GpmlPatch can be accessed from the command line. For example, to compare two pathways run

./gpmldiff.sh pathway1.gpml pathway2.gpml > patch.dgpml

To apply this patch, run

./gpmlpatch.sh pathway3.gpml < patch.gpml

Running using eclipse

Checkout the pathvisio source code and compile within eclipse. To run GpmlDiff, create a Run Configuration on the org.pathvisio.gpmldiff.GpmlDiff? class. To run GpmlPatch, create a Run Configuration on the org.pathvisio.gpmldiff.PatchMain? class.