From 76abcec25ee254b1ae5a6838c570609e68af27fd Mon Sep 17 00:00:00 2001 From: preecej Date: Mon, 8 Aug 2011 20:07:56 +0000 Subject: [PATCH] Removes pubs and pub refs from doc. svn path=/; revision=142 --- .../perl_singletons/pathway_gene_swapper.pl | 45 +++++++++++++------ 1 file changed, 32 insertions(+), 13 deletions(-) diff --git a/preecej/perl_singletons/pathway_gene_swapper.pl b/preecej/perl_singletons/pathway_gene_swapper.pl index 49e65c7..8a490c0 100644 --- a/preecej/perl_singletons/pathway_gene_swapper.pl +++ b/preecej/perl_singletons/pathway_gene_swapper.pl @@ -304,21 +304,38 @@ sub swap_genes { print "Swapping gene data and making other modifications...\n\n"; - # ------------------------------------------------------------------------- - # [PathVisio Perl Pseudo-Script] - # ------------------------------------------------------------------------- - # .remove all and 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 and 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 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 # .decrement the Z-order # .decrement CenterX and CenterY by 10px each # .change box Width if needed # .color the box () + # + # [hold] # .After PathVisio sanity check, before communication: # .remove back-ref TAIR comments -- 2.34.1