Hello!

To see the file structure, click on "tree".

Note that updates take place every 10 minutes, commits may not be seen immediately.
Removes pubs and pub refs from doc.
authorpreecej <preecej@localhost>
Mon, 8 Aug 2011 20:07:56 +0000 (20:07 +0000)
committerpreecej <preecej@localhost>
Mon, 8 Aug 2011 20:07:56 +0000 (20:07 +0000)
svn path=/; revision=142

preecej/perl_singletons/pathway_gene_swapper.pl

index 49e65c7bc0031865e70d4f0c2477e590eea858d0..8a490c05a974b3f6795cb9908eec02dd1647448a 100644 (file)
@@ -304,21 +304,38 @@ sub swap_genes
 {
     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
@@ -327,13 +344,15 @@ sub swap_genes
     #     .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