{
print "Swapping gene data and making other modifications...\n\n";
- # -------------------------------------------------------------------------
- # [PathVisio Perl Pseudo-Script]
- # -------------------------------------------------------------------------
- # .remove all <BiopaxRef> and <bp:PublicationXref> elements and children
- my $pathway_nodes = $gpml_doc->getElementsByTagName("Pathway");
- print @$pathway_nodes[0] . "\n";
- my $biopax_nodes = $gpml_doc->getElementsByTagName("Biopax");
- print $biopax_nodes . "\n";
- for (@$biopax_nodes)
+ # remove all <BiopaxRef> and <bp:PublicationXref> elements and children
+ my $pathway_node = ($gpml_doc->getElementsByTagName("Pathway"))[0];
+
+ my $biopax_node = ($pathway_node->getElementsByTagName("Biopax"))[0];
+ $pathway_node->removeChild($biopax_node);
+
+ # for (@$biopax_nodes)
+ # {
+ # # print $_->getTagName . "\n";
+ # $pathway_node->removeChild($_);
+ # }
+
+ my $data_nodes = $pathway_node->getElementsByTagName("DataNode");
+ #print $data_nodes->getLength . "\n";
+ for (@$data_nodes)
{
- # print $_->getTagName . "\n";
- print $_ . "\n";
- @$pathway_nodes[0]->removeChild($_);
+ my $curr_datanode = $_;
+ my $biopaxref_nodes = $curr_datanode->getElementsByTagName("BiopaxRef");
+ for (@$biopaxref_nodes)
+ {
+ $curr_datanode->removeChild($_);
+ }
}
+ # my $biopaxref_nodes = $gpml_doc->getElementsByTagName("BiopaxRef");
+ # print $biopaxref_nodes->getLength . "\n";
+ # for (@$biopaxref_nodes)
+ # {
+ # @$pathway_nodes[0]->removeChild($_);
+ # }
+
+
# .identify mapped genes
# .if mapped gene did not belong to a group, create new group node
# .duplicate <DataNode> for each mapping
# .create new, random 5-digit hex code
# .make sure it doesn't already exist
# .add "GroupRef" on each added node, including the orig.
- # .rename TextLabel (prefix: Eu-, suffix: -#?)
+ # .rename TextLabel (prefix: Eu-, suffix: -alpha or numeric, based on regex)
# .add Comment back-referencing TAIR locus id (use "source" attribute)
# .edit <Xref Database="JGI" ID="Egrandis..." />
# .decrement the Z-order
# .decrement CenterX and CenterY by 10px each
# .change box Width if needed
# .color the box (<Graphics...Color="4488ff" />)
+ #
+ # [hold]
# .After PathVisio sanity check, before communication:
# .remove back-ref TAIR comments