From 32287095e2867c65c891459df27c9c8ddefb016c Mon Sep 17 00:00:00 2001 From: preecej Date: Mon, 15 Aug 2011 20:32:48 +0000 Subject: [PATCH] Added comments for future version of script; added verbose display of original file's gene nodes (textlabel and xref id) svn path=/; revision=155 --- .../perl_singletons/pathway_gene_swapper.pl | 24 +++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) diff --git a/preecej/perl_singletons/pathway_gene_swapper.pl b/preecej/perl_singletons/pathway_gene_swapper.pl index cc9c4d7..7c98f29 100644 --- a/preecej/perl_singletons/pathway_gene_swapper.pl +++ b/preecej/perl_singletons/pathway_gene_swapper.pl @@ -33,6 +33,16 @@ Any new gene boxes may be painted with a custom color and border, and will be stacked and offset for ease of visualization (much like a deck of cards). +=head1 FUTURE CHANGES + +Add the option to read in an extra column of gene symbols, if the +user wishes to provide their own. Otherwise, continue to use the label +prefix and auto-numbering suffix settings. + +Add a comment containing the NCBI species id of the new homolog (for +the purpose of multi-species pathway comparison or host-pathogen +interaction diagrams). + =head1 USAGE pathway_gene_swapper.pl -i INPUT_FILE -g GENE_FILE -c CONFIG_FILE -o OUTPUT_FILE -L -v -G -d @@ -455,6 +465,10 @@ sub swap_genes # indexed by the id of the gene located in the element for each # node, and sub-indexed by the GraphId of each corresponding node my %data_nodes_by_gene_id; + + if ($verbose) { + print "[Original genes]\n"; + } # create a hash of all 5-digit hex ids in the gpml doc (this is the black list) # one list of DataNode.GraphId, Group.GroupId, and Group.GraphId @@ -462,6 +476,7 @@ sub swap_genes for (@$data_nodes) { # print $_ . "\n"; # TEST + if ($_->getAttributeNode("GraphId")) { $existing_hex_ids{$_->getAttributeNode("GraphId")->getValue} @@ -472,10 +487,15 @@ sub swap_genes my $curr_xref_id = ($_->getElementsByTagName("Xref"))[0] ->getAttributeNode("ID")->getValue; my $curr_graph_id = $_->getAttributeNode("GraphId")->getValue; - + $curr_xref_id =~ s/\s+$//; # rtrim whitespace $curr_xref_id =~ s/^\s+//; # ltrim whitespace - #$curr_xref_id =~ s/^("|')("|')$//; # strip quotes - may not be necessary + + if ($verbose) { + my $curr_text_label = $_->getAttributeNode('TextLabel')->getValue; + $curr_text_label =~ s/^\s+|\s+$//; # trim whitespace + print "$curr_text_label\t$curr_xref_id\n"; + } if (length($curr_xref_id) > 0) { -- 2.34.1