|
From: <rea...@us...> - 2026-04-16 06:37:22
|
Revision: 9480
http://sourceforge.net/p/sashimi/code/9480
Author: real_procopio
Date: 2026-04-16 06:37:19 +0000 (Thu, 16 Apr 2026)
Log Message:
-----------
[deprecation]
- Remove ancient protXML viewer, and any remaining references to it
- Replace cgi-based help page for PepXMLViewer with static HTML
- Rebalance Petunia tools menu
Modified Paths:
--------------
trunk/trans_proteomic_pipeline/perl/Makefile
trunk/trans_proteomic_pipeline/perl/tpp_gui/tpp_gui.pl
trunk/trans_proteomic_pipeline/src/Validation/ProteinProphet/ProteinProphet.cpp
trunk/trans_proteomic_pipeline/src/Visualization/PepXMLViewer/html/PepXMLViewer.html
Added Paths:
-----------
trunk/trans_proteomic_pipeline/html/show_pipeline_help.html
Removed Paths:
-------------
trunk/trans_proteomic_pipeline/perl/cgi-bin/protxml2html.pl
trunk/trans_proteomic_pipeline/perl/cgi-bin/show_pipeline_help.pl
Added: trunk/trans_proteomic_pipeline/html/show_pipeline_help.html
===================================================================
--- trunk/trans_proteomic_pipeline/html/show_pipeline_help.html (rev 0)
+++ trunk/trans_proteomic_pipeline/html/show_pipeline_help.html 2026-04-16 06:37:19 UTC (rev 9480)
@@ -0,0 +1,150 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <title>PepXML Viewer: Help</title>
+ <link rel="stylesheet" type="text/css" href="css/tpp.css" ></link>
+ <link rel="icon" type="text/x-icon" href="images/pep-xml.ico">
+ </head>
+
+ <body>
+
+ <div id="tppWrapper">
+
+ <div class="tppbanner" banner-bg-text="pepXML Help"> TPP: PepXML Viewer help</div>
+
+ <div style="max-width:950px;padding-top:60px;padding-left:30px;background-color:#fff;">
+
+ <h1 class="section">Getting Started</h1>
+ <p>
+ This program is used to view PepXML files, which contain
+ information about peptides derived from MS/MS (MS level 2)
+ data. In the Trans Proteomic Pipeline, these files are
+ iteratively modified by various programs as processing
+ progresses. A basic PepXML file might only contain
+ search-engine results, converted, for example, from Comet, X!Tandem,
+ Spectrast, SEQUEST or MASCOT.
+ A more complex file (or the same file after more
+ processing steps) might contain information about Peptide
+ Prophet-assigned peptide probabilities and/or peptide quantitation
+ info (derived from XPRESS, ASAPratio, LIBRA, etc.)
+ </p>
+
+ <p>
+ When the viewer program runs, it creates an "index" file with
+ a name similar to the xml file you're viewing. This file
+ contains information for quickly moving through the (larger)
+ PepXML file. You may safely delete these at any time;
+ however, the next time you invoke the viewer on this file, you
+ may notice a delay as the index file is rebuilt.
+ </p>
+
+
+ <h1 class="section">Understanding the Interface: Overview</h1>
+ <p>
+ The page has five menus and a data section.
+ </p>
+ <ul>
+ <li><b>Summary</b>: general information about the file you're
+ viewing, including stats based on the filtering options
+ you've selected. Keep an eye here and you see the number
+ of peptides in the current subset change as you apply
+ various filters.</li>
+
+ <li><b>Display Options</b>: any option (besides column selection)
+ that doesn't change the number of peptides in the
+ current subset. Here you'll find options like number of
+ rows per page to display, sort order, highlighting, and so
+ forth. Data can be sorted by index (number), spectrum
+ name, peptide, search scores, probability (when
+ relevant), XPRESS quantitation either descending or
+ ascending (when relevant), and ASAPRatio quantiation
+ either descending or ascending (when relevant). After
+ making selection, push the "Update Page" button.</li>
+
+ <li><b>Pick Columns</b>: column selection and ordering. Here
+ you'll see lists of displayed and undisplayed columns.
+ Click on a column name (hold 'control' and click to select
+ multiple names at one time) and move them up or down, or
+ hide or display them.</li>
+
+ <li><b>Filtering Options</b>: here you'll find choices to pare
+ down your currently displayed subset. The options here,
+ like in Display Options, will change based on the
+ information contained in a specific PepXML file. Data can
+ be filtered by probability (when relevant), precursor ion
+ charge, search scores, XPRESS quantitation (when
+ relevant), and ASAPRatio quantitation (when relevant). In
+ the latter cases, 'require valid ASAP Ratio' excluses
+ those entries lacking a ratio, or having a negative ratio;
+ a minimum and maximum ratio can also be set. In addition,
+ when both XPRESS and ASAPRatio data are available,
+ checking ' Require xpress ratio within asap mean +/-
+ error' excludes all results for which the two ratios
+ differ by more than one standard deviation. After making
+ selection, push the 'Update Page' button, or press the enter
+ key from a text box. Filter options remain set until the
+ 'Restore Original' button (found under 'Other Actions').</li>
+
+ <li><b>Other Actions:</b> 'Update Page' refreshes the display with
+ new options you've selected. 'Export Spreadsheet'
+ generates a tab-delimited file closely mimic the view of
+ the data in your browser, corresponding the the current
+ subset. A link to the generated excel spreadsheet is
+ displayed at the bottom of the 'Summary' section.
+ 'Generate Pep3D' runs that program with the current PepXML file
+ as input. 'Additional Analysis Info' is a link to the models
+ summary page, which also provides details
+ of MS/MS analysis, including for each input file, search
+ engine, and record of each analysis. To the far right,
+ the 'Restore Original' button will discard any display
+ or filter options and restore the entire subset.</li>
+
+ <li><b>Data Table</b>: this is where your data is displayed.
+ Each link brings you to another window with more
+ infomation. See below for more information.</li>
+
+ </ul>
+
+
+ <h1 class="section">Working with the Data</h1>
+ <p>
+ Information about most of the typical columns can be found
+ here. Note that not all of these columns will be
+ available if your PepXML file was not processed with a
+ specific program. Some entries in the data table also
+ contain links which provide additional infomation.
+ </p>
+
+ <ul>
+ <li><b>index</b> (entry number): unique search result id</li>
+ <li><b>probability</b>: probability that search result is correct
+ (e.g. as determined by PeptideProphet), with link to
+ probability analysis results. Note that these links
+ will be the same within one PepXML file.</li>
+ <li><b>spectrum</b>: links to comprehensive search results
+ (including runner up peptides, if avaliable). You can
+ highlight and filter this text.</li>
+ <li><b>search scores</b>: specific for each search engine contributing to dataset.</li>
+ <li><b>matched ions</b>: the fraction of peptide theoretical
+ fragment ions present in spectrum. Link to MS/MS
+ spectrum with assigned fragment ions.</li>
+ <li><b>peptide</b>: Best match from search engine for a given
+ spectrum. Linked to Blast launcher. Note that you can
+ highlight and filter this text.</li>
+ <li><b>protein(s)</b>: Link to database sequence viewre. Hover the mouse over
+ this link for a description, if avaliable. Addtional
+ proteins containing assigned peptide are listed out, if
+ "multiple protein hits" : "list of all hits" is selected
+ in display options.</li>
+ <li><b>XPRESS</b>: Quantitation with link to ion trace.</li>
+ <li><b>ASAPRatio</b>: Quantitation with link to ion trace.</li>
+ <li>PeptideProphet <b>F score</b>: composite score incorporating several search scores.</li>
+ </ul>
+ </div>
+
+ <footer id="tppPageFooter"><strong>Trans-Proteomic Pipeline</strong>:: PepXMLViewer Help<br/>_TPP_BUILDID_<br/></footer>
+
+ </div>
+ </body>
+</html>
+
Modified: trunk/trans_proteomic_pipeline/perl/Makefile
===================================================================
--- trunk/trans_proteomic_pipeline/perl/Makefile 2026-04-02 04:31:30 UTC (rev 9479)
+++ trunk/trans_proteomic_pipeline/perl/Makefile 2026-04-16 06:37:19 UTC (rev 9480)
@@ -207,10 +207,8 @@
install :: $(INSTALL_CGI)/mascotout.pl
install :: $(INSTALL_CGI)/plotpp.pl
install :: $(INSTALL_CGI)/promastcgi.pl
-install :: $(INSTALL_CGI)/protxml2html.pl
install :: $(INSTALL_CGI)/ProtXMLViewer.pl
install :: $(INSTALL_CGI)/qsir.pl
-install :: $(INSTALL_CGI)/show_pipeline_help.pl
install :: $(INSTALL_CGI)/show_tmp_pngfile.pl
install :: $(INSTALL_CGI)/tpp_files.pl
install :: $(INSTALL_CGI)/Seq2MS_json.pl
Deleted: trunk/trans_proteomic_pipeline/perl/cgi-bin/protxml2html.pl
===================================================================
--- trunk/trans_proteomic_pipeline/perl/cgi-bin/protxml2html.pl 2026-04-02 04:31:30 UTC (rev 9479)
+++ trunk/trans_proteomic_pipeline/perl/cgi-bin/protxml2html.pl 2026-04-16 06:37:19 UTC (rev 9480)
@@ -1,11129 +0,0 @@
-#!perl
-#############################################################################
-# Program : protxml2html.pl #
-# Author : Andrew Keller <ak...@sy...> #
-# Date : 3.28.03 #
-# SVN Info : $Id$
-# #
-# ProteinProphet #
-# #
-# Program : ProteinProphet T.M. #
-# Author : Andrew Keller <ak...@sy...> #
-# Date : 11.27.02 #
-# #
-# #
-# Copyright (C) 2003 Andrew Keller #
-# #
-# This library is free software; you can redistribute it and/or #
-# modify it under the terms of the GNU Lesser General Public #
-# License as published by the Free Software Foundation; either #
-# version 2.1 of the License, or (at your option) any later version. #
-# #
-# This library is distributed in the hope that it will be useful, #
-# but WITHOUT ANY WARRANTY; without even the implied warranty of #
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU #
-# General Public License for more details. #
-# #
-# You should have received a copy of the GNU Lesser General Public #
-# License along with this library; if not, write to the Free Software #
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA #
-# #
-# Andrew Keller #
-# Insitute for Systems Biology #
-# 1441 North 34th St. #
-# Seattle, WA 98103 USA #
-# ak...@sy... #
-# #
-#############################################################################
-use strict;
-use FindBin qw($Bin);
-use lib "$Bin/../lib/perl";
-use POSIX;
-use File::Spec; # use perl libs instead of depending on /^\/ as fullpath indicator
-use tpplib_perl; # exported TPP lib function points
-
-
-print "Content-type: text/html\n\n" if(@ARGV == 0 || ! ($ARGV[0] eq '-file'));
-
-my %box;
-%box = &tpplib_perl::read_query_string if $ENV{'REQUEST_METHOD'}; # Read keys and values
-
-
-#############################################################################
-# C O N F I G U R A T I O N A R E A
-#
-# ISB-CYGWIN Release?
-# This is a kludge to hardcode isb-cygwin specific
-# defaults for the following parameters. In the
-# future these defaults should be automatically filled
-# in by a true build system. See the code which immediately
-# follows this section for isb-cygwin defults.
-#
-########################################
-# ALL NON-ISB USERS: SET THIS VALUE TO 0
-my $ISB_VERSION = 0;
-########################################
-
-my $WINDOWS_CYGWIN = -f '/bin/cygpath';
-$ISB_VERSION = $WINDOWS_CYGWIN;
-
-# USE OUTSIDE OF ISB, UNCOMMENT THIS LINE
-#my $DISTR_VERSION = 1;
-
-# USE INSIDE ISB, UNCOMMENT THIS LINE
-my $DISTR_VERSION = 0;
-
-# forward declare variables
-my $CGI_HOME; # Full path web server home directory
-my $HELP_DIR; # Where all help png's are kept
-my $xslt; # Full path reference to a stylesheet processor
-my $DTD_FILE; # Full path reference to ProteinProphet_v1.7.dtd
-my $SERVER_ROOT = '';
-my $TOP_PATH;
-
-# Why define this? We never use this variable...oh but *we* do. We cleverly
-# rewrite paths in the perl code using simple text subsitutions via a perl
-# one-liner buried within the TPP make files. See the "perl_paths"
-# target/directory. Now the real question is what value should it have.
-my $base_dir;
-
-$TOP_PATH = tpplib_perl::getHomePath();
-$CGI_HOME = tpplib_perl::getCgiUrl();
-$HELP_DIR = tpplib_perl::getHtmlUrl() . "images/help";
-
-$xslt = 'xsltproc -novalid'; # disconnect dtd check (since only has web server reference name)
-
-
-#
-# Cygwin Configuration
-#
-if ( ($^O eq 'cygwin' )||($^O eq 'MSWin32' )) {
-
- if(exists $ENV{'WEBSERVER_ROOT'}) {
- my ($serverRoot) = ($ENV{'WEBSERVER_ROOT'} =~ /(\S+)/);
- if ( $WINDOWS_CYGWIN && $serverRoot =~ /\:/ ) {
- $serverRoot = `cygpath '$serverRoot'`;
- ($serverRoot) = ($serverRoot =~ /(\S+)/);
- }
- if ($^O eq 'MSWin32' ) {
- $serverRoot =~ s/\\/\//g; # get those path seps pointing right!
- }
- # make sure ends with '/'
- $serverRoot .= '/' if($serverRoot !~ /\/$/);
- $SERVER_ROOT = $serverRoot;
- if($SERVER_ROOT eq '') {
- die "cannot find WEBSERVER_ROOT environment variable\n";
- }
- }
- else {
- die "cannot find WEBSERVER_ROOT environment variable\n";
- }
-}
-# end configuration
-
-
-
-#
-# gather TPP version info
-#
-my $TPPVersionInfo = tpplib_perl::getTPPVersionInfo() || 'version n/a';
-my $TPPhostname = "http://" . tpplib_perl::get_tpp_hostname();
-
-my $LC_SERVER_ROOT = lc $SERVER_ROOT; # lower case
-
-my $GO_ONTOLOGY_CGI = 'goOntology';
-
-
-my $HTML = 0;
-my $HTML_ORIENTATION = 1; # whether or not
-my $SHTML = 1; # whether or not to use SSI to launch cgi instead of traditional written html file
-my $ICAT = 0;
-my $GLYC = 0;
-my $EXCEL = 0; # Generate XLS file from command-line (arg = EXCEL) -- outputs to file
-my $HTMLGEN = 0; # Generate HTML file from command-line (arg = HTML) -- outputs to stdout
-my $NOGAGGLE = 0; # If set, do not generate Gaggle files (command-line arg = NOGAGGLE)
-
-my $SINGLE_HITS = 0;
-my $DISPLAY_MODS = 1;
-my $MOD_MASS_ERROR = 0.5;
-
-# get rid of these all
-my $CALCULATE_PIES = $ISB_VERSION; #whether to calc pies on the fly
-my %prot_entries = (); # for pies, prob for each protein entry
-
-# write out new xsl stylesheet
-my $xmlfile;
-my $xslfile;
-my $pngfile = '';
-my $htmlfile;
-my $excelfile;
-
-my $gaggleNameValueFile;
-my $gaggleNameValueSize;
-
-my $gaggleNameListFile;
-my $gaggleNameListSize;
-
-my $gaggleMatrixFile;
-my $gaggleMatrixSize;
-
-my $sort_index = -1;
-my $start_string = 'start';
-my $start_string_comment = '<!--' . $start_string . '-->';
-my $USE_INDEX = 1; # whether to use explicit @index rather than num siblings
-$USE_INDEX = 1 if(scalar(@ARGV) >= 2 && $ARGV[1] eq 'index');
-
-my $RESULT_TABLE_PRE = '<table ';
-my $RESULT_TABLE = 'cellpadding="0" bgcolor="white" class="results">';
-my $RESULT_TABLE_SUF = '</table>';
-
-my $checked = 'CHECKED="yes"';
-
-my $inital_xsl = 0;
-my $MAX_NUM_ENTRIES = 2000; # if more than that, will filter at min prob
-my $MIN_PROT_PROB = 0.1;
-# in some environments, form info is transmitted as $ARGV[0]
-
-
-my $entry_delimiter = 8; # empty cell height for delimiting successive entries
-
-my $initiate = 0;
-if(scalar(@ARGV) > 1 && $ARGV[0] eq '-file' && $ARGV[1] =~ /^(\S+\.)xml(\.gz)?$/) { # take file name from arg
- $xmlfile = $ARGV[1];
- if ($^O eq 'MSWin32' ) {
- $xmlfile =~ s/\\/\//g; # get those path seps pointing right!
- }
- $xmlfile =~ /^(\S+\.)xml(\.gz)?$/; # reevaluate $1
- $xslfile = $1 . 'xsl';
- $excelfile = $1 . 'xls';
- $pngfile = $1 . 'png';
- $gaggleNameValueFile = $1 . 'nv.ggl';
- $gaggleNameListFile = $1 . 'nl.ggl';
- $gaggleMatrixFile = $1 . 'mx.ggl';
- if($SHTML) {
- $htmlfile = $1 . 'shtml';
- }
- else {
- $htmlfile = $1 . 'htm';
- }
-
- # check for icat
- for(my $k = 2; $k <= $#ARGV; $k++) {
- $ICAT = 1 if($ARGV[$k] eq 'ICAT');
- $GLYC = 1 if($ARGV[$k] eq 'GLYC');
- $EXCEL= 1 if($ARGV[$k] eq 'EXCEL');
- $HTMLGEN = 1 if($ARGV[$k] eq 'HTML');
- $NOGAGGLE = 1 if($ARGV[$k] eq 'NOGAGGLE');
- }
-
- $initiate = 1 unless ($EXCEL || $HTMLGEN);
-
-}
-elsif(exists $box{'xmlfile'} && $box{'xmlfile'} =~ /^(\S+\.)xml(\.gz)?$/) {
- $xmlfile = $box{'xmlfile'};
- if ($^O eq 'MSWin32' ) {
- $xmlfile =~ s/\\/\//g; # get those path seps pointing right!
- }
- $xmlfile =~ /^(\S+\.)xml(\.gz)?$/; # reevaluate $1
- $xslfile = $1 . 'xsl';
- $excelfile = $1 . 'xls';
- $pngfile = $1 . 'png';
- $gaggleNameValueFile = $1 . 'nv.ggl';
- $gaggleNameListFile = $1 . 'nl.ggl';
- $gaggleMatrixFile = $1 . 'mx.ggl';
- if($SHTML) {
- $htmlfile = $1 . 'shtml';
- }
- else {
- $htmlfile = $1 . 'htm';
- }
-} # if
-
-
-my $go_level = 0;
-my %go_prots = ();
-$go_level = $box{'go_level'} if(exists $box{'go_level'});
-
-my $NEW_XML_FORMAT = 1;
-# cancel DISPLAY_MODS for inappropriate directories running old version
-$DISPLAY_MODS = 0 if(! useXMLFormatLinks($xmlfile));
-
-$| = 1; # autoflush
-
-my $restore_view = exists $box{'restore_view'} && $box{'restore_view'} eq 'yes';
-
-$ICAT = 1 if(exists $box{'icat_mode'} && $box{'icat_mode'} eq 'yes');
-$GLYC = 1 if(exists $box{'glyc_mode'} && $box{'glyc_mode'} eq 'yes');
-my $pre_existing_xsl = 0;
-
-
-if(0 && $restore_view && ! -e $xslfile) {
- print "Error: Cannot find stylesheet for most recent view of dataset. Please recreate.\n\n";
- exit(1);
-}
-
-if(exists $box{'custom_settings'}) {
- if($box{'custom_settings'} eq 'current') {
- writeCustomizedSettings($xmlfile, 0, \%box);
- }
- elsif($box{'custom_settings'} eq 'default') {
- writeCustomizedSettings($xmlfile, 1, \%box);
-
- # full/short menu settings
- my $menu = exists $box{'menu'} ? $box{'menu'} : '';
- my $full_menu = exists $box{'full_menu'} ? $box{'full_menu'} : '';
- my $short_menu = exists $box{'short_menu'} ? $box{'short_menu'} : '';
-
- %box = %{getCustomizedSettings($xmlfile)}; # immediately get default settings
- $box{'menu'} = $menu if(! ($menu eq ''));
- $box{'full_menu'} = $full_menu if(! ($full_menu eq ''));
- $box{'short_menu'} = $short_menu if(! ($short_menu eq ''));
-
- }
-}
-
-
-if(exists $box{'outfile'}) {
-
- my $init_outfile = $box{'outfile'}; # for later
- # if windows name, convert it to cywin
- if($WINDOWS_CYGWIN && $box{'outfile'} =~ /\\/) {
- $box{'outfile'} = `cygpath '$box{'outfile'}'`;
- if($box{'outfile'} =~ /^(\S+)\s?/) {
- $box{'outfile'} = $1;
- }
- } # windows
- my $outfile = $box{'outfile'} . '.xml';
-
- if($box{'outfile'} eq '') {
- print " please go back and specify filename for displayed data\n";
- exit(1);
- }
- # check to make sure not same as self and steal full path from xmlfile
- else {
- # steal directory from xml fle
- if(!File::Spec->file_name_is_absolute($outfile)) {
- my ($vol,$dirs,$files) = File::Spec->splitpath($xmlfile);
- $outfile = File::Spec->catpath($vol,$dirs,$outfile);
- if($outfile =~ /^(\S+)\.xml(\.gz)?$/) {
- $box{'outfile'} = $1;
- }
- }
-
- my $index = index($xmlfile, $outfile);
- if((File::Spec->file_name_is_absolute($outfile) && $outfile eq $xmlfile) ||
- ($index >= 0 && $index + (length $outfile) == (length $xmlfile))) {
- if($HTML_ORIENTATION && $xmlfile =~ /^(\S+\.)xml(\.gz)?$/) {
- if($SHTML) {
- print " please go back and specify a filename for displayed data other than $init_outfile.shtml\n";
- }
- else {
- print " please go back and specify a filename for displayed data other than $init_outfile.htm\n";
- }
- }
- else {
- print " please go back and specify a filename for displayed data other than $init_outfile\n";
- }
- exit(1);
- }
- if(-e $outfile) {
-
- if($HTML_ORIENTATION && $outfile =~ /^(\S+\.)xml(\.gz)?$/) {
- if($SHTML) {
- print " $init_outfile.shtml already exists. Please go back and specify an alternative filename for displayed data\n";
- }
- else {
- print " $init_outfile.htm already exists. Please go back and specify an alternative filename for displayed data\n";
- }
- }
- else {
- print " $init_outfile already exists. Please go back and specify an alternative filename for displayed data\n";
- }
- exit(1);
- }
-
- my $suffix = $HTML_ORIENTATION ? '.htm' : '.xml';
-
- $suffix = '.shtml' if($SHTML);
- my $newhtmlfile = $box{'outfile'} . '.htm';
- $newhtmlfile = $box{'outfile'} . $suffix if($SHTML);
- writeXMLFile($box{'outfile'}, \%box, $xslt, $xmlfile); # both temporary xsl file and xmlfile....
- initialize($xslt, $box{'outfile'} . '.xml', $box{'outfile'} . '.xsl', \%box, $newhtmlfile, 0);
-
- # make local reference
- my $local_datafile = $box{'outfile'} . $suffix;
-
- if(! $ISB_VERSION) {
-
- $local_datafile = $box{'outfile'} . '.xml'; # BSP until shtml fixed
-
- # this should be just like after analysis: use local datafile link, but windows name for shtml file
-
- if((length $SERVER_ROOT) <= (length $local_datafile) &&
- index((lc $local_datafile), ($LC_SERVER_ROOT)) == 0) {
- $local_datafile = '/' . substr($local_datafile, (length $SERVER_ROOT));
- }
- else {
- die "problem (pr1): $local_datafile is not mounted under webserver root: $SERVER_ROOT\n";
- }
- my $windows_outfile = $outfile;
- if($WINDOWS_CYGWIN) {
- $windows_outfile = `cygpath -w '$outfile'`;
- if($windows_outfile =~ /^(\S+)\s?/) {
- $windows_outfile = $1;
- }
- }
- # use windows path here
- print " data written to $windows_outfile<br><br>\n";
- if (!exists $ENV{'WEBSERVER_TMP'}) { # if working in tmpdir, don't give misleading info
- print ' direct your browser to <a target="Win1" href="' . $local_datafile . '">' . "http://" . $TPPhostname . $local_datafile . '</a>' . "\n\n";
- }
- } # if iis & cygwin
- else { # unix
- if (!exists $ENV{'WEBSERVER_TMP'}) { # if working in tmpdir, don't give misleading info
- print ' data written to <a target="Win1" href="' . $local_datafile . '">' . $local_datafile . '</a>', "\n\n";
- }
- }
-
- }
-}
-else {
- if(!$xmlfile) {
- print " No xml file specified; please use the -file option\n";
- &printUsage();
- exit(1);
- }
-
- if($initiate) {
- initialize($xslt, $xmlfile, $xslfile, \%box, $htmlfile, 0);
- print "\n protein probabilities written to file ";
-
- if(! $ISB_VERSION) {
- my $local_ref = $HTML_ORIENTATION ? $htmlfile : $xmlfile;
- my $windows_ref = $xmlfile;
- if($WINDOWS_CYGWIN) {
- # get windows name
- $windows_ref = `cygpath -w '$xmlfile'`;
- }
- if($windows_ref =~ /^(\S+)\s?/) {
- $windows_ref = $1;
- print $windows_ref;
- }
- if((length $SERVER_ROOT) <= (length $local_ref) &&
- index((lc $local_ref), ($LC_SERVER_ROOT)) == 0) {
- $local_ref = '/' . substr($local_ref, (length $SERVER_ROOT));
- print "\n direct your browser to http://" . $TPPhostname . $local_ref if($HTML_ORIENTATION);
- }
- else {
- die "problem (pr2): $local_ref is not mounted under webserver root: $SERVER_ROOT\n";
- }
- } # if iis & cygwin
- elsif($HTML_ORIENTATION) {
- print $htmlfile;
- }
- else {
- print $xmlfile;
- }
- print "\n\n";
- }
- elsif ($EXCEL) {
- print "Writing results to tab-delimited file: $excelfile\n";
- writeTabDelimData($excelfile, $xslt, $xmlfile);
- print "Done!\n";
-
- }
- elsif ($HTMLGEN) {
- my $outfile = $htmlfile;
- $outfile =~ s/shtml$/html/i;
- print "Writing results to html file: $outfile\n";
-
- open(HTMLOUT, ">$outfile") or die "cannot open $outfile $!\n";
- my $ fh= select HTMLOUT;
- my $nrows = 0;
- my $ncols = 0;
- unless ($NOGAGGLE) {
- writeGaggleNameValueData($gaggleNameValueFile, $xslt, $xmlfile);
- $nrows = writeGaggleNameListData($gaggleNameListFile, $xslt, $xmlfile);
- $ncols = writeGaggleMatrixData($gaggleMatrixFile, $xslt, $xmlfile);
- }
- writeXSLFile($xslfile, \%box, 0, $nrows, $ncols) if(! $restore_view);
- printHTML($xslt, $xmlfile, $xslfile, \%box);
- select $fh;
- print "Done!\n";
-
- }
- else {
- if($restore_view) {
-
- if(-e $xslfile) {
- $pre_existing_xsl = 1;
- %box = %{readXSLFile($xslfile)};
-
- }
- else {
- %box = %{initialize($xslt, $xmlfile, $xslfile, \%box, $htmlfile, 1)}; # write the xsl file
- }
- }
- else {
- %box = %{getCustomizedSettings($xmlfile)} if(exists $box{'restore'} && $box{'restore'} eq 'yes'); # no longer need to keep track of 'restore'
- }
- $go_level = $box{'go_level'} if(exists $box{'go_level'});
-
- if(exists $box{'excel'} && $box{'excel'} eq 'yes') {
- writeTabDelimData($excelfile, $xslt, $xmlfile);
- print "\n"; # write something to prevent cgi timeout
- }
-
- if(exists $box{'action'} && $box{'action'} eq 'Recompute p-values') {
- if ($^O eq 'linux') {
- system($TOP_PATH."bin/ASAPRatioPvalueParser $xmlfile");
- }
- else {
- system("ASAPRatioPvalueParser $xmlfile");
- }
- }
- writeGaggleNameValueData($gaggleNameValueFile, $xslt, $xmlfile);
- my $nrows = writeGaggleNameListData($gaggleNameListFile, $xslt, $xmlfile);
- my $ncols = writeGaggleMatrixData($gaggleMatrixFile, $xslt, $xmlfile);
- writeXSLFile($xslfile, \%box, 0, $nrows, $ncols) if(! $restore_view);
- printHTML($xslt, $xmlfile, $xslfile, \%box);
- }
-}
-
-sub useXMLFormatLinks {
- (my $file) = @_;
- return $NEW_XML_FORMAT;
-}
-
-
-sub getGoOntology {
-(my $proteins, my $go_level) = @_;
-# first string together hidden info for ChenWei's program
-#return "making pie chart...\n";
-# new interface for chen wei
-# goOntology <full path curr dir> <web server dir> <level> <prot1> <wt1> <prot2> <wt2> ..
-# goOntology <level> <file> <curr dir> <web server dir>
-
-# need to specify the full path name and webserver name for directories
-my $dir = '';
-if($xmlfile =~ /^(\S+\/)\S+\.xml/) {
- $dir = $1;
-}
-my $local_dir = $dir;
-
-my $go_file = $dir . 'go_prots.txt';
-
-open(OUT, ">$go_file") or die "cannot open $go_file $!\n";
-foreach(keys %{$proteins}) {
- if(/^IPI\:(\S+)\.\d$/) {
- print OUT "$1\t${$proteins}{$_}\n";
- }
- else {
- print OUT "$_\t${$proteins}{$_}\n";
- }
-}
-
-
-close(OUT);
-
-
-if(! $ISB_VERSION) {
-
- if(exists $ENV{'WEBSERVER_ROOT'}) {
- # make sure ends with '/'
- my ($serverRoot) = ($ENV{'WEBSERVER_ROOT'} =~ /(\S+)/);
- if ( $serverRoot =~ /\:/ ) {
- $serverRoot = `cygpath '$serverRoot'`;
- ($serverRoot) = ($serverRoot =~ /(\S+)/);
- }
- if ($^O eq 'MSWin32' ) {
- $serverRoot =~ s/\\/\//g; # get those path seps pointing right!
- }
- # make sure ends with '/'
- $serverRoot .= '/' if($serverRoot !~ /\/$/);
- if((length $serverRoot) <= (length $dir)) {
- $local_dir = '/' . substr($local_dir, (length $serverRoot));
- }else {
- die "problem (pr3): >$local_dir< is not mounted under webserver root: >$serverRoot<\n";
- }
- }
-} # if not ISB version
-my $hide = 0;
-if($go_level > 100) { # hide
- $go_level = $go_level - 100;
- $hide = 1;
-}
-if($CALCULATE_PIES) {
- print "<HR/><font color=\"green\">Go Ontology Information: Level $go_level</font><p/>";
- my $command = '/regis/data3/search/akeller/GO_ONTOLOGY/Go.exe ' . $go_level . ' ' . $go_file . ' /regis/data3/search/akeller/GO_ONTOLOGY/';
- $command .= ' HIDE' if($hide);
- system($command);
- unlink($go_file) if(-e $go_file);
-# write output to file, which will be hyperlinked at top of output
-
-} # if calc pies
-
-
-}
-
-
-sub writeXMLFile {
-(my $file, my $boxptr, my $xslt, my $xml) = @_;
-
-my $tempxslfile = $file . '.tmp.xsl';
-
-
-open(OUT, ">$tempxslfile");
-print OUT '<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:protx="http://regis-web.systemsbiology.net/protXML">', "\n";
-
-print OUT '<xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes"/>', "\n";
-
-
-print OUT '<xsl:template match="node() | @*">', "\n";
-print OUT '<xsl:copy>', "\n";
-
-
-print OUT '<xsl:apply-templates select="*[not(self::protx:protein_group or self::protx:protein or self::protx:peptide)] | @*"/>';
-
-print OUT '<xsl:text>' . "\n" . '</xsl:text>';
-
-my $minprob = exists ${$boxptr}{'min_prob'} && ! (${$boxptr}{'min_prob'} eq '') ? ${$boxptr}{'min_prob'} : 0;
-my $minntt = exists ${$boxptr}{'min_ntt'} && ! (${$boxptr}{'min_ntt'} eq '') ? ${$boxptr}{'min_ntt'} : 0;
-
-my $maxnmc = exists ${$boxptr}{'max_nmc'} && ! (${$boxptr}{'max_nmc'} eq '') ? ${$boxptr}{'max_nmc'} : -1;
-my $pep_aa = exists ${$boxptr}{'pep_aa'} && ! (${$boxptr}{'pep_aa'} eq '') ? ${$boxptr}{'pep_aa'} : '';
-my $exclude_1 = exists ${$boxptr}{'ex1'} && ${$boxptr}{'ex1'} eq 'yes' ? ${$boxptr}{'ex1'} : '';
-my $exclude_2 = exists ${$boxptr}{'ex2'} && ${$boxptr}{'ex2'} eq 'yes' ? ${$boxptr}{'ex2'} : '';
-my $exclude_3 = exists ${$boxptr}{'ex3'} && ${$boxptr}{'ex3'} eq 'yes' ? ${$boxptr}{'ex3'} : '';
-
-my @inclusions = exists ${$boxptr}{'inclusions'} ? split(' ', ${$boxptr}{'inclusions'}) : ();
-my @exclusions = exists ${$boxptr}{'exclusions'} ? split(' ', ${$boxptr}{'exclusions'}) : ();
-my @pinclusions = exists ${$boxptr}{'pinclusions'} ? split(' ', ${$boxptr}{'pinclusions'}) : ();
-my @pexclusions = exists ${$boxptr}{'pexclusions'} ? split(' ', ${$boxptr}{'pexclusions'}) : ();
-
-# other variables needed?
-my $min_asap = exists ${$boxptr}{'min_asap'} && ! ${$boxptr}{'min_asap'} eq '' ? ${$boxptr}{'min_asap'} : 0;
-my $max_asap = exists ${$boxptr}{'max_asap'} && ! ${$boxptr}{'max_asap'} eq '' ? ${$boxptr}{'max_asap'} : 0;
-my $min_xpress = exists ${$boxptr}{'min_xpress'} && ! ${$boxptr}{'min_xpress'} eq '' ? ${$boxptr}{'min_xpress'} : 0;
-my $max_xpress = exists ${$boxptr}{'max_xpress'} && ! ${$boxptr}{'max_xpress'} eq '' ? ${$boxptr}{'max_xpress'} : 0;
-my $show_groups = exists ${$boxptr}{'show_groups'} && ! ${$boxptr}{'show_groups'} eq '' ? ${$boxptr}{'show_groups'} : '';
-my $min_pepprob = exists ${$boxptr}{'min_pepprob'} && ! ${$boxptr}{'min_pepprob'} eq '' ? ${$boxptr}{'min_pepprob'} : 0;
-my $filter_asap = exists ${$boxptr}{'filter_asap'} && ! ${$boxptr}{'filter_asap'} eq '' ? ${$boxptr}{'filter_asap'} : '';
-
-my $show_ggl = exists ${$boxptr}{'show_ggl'} && ${$boxptr}{'show_ggl'} eq 'yes' ? ${$boxptr}{'show_ggl'} : '';
-
-my $filter_xpress = exists ${$boxptr}{'filter_xpress'} ? ${$boxptr}{'filter_xpress'} : '';
-my $show_adjusted_asap = (! exists ${$boxptr}{'show_adjusted_asap'} && ! exists ${$boxptr}{'adj_asap'}) || (${$boxptr}{'show_adjusted_asap'} eq 'yes') ? ${$boxptr}{'show_adjusted_asap'} : '';
-#my $show_adjusted_asap = (${$boxptr}{'show_adjusted_asap'} eq 'yes') ? ${$boxptr}{'show_adjusted_asap'} : '';
-my $max_pvalue_display = exists ${$boxptr}{'max_pvalue'} && ! (${$boxptr}{'max_pvalue'} eq '') ? ${$boxptr}{'max_pvalue'} : 1.0;
-my $asap_xpress = exists ${$boxptr}{'asap_xpress'} ? ${$boxptr}{'asap_xpress'} : '';
-my $quant_light2heavy = ! exists ${$boxptr}{'quant_light2heavy'} || ${$boxptr}{'quant_light2heavy'} eq 'true' ? 'true' : 'false';
-
-
-# add filter_xpress and asap_xpress capabilities here....
-
-
-# apply-templates select="protx:protein_group"
-# SHOW GROUPS
-if(! ($show_groups eq '')) {
- print OUT '<xsl:apply-templates select="protx:protein_group[@probability >=\'' . $minprob . '\'';
- print OUT ' and protx:protein[@group_sibling_id = \'a\']/protx:analysis_result[@analysis=\'asapratio\'] and protx:protein[@group_sibling_id = \'a\']/protx:analysis_result[@analysis=\'asapratio\']/ASAPRatio/@ratio_mean >= \'0\' and protx:protein[@group_sibling_id = \'a\']/protx:analysis_result[@analysis=\'asapratio\']/protx:ASAPRatio/@ratio_standard_dev >= \'0\'' if(! ($filter_asap eq ''));
- print OUT ' and protx:protein[@group_sibling_id = \'a\']/protx:analysis_result[@analysis=\'xpress\'] and protx:protein[@group_sibling_id = \'a\']/protx:analysis_result[@analysis=\'xpress\']/protx:XPressRatio/@ratio_mean >= \'0\' and protx:protein[@group_sibling_id = \'a\']/protx:analysis_result[@analysis=\'xpress\']/protx:XPressRatio/@ratio_standard_dev >= \'0\'' if(! ($filter_xpress eq ''));
-
- print OUT ' and protx:protein[@group_sibling_id = \'a\']/protx:analysis_result[@analysis=\'xpress\'] and protx:protein[@group_sibling_id = \'a\']/protx:analysis_result[@analysis=\'xpress\']/protx:XPressRatio/@' . getRatioPrefix($quant_light2heavy) . 'ratio_mean >= \'' . $min_xpress . '\'' if($min_xpress > 0);
- print OUT ' and protx:protein[@group_sibling_id = \'a\']/protx:analysis_result[@analysis=\'xpress\'] and protx:protein[@group_sibling_id = \'a\']/protx:analysis_result[@analysis=\'xpress\']/protx:XPressRatio/@' . getRatioPrefix($quant_light2heavy) . 'ratio_mean <= \'' . $max_xpress . '\'' if($max_xpress > 0);
-
- if($show_adjusted_asap eq '' || ! exists ${$boxptr}{'adj_asap'}) {
- print OUT ' and protx:protein[@group_sibling_id = \'a\']/protx:analysis_result[@analysis=\'asapratio\'] and protx:protein[@group_sibling_id = \'a\']/protx:analysis_result[@analysis=\'asapratio\']/protx:ASAPRatio/@' . getRatioPrefix($quant_light2heavy) . 'ratio_mean >= \'' . $min_asap . '\'' if($min_asap > 0);
- print OUT ' and protx:protein[@group_sibling_id = \'a\']/protx:analysis_result[@analysis=\'asapratio\'] and protx:protein[@group_sibling_id = \'a\']/protx:analysis_result[@analysis=\'asapratio\']/protx:ASAPRatio/@' . getRatioPrefix($quant_light2heavy) . 'ratio_mean <= \'' . $max_asap . '\'' if($max_asap > 0);
-
- print OUT ' and (not(protx:protein[@group_sibling_id = \'a\']/protx:analysis_result[@analysis=\'asapratio\']) or not(protx:protein[@group_sibling_id = \'a\']/protx:analysis_result[@analysis=\'xpress\']) or ((protx:protein[@group_sibling_id = \'a\']/protx:analysis_result[@analysis=\'xpress\']/protx:XPressRatio/@ratio_mean + protx:protein[@group_sibling_id = \'a\']/protx:analysis_result[@analysis=\'xpress\']/protx:XPressRatio/@ratio_standard_dev - protx:protein[@group_sibling_id = \'a\']/protx:analysis_result[@analysis=\'asapratio\']/protx:ASAPRatio/@'. getRatioPrefix($quant_light2heavy).'ratio_mean + protx:protein[@group_sibling_id = \'a\']/protx:analysis_result[@analysis=\'asapratio\']/protx:ASAPRatio/@'. getRatioPrefix($quant_light2heavy) .'ratio_standard_dev >= \'0\') and (protx:protein[@group_sibling_id = \'a\']/protx:analysis_result[@analysis=\'asapratio\']/protx:ASAPRatio/@'. getRatioPrefix($quant_light2heavy) .'ratio_mean + protx:protein[@group_sibling_id = \'a\']/protx:analysis_result[@analysis=\'asapratio\']/protx:ASAPRatio/@'. getRatioPrefix($quant_light2heavy) .'ratio_standard_dev - protx:protein[@group_sibling_id = \'a\']/protx:analysis_result[@analysis=\'xpress\']/protx:XPressRatio/@ratio_mean + protx:protein[@group_sibling_id = \'a\']/protx:analysis_result[@analysis=\'xpress\']/protx:XPressRatio/@ratio_standard_dev >= \'0\')))' if(! ($asap_xpress eq ''));
-
- }
- else { # use adjusted values
- print OUT ' and protx:protein[@group_sibling_id = \'a\']/protx:analysis_result[@analysis=\'asapratio_pvalue\'] and protx:protein[@group_sibling_id = \'a\']/protx:analysis_result[@analysis=\'asapratio_pvalue\']/protx:ASAPRatio_pvalue/@' . getRatioPrefix($quant_light2heavy) . 'adj_ratio_mean >= \'' . $min_asap . '\'' if($min_asap > 0);
- print OUT ' and protx:protein[@group_sibling_id = \'a\']/protx:analysis_result[@analysis=\'asapratio_pvalue\'] and protx:protein[@group_sibling_id = \'a\']/protx:analysis_result[@analysis=\'asapratio_pvalue\']/protx:ASAPRatio_pvalue/@' . getRatioPrefix($quant_light2heavy) . 'adj_ratio_mean <= \'' . $max_asap . '\'' if($max_asap > 0);
- print OUT ' and (not(protx:protein[@group_sibling_id = \'a\']/protx:analysis_result[@analysis=\'asapratio_pvalue\']) or not(protx:protein[@group_sibling_id = \'a\']/protx:analysis_result[@analysis=\'xpress\']) or ((protx:protein[@group_sibling_id = \'a\']/protx:analysis_result[@analysis=\'xpress\']/protx:XPressRatio/@ratio_mean + protx:protein[@group_sibling_id = \'a\']/protx:analysis_result[@analysis=\'xpress\']/protx:XPressRatio/@ratio_standard_dev - protx:protein[@group_sibling_id = \'a\']/protx:analysis_result[@analysis=\'asapratio_pvalue\']/protx:ASAPRatio_pvalue/@adj_ratio_mean + protx:protein[@group_sibling_id = \'a\']/protx:analysis_result[@analysis=\'asapratio_pvalue\']/protx:ASAPRatio_pvalue/@adj_ratio_standard_dev >= \'0\') and (protx:protein[@group_sibling_id = \'a\']/protx:analysis_result[@analysis=\'asapratio_pvalue\']/protx:ASAPRatio_pvalue/@adj_ratio_mean + protx:protein[@group_sibling_id = \'a\']/protx:analysis_result[@analysis=\'asapratio_pvalue\']/protx:ASAPRatio_pvalue/@adj_ratio_standard_dev - protx:protein[@group_sibling_id = \'a\']/protx:analysis_result[@analysis=\'xpress\']/protx:XPressRatio/@ratio_mean + protx:protein[@group_sibling_id = \'a\']/protx:analysis_result[@analysis=\'xpress\']/protx:XPressRatio/@ratio_standard_dev >= \'0\')))' if(! ($asap_xpress eq ''));
-
- }
- print OUT ' and protx:protein[@group_sibling_id = \'a\']/protx:analysis_result[@analysis=\'asapratio_pvalue\'] and protx:protein[@group_sibling_id = \'a\']/protx:analysis_result[@analysis=\'asapratio_pvalue\']/protx:ASAPRatio_pvalue/@decimal_pvalue <= \'' . $max_pvalue_display . '\'' if($max_pvalue_display < 1.0);
- for(my $e = 0; $e <= $#exclusions; $e++) {
- print OUT ' and not(@group_number=\'' . $exclusions[$e] . '\')';
- }
- print OUT ']"/>';
-
- if(@inclusions) {
- my $first = 1;
- foreach(@inclusions) {
- if($first) {
- print OUT '<xsl:apply-templates select="protx:protein_group[@group_number=\'' . $_ . '\'';
- $first = 0;
- }
- else {
- print OUT ' or @group_number=\'' . $_ . '\'';
- }
- }
- print OUT ']"/>';
- } # if have some inclusions
-} # show groups
-# HIDE GROUPS
-else {
- print OUT '<xsl:apply-templates select="protx:protein_group[@probability >=\'' . $minprob . '\'';
- print OUT ' and protx:protein[protx:analysis_result[@analysis=\'asapratio\'] and protx:analysis_result[@analysis=\'asapratio\']/protx:ASAPRatio/@'. getRatioPrefix($quant_light2heavy) .'ratio_mean >= \'0\' and protx:analysis_result[@analysis=\'asapratio\']/protx:ASAPRatio/@'. getRatioPrefix($quant_light2heavy) .'ratio_standard_dev >= \'0\']' if(! ($filter_asap eq ''));
- print OUT ' and protx:protein[protx:analysis_result[@analysis=\'xpress\'] and protx:XPressRatio/@ratio_mean >= \'0\' and protx:analysis_result[@analysis=\'xpress\']/protx:XPressRatio/@ratio_standard_dev >= \'0\']' if(! ($filter_xpress eq ''));
- print OUT ' and protx:protein[protx:analysis_result[@analysis=\'xpress\'] and protx:analysis_result[@analysis=\'xpress\']/protx:XPressRatio/@' . getRatioPrefix($quant_light2heavy) . 'ratio_mean >= \'' . $min_xpress . '\']' if($min_xpress > 0);
- print OUT ' and protx:protein[protx:analysis_result[@analysis=\'xpress\'] and protx:analysis_result[@analysis=\'xpress\']/protx:XPressRatio/@' . getRatioPrefix($quant_light2heavy) . 'ratio_mean <= \'' . $max_xpress . '\']' if($max_xpress > 0);
- if($show_adjusted_asap eq '' || ! exists ${$boxptr}{'adj_asap'}) {
- print OUT ' and protx:protein[protx:analysis_result[@analysis=\'asapratio\'] and protx:analysis_result[@analysis=\'asapratio\']/protx:ASAPRatio/@' . getRatioPrefix($quant_light2heavy) . 'ratio_mean >= \'' . $min_asap . '\']' if($min_asap > 0);
- print OUT ' and protx:protein[protx:analysis_result[@analysis=\'asapratio\'] and protx:analysis_result[@analysis=\'asapratio\']/protx:ASAPRatio/@' . getRatioPrefix($quant_light2heavy) . 'ratio_mean <= \'' . $max_asap . '\']' if($max_asap > 0);
- print OUT ' and (not(protx:protein/protx:analysis_result[@analysis=\'asapratio\']) or not(protx:protein/protx:analysis_result[@analysis=\'xpress\']) or protx:protein[protx:analysis_result[@analysis=\'xpress\']/protx:XPressRatio/@ratio_mean + protx:analysis_result[@analysis=\'xpress\']/protx:XPressRatio/@ratio_standard_dev - protx:analysis_result[@analysis=\'asapratio\']/protx:ASAPRatio/@'. getRatioPrefix($quant_light2heavy) .'ratio_mean + protx:analysis_result[@analysis=\'asapratio\']/protx:ASAPRatio/@'. getRatioPrefix($quant_light2heavy) .'ratio_standard_dev >= \'0\' and protx:analysis_result[@analysis=\'asapratio\']/protx:ASAPRatio/@'. getRatioPrefix($quant_light2heavy) .'ratio_mean + protx:analysis_result[@analysis=\'asapratio\']/protx:ASAPRatio/@'. getRatioPrefix($quant_light2heavy) .'ratio_standard_dev - protx:analysis_result[@analysis=\'xpress\']/protx:XPressRatio/@ratio_mean + protx:analysis_result[@analysis=\'xpress\']protx:XPressRatio/@ratio_standard_dev >= \'0\'])' if(! ($asap_xpress eq ''));
- }
- else { # show adjusted
- print OUT ' and protx:protein[protx:analysis_result[@analysis=\'asapratio_pvalue\'] and protx:analysis_result[@analysis=\'asapratio_pvalue\']/protx:ASAPRatio_pvalue/@' . getRatioPrefix($quant_light2heavy) . 'adj_ratio_mean >= \'' . $min_asap . '\']' if($min_asap > 0);
- print OUT ' and protx:protein[protx:analysis_result[@analysis=\'asapratio_pvalue\'] and protx:analysis_result[@analysis=\'asapratio_pvalue\']/protx:ASAPRatio_pvalue/@' . getRatioPrefix($quant_light2heavy) . 'adj_ratio_mean <= \'' . $max_asap . '\']' if($max_asap > 0);
- print OUT ' and (not(protx:protein/protx:analysis_result[@analysis=\'asapratio_pvalue\']) or not(protx:protein/protx:analysis_result[@analysis=\'xpress\']) or protx:protein[protx:analysis_result[@analysis=\'xpress\']/protx:XPressRatio/@ratio_mean + protx:analysis_result[@analysis=\'xpress\']/protx:XPressRatio/@ratio_standard_dev - protx:analysis_result[@analysis=\'asapratio_pvalue\']/protx:ASAPRatio_pvalue/@adj_ratio_mean + protx:analysis_result[@analysis=\'asapratio_pvalue\']/protx:ASAPRatio_pvalue/@adj_ratio_standard_dev >= \'0\' and protx:analysis_result[@analysis=\'asapratio_pvalue\']/protx:ASAPRatio_pvalue/@adj_ratio_mean + protx:analysis_result[@analysis=\'asapratio_pvalue\']/protx:ASAPRatio_pvalue/@adj_ratio_standard_dev - protx:analysis_result[@analysis=\'xpress\']protx:XPressRatio/@ratio_mean + protx:analysis_result[@analysis=\'xpress\']/protx:XPressRatio/@ratio_standard_dev >= \'0\'])' if(! ($asap_xpress eq ''));
- }
- print OUT ' and protx:protein[protx:analysis_result[@analysis=\'asapratio_pvalue\'] and protx:analysis_result[@analysis=\'asapratio_pvalue\']/protx:ASAPRatio_pvalue/@decimal_pvalue <= \'' . $max_pvalue_display . '\]' if($max_pvalue_display < 1.0);
- foreach(@exclusions) {
- print OUT ' and not(@group_number=\'' . $_ . '\')';
- }
- print OUT ']"/>';
-
-if(@inclusions) {
- my $first = 1;
- foreach(@inclusions) {
- if($first) {
- print OUT '<xsl:apply-templates select="protx:protein_group[@group_number=\'' . $_ . '\'';
- $first = 0;
- }
- else {
- print OUT ' or @group_number=\'' . $_ . '\'';
- }
- }
- print OUT ']"/>';
-} # if have some inclusions
-}
-# apply-templates select="protx:protein"
-if(! ($show_groups eq '')) {
- print OUT '<xsl:apply-templates select="protx:protein"/>';
-}
-# HIDE GROUPS
-else {
-
-# make sure there are no pexclusions or pinclusions
- print OUT '<xsl:apply-templates select="protx:protein[@probability >=\'' . $minprob . '\'';
- print OUT ' and protx:analysis_result[@analysis=\'asapratio\'] and protx:analysis_result[@analysis=\'asapratio\']/protx:ASAPRatio/@'. getRatioPrefix($quant_light2heavy) .'ratio_mean >= \'0\' and protx:analysis_result[@analysis=\'asapratio\']/protx:ASAPRatio/@'. getRatioPrefix($quant_light2heavy) .'ratio_standard_dev >= \'0\'' if(! ($filter_asap eq ''));
- print OUT ' and protx:analysis_result[@analysis=\'xpress\'] and protx:analysis_result[@analysis=\'xpress\']/protx:XPressRatio/@ratio_mean >= \'' . $min_xpress . '\'' if($min_xpress > 0);
- print OUT ' and protx:analysis_result[@analysis=\'xpress\'] and protx:analysis_result[@analysis=\'xpress\']/protx:XPressRatio/@ratio_mean <= \'' . $max_xpress . '\'' if($max_xpress > 0);
- if($show_adjusted_asap eq '' || ! exists ${$boxptr}{'adj_asap'}) {
- print OUT ' and protx:analysis_result[@analysis=\'asapratio\'] and protx:analysis_result[@analysis=\'asapratio\']/protx:ASAPRatio/@'. getRatioPrefix($quant_light2heavy) .'ratio_mean >= \'' . $min_asap . '\'' if($min_asap > 0);
- print OUT ' and protx:analysis_result[@analysis=\'asapratio\'] and protx:analysis_result[@analysis=\'asapratio\']/protx:ASAPRatio/@'. getRatioPrefix($quant_light2heavy) .'ratio_mean <= \'' . $max_asap . '\'' if($max_asap > 0);
- }
- else { # show adjusted
- print OUT ' and protx:analysis_result[@analysis=\'asapratio_pvalue\'] and protx:analysis_result[@analysis=\'asapratio_pvalue\']/protx:ASAPRatio_pvalue/@adj_ratio_mean >= \'' . $min_asap . '\'' if($min_asap > 0);
- print OUT ' and protx:analysis_result[@analysis=\'asapratio_pvalue\'] and protx:analysis_result[@analysis=\'asapratio_pvalue\']/protx:ASAPRatio_pvalue/@adj_ratio_mean <= \'' . $max_asap . '\'' if($max_asap > 0);
- }
- print OUT ' and protx:analysis_result[@analysis=\'asapratio_pvalue\'] and protx:analysis_result[@analysis=\'asapratio_pvalue\']/protx:ASAPRatio_pvalue/@decimal_pvalue <= \'' . $max_pvalue_display . '\'' if($max_pvalue_display < 1.0);
-
- foreach(@pexclusions) {
- if(/^(\d+)([a-z,A-Z])$/) {
- print OUT ' and not(parent::node()/@group_number=\'' . $1 . '\' and @group_sibling_id=\'' . $2 . '\')';
- }
- }
-
- print OUT ']"/>';
- if(@pinclusions > 0) {
- my $first = 1;
- foreach(@pinclusions) {
- if(/^(\d+)([a-z,A-Z])$/) {
- if($first) {
- $first = 0;
- print OUT '<xsl:apply-templates select="protx:protein[(parent::node()/@group_number=\'' . $1 . '\' and @group_sibling_id=\'' . $2 . '\')';
- }
- else {
- print OUT ' or (parent::node()/@group_number=\'' . $1 . '\' and @group_sibling_id=\'' . $2 . '\')';
- }
- }
- }
- print OUT ']"/>';
-
- }
-
-}
-
-print OUT '<xsl:apply-templates select="protx:peptide[@nsp_adjusted_probability >= \'' . $min_pepprob . '\'';
-print OUT ' and @n_enzymatic_termini >=\''. $minntt . '\'' if($minntt > 0);
-print OUT ' and not(@charge=\'1\')' if(! ($exclude_1 eq ''));
-print OUT ' and not(@charge=\'2\')' if(! ($exclude_2 eq ''));
-print OUT ' and not(@charge=\'3\')' if(! ($exclude_3 eq ''));
-print OUT ']"/>';
-
-# apply-templates select="peptide"
-
-
-print OUT '</xsl:copy>';
-print OUT '</xsl:template>', "\n";
-print OUT '</xsl:stylesheet>', "\n";
-close(OUT);
-
-my $outfile = $file . '.xml'; #'tempfile.xml';
-
-
-# now compute filter
-my $filter = '';
-if($minprob > 0) {
- if($show_groups eq '') {
- $filter .= 'min_prot_prob=\'' . $minprob . '\' ';
- }
- else { # group
- $filter .= 'min_group_prob=\'' . $minprob . '\' ';
- }
-}
-$filter .= 'exclude_illegal_XPRESSRatios=\'Y\' ' if($filter_xpress);
-$filter .= 'exclude_illegal_ASAPRatios=\'Y\' ' if($filter_asap);
-my $asap_prefix = $show_adjusted_asap eq '' || ! exists ${$boxptr}{'adj_asap'} ? '' : 'adj_';
-$filter .= 'asap_xpress_consistency=\'Y\' ' if(! ($asap_xpress eq ''));
-$filter .= 'min_' . getRatioPrefix($quant_light2heavy) . 'xpress=\'' . $min_xpress . '\' ' if($min_xpress > 0);
-$filter .= 'max_' . getRatioPrefix($quant_light2heavy) . 'xpress=\'' . $max_xpress . '\' ' if($max_xpress > 0);
-$filter .= $asap_prefix . 'min_' . getRatioPrefix($quant_light2heavy) . 'asap=\'' . $min_asap . '\' ' if($min_asap > 0);
-$filter .= $asap_prefix . 'max_' . getRatioPrefix($quant_light2heavy) . 'asap=\'' . $max_asap . '\' ' if($max_asap > 0);
-$filter .= 'max_pvalue=\'' . $max_pvalue_display . '\' ' if($max_pvalue_display < 1.0);
-$filter .= 'min_pepprob=\'' . $min_pepprob . '\' ' if($min_pepprob > 0);
-$filter .= 'minntt=\'' . $minntt . '\' ' if($minntt > 0);
-$filter .= 'maxnmc=\'' . $maxnmc . '\' ' if($maxnmc >= 0);
-$filter .= 'exclude_1+_peptides=\'Y\' ' if($exclude_1);
-$filter .= 'exclude_2+_peptides=\'Y\' ' if($exclude_2);
-$filter .= 'exclude_3+_peptides=\'Y\' ' if($exclude_3);
-$filter .= 'group_entry_inclusions=\'' . join(',', @inclusions) . '\' ' if(@inclusions > 0);
-$filter .= 'group_entry_exclusions=\'' . join(',', @exclusions) . '\' ' if(@exclusions > 0);
-$filter .= 'protein_entry_inclusions=\'' . join(',', @pinclusions) . '\' ' if(@pinclusions > 0);
-$filter .= 'protein_entry_exclusions=\'' . join(',', @pexclusions) . '\' ' if(@pexclusions > 0);
-
-
-# if $xmlfile is gzipped, returns tmpfile name, else returns $xmlfile
-my $tmp_xml = tpplib_perl::uncompress_to_tmpfile($xml);
-
-if($xslt =~ /xsltproc/) {
- open XALAN, "$xslt $tempxslfile $tmp_xml |" or print "cannot open $xslt\n";;
-}
-else {
- open XALAN, "$xslt $tmp_xml $tempxslfile |" or print "cannot open $xslt\n";;
-}
-open(XML, ">$outfile");
-
-my $start = 1;
-my $counter = 1;
-my $parentfile = $xmlfile;
-if($HTML_ORIENTATION && $xmlfile =~ /^(\S+\.)xml(\.gz)?$/) {
- if($SHTML) {
- $parentfile = $1 . 'shtml';
- }
- else {
- $parentfile = $1 . 'htm';
- }
-}
-
-# make local reference
-my $local_parent = $parentfile;
-my $windows_parent = '';
-if(! $ISB_VERSION) {
- if((length $SERVER_ROOT) <= (length $local_parent) &&
- index((lc $local_parent), ($LC_SERVER_ROOT)) == 0) {
- $local_parent = '/' . substr($local_parent, (length $SERVER_ROOT));
- if($WINDOWS_CYGWIN) {
- $windows_parent = `cygpath -w '$outfile'`;
- if($windows_parent =~ /^(\S+)\s?/) {
- $windows_parent = $1;
- }
- }
- }
- else {
- die "problem (pr4): $local_parent is not mounted under webserver root: $SERVER_ROOT\n";
- }
-} # if iis & cygwin
-
-
-# check for stylesheet reference
-my $xsltproc = $xslt =~ /xsltproc/;
-my $doctype = 0;
-while(<XALAN>) {
- if($start && /^(\<\?xml\-stylesheet type\=\"text\/xsl\" href\=\")\S+(\"\?\>.*)$/) {
- my $local_xslfile = $file . '.xsl';
-
- if(! $ISB_VERSION) {
- if((length $SERVER_ROOT) <= (length $local_xslfile) &&
- index((lc $local_xslfile), ($LC_SERVER_ROOT)) == 0) {
- $local_xslfile = '/' . substr($local_xslfile, (length $SERVER_ROOT));
- }
- else {
- die "problem (pr5): $local_xslfile is not mounted under webserver root: $SERVER_ROOT\n";
- }
- } # if iis & cygwin
- print XML $1 . $local_xslfile . $2;
- $start = 0;
- }
- elsif($start && ! $doctype && /^\<protx\:protein\_summary/) {
- my $local_xslfile = $file . '.xsl';
-
- if(! $ISB_VERSION) {
- if((length $SERVER_ROOT) <= (length $local_xslfile) &&
- index((lc $local_xslfile), ($LC_SERVER_ROOT)) == 0) {
- $local_xslfile = '/' . substr($local_xslfile, (length $SERVER_ROOT));
- }
- else {
- die "problem (pr6): $local_xslfile is not mounted under webserver root: $SERVER_ROOT\n";
- }
- } # if iis & cygwin
- print XML '<?xml-stylesheet type="text/xsl" href="' . $local_xslfile . '"? xmlns:protx="http://regis-web.systemsbiology.net/protXML">' . "\n";
- print XML;
- $start = 0;
- }
- # make replacements to num predicted correct prots and parent data file, as well as sens / err data
- elsif(/^(.*dataset\_derivation generation\_no\=\")(\d+)(\".*)$/) {
- my $first = $1;
- my $second = $2;
- my $third = $3;
- if(! ($filter eq '')) { # then there is something to do
- if($xslt =~ /xsltproc/) {
- my $update = $first . ($second+1) . '">';
- my $next = $second + 1;
- my $rest = $third;
-
- if($third =~ /^(\"\>.*?)(\<data\_filter\s+.*)/) {
- print XML $first . ($second+1) . $1 . "\n";
- print XML '<data_filter number="' . ($second+1) . '" parent_file="' . $local_parent;
- print XML '" windows_parent="' . $windows_parent if($WINDOWS_CYGWIN);
- print XML '" description="' . $filter . '"/>', "\n";
- print XML $2 . "\n";
- }
- else {
- print XML $first . ($second+1) . $third, "\n";
- # now add current filter
- print XML '<data_filter number="' . ($second+1) . '" parent_file="' . $local_parent;
- print XML '" windows_parent="' . $windows_parent if($WINDOWS_CYGWIN);
- print XML '" description="' . $filter . '"/>', "\n";
- }
- } # xsltproc
- else {
- print XML $first . ($second+1) . $third, "\n";
- # now add current filter
- print XML '<data_filter number="' . ($second+1) . '" parent_file="' . $local_parent;
- print XML '" windows_parent="' . $windows_parent if($WINDOWS_CYGWIN);
- print XML '" description="' . $filter . '"/>', "\n";
- }
-
- }
- else {
- print XML;
- }
- }
-
- elsif($USE_INDEX && /^(.*\<protx\:protein_group.*?group_number\=\")\d+(\".*)$/) {
- print XML $1 . $counter++ . $2;
- }
- else {
- if($start && /DOCTYPE/) {
- $doctype = 1;
- }
- print XML;
- }
-}
-
-close(XML);
-close(XALAN);
-unlink($tmp_xml) if ($tmp_xml ne $xml); # did we decompress protxml.gz?
-
-
-$inital_xsl = $counter > $MAX_NUM_ENTRIES;
-unlink($tempxslfile) if(-e $tempxslfile);
-unlink("$outfile.tmp") if(-e "$outfile.tmp");
-${$boxptr}{'restore'} = 'yes'; # for new xsl
-${$boxptr}{'xmlfile'} = $file . '.xml';
-if(exists $box{'xmlfile'} && $box{'xmlfile'} =~ /^(\S+\.)xml(\.gz)?$/) {
- $xmlfile = $box{'xmlfile'};
- $xslfile = $1 . 'xsl';
- $excelfile = $1 . 'xls';
-}
-
-}
-
-
-sub writeTabDelimData {
- (my $outfile, my $engine, my $xml) = @_;
- my $tempxslfile = $xmlfile . '.tmp.xsl';
- my $tempfile = $xmlfile . '.tmp.xls';
-
- my $text = exists $box{'text1'} ? $box{'text1'} : '';
- my @select_aas = ();
- if(exists $box{'pep_aa'} && ! ($box{'pep_aa'} eq '')) {
- for(my $k = 0; $k < (length $box{'pep_aa'}); $k++) {
- my $next = substr($box{'pep_aa'}, $k);
- if($next =~ /^[a-z,A-Z](\d\d+)/) {
- my $mass = $1;
- push(@select_aas, substr($box{'pep_aa'}, $k, 1) . '[' . $mass . ']');
- $k += (length $mass);
- }
- else {
- push(@select_aas, substr($box{'pep_aa'}, $k, 1));
- }
- }
- }
-
- unlink($tempxslfile) if(-e $tempxslfile);
- unlink($tempfile) if(-e $tempfile);
- writeXSLFile($tempxslfile, \%box, 1, 0, 0);
-
- if($xslt =~ /xsltproc/) {
- system("$engine $tempxslfile $xml > $tempfile");
- }
- else {
- system("$engine $xml $tempxslfile > $tempfile");
- }
- open(OUT, ">$outfile") or die "cannot open $outfile $!\n";
- open(IN, "$tempfile") or die "cannot open $tempfile $!\n";
- my $start = 0;
- my $active = 0;
- my $prot_ind = -1;
- my $pep_ind = -1;
- my $first = 1;
- while(<IN>) {
- if(index($_, $start_string_comment) >= 0) {
- $start = 1;
- }
- elsif($start) {
- if(/\S/) {
- $active = 1;
- }
- if(/^\<\/form/ || /^\<\/table/) {
- $start = 0;
- }
- elsif($active) {
- if(@select_aas > 0 || ! ($text eq '')) {
- chomp();
- my @parsed = split('\t');
- if($first) {
- for(my $p = 0; $p <= $#parsed; $p++) {
- if($prot_ind == -1 && $parsed[$p] eq 'protein') {
- $prot_ind = $p;
- }
- elsif($pep_ind == -1 && $parsed[$p] eq 'peptide sequence') {
- $pep_ind = $p;
- }
- }
- print OUT "$_\n";
- $first = 0; # done
- }
- else {
- my $ok = 1;
- for(my $p = 0; $p <= $#parsed; $p++) {
- for(my $s = 0; $s <= $#select_aas; $s++) {
- $ok &&= $pep_ind >= @parsed || $pep_ind == -1 || $p != $pep_ind || index($parsed[$p], $select_aas[$s]) >= 0;
- }
- $ok &&= $prot_ind >= @parsed || $prot_ind == -1 || $p != $prot_ind || index($parsed[$p], $text) >= 0; # =~ /$text/;
- }
- print OUT "$_\n" if($ok);
- } # not first
- }
- else {
- print OUT;
- }
- }
- }
- elsif(0 && ! $start && /^\<font color\=\"green\"\>(\S.*)\<\/font\>/) {
- print OUT "$1\n";
- }
- }
- close(IN);
- close(OUT);
- unlink($tempfile) if(-e $tempfile);
- unlink($tempxslfile) if(-e $tempxslfile);
-
- chmod 0666, $outfile;
-}
-
-sub writeGaggleNameListData {
- (my $outfile, my $engine, my $xml) = @_;
- my $tempxslfile = $xmlfile . '.tmp.nl.ggl.xsl';
- my $tempfile = $xmlfile . '.tmp.nl.ggl';
-
- my $text = exists $box{'text1'} ? $box{'text1'} : '';
- my @select_aas = ();
- if(exists $box{'pep_aa'} && ! ($box{'pep_aa'} eq '')) {
- for(my $k = 0; $k < (length $box{'pep_aa'}); $k++) {
- my $next = substr($box{'pep_aa'}, $k);
- if($next =~ /^[a-z,A-Z](\d\d+)/) {
- my $mass = $1;
- push(@select_aas, substr($box{'pep_aa'}, $k, 1) . '[' . $mass . ']');
- $k += (length $mass);
- }
- else {
- push(@select_aas, substr($box{'pep_aa'}, $k, 1));
- }
- }
- }
-
-
- unlink($tempxslfile) if(-e $tempxslfile);
- unlink($tempfile) if(-e $tempfile);
- writeGaggleNameListXSLFile($tempxslfile, \%box);
-
- if($xslt =~ /xsltproc/) {
- system("$engine $tempxslfile $xml > $tempfile");
- }
- else {
- system("$engine $xml $tempxslfile > $tempfile");
- }
-
- open(OUT, ">$outfile") or die "cannot open $outfile $!\n";
- open(IN, "$tempfile") or die "cannot open $tempfile $!\n";
- my $nrows = 0;
- my $start = 0;
- my $active = 0;
- my $prot_ind = -1;
- my $pep_ind = -1;
- my $first = 1;
- while(<IN>) {
- if(index($_, $start_string_comment) >= 0) {
- $start = 1;
- }
- elsif($start) {
- if(/\S/) {
- $active = 1;
- }
- if(/^\<\/form/ || /^\<\/table/) {
- $start = 0;
- }
- elsif($active) {
- if(@select_aas > 0 || ! ($text eq '')) {
- chomp();
- my @parsed = split('\t');
- if($first) {
- for(my $p = 0; $p <= $#parsed; $p++) {
- if($prot_ind == -1 && $parsed[$p] eq 'protein') {
- $prot_ind = $p;
- }
- elsif($pep_ind == -1 && $parsed[$p] eq 'peptide sequence') {
- $pep_ind = $p;
- }
- }
- print OUT "$_\n";
- $first = 0; # done
- }
- else {
- my $ok = 1;
- for(my $p = 0; $p <= $#parsed; $p++) {
- for(my $s = 0; $s <= $#select_aas; $s++) {
- $ok &&= $pep_ind >= @parsed || $pep_ind == -1 || $p != $pep_ind || index($parsed[$p], $select_aas[$s]) >= 0;
- }
- $ok &&= $prot_ind >= @parsed || $prot_ind == -1 || $p != $prot_ind || index($parsed[$p], $text) >= 0; # =~ /$text/;
- }
- if( $ok ) { print OUT "$_\n"; }
- } # not first
- }
- else {
- print OUT;
- $nrows++;
- }
- }
- }
- elsif(0 && ! $start && /^\<font color\=\"green\"\>(\S.*)\<\/font\>/) {
- print OUT "$1\n";
- }
- }
-
- close(IN);
- close(OUT);
- unlink($tempfile) if(-e $tempfile);
- unlink($tempxslfile) if(-e $tempxslfile);
-
- chmod 0666, $outfile;
- return $nrows;
-}
-
-sub writeGaggleNameValueData {
- (my $outfile, my $engine, my $xml) = @_;
- my $tempxslfile = $xmlfile . '.tmp.nv.ggl.xsl';
- my $tempfile = $xmlfile . '.tmp.nv.ggl';
-
- my $text = exists $box{'text1'} ? $box{'text1'} : '';
- my @select_aas = ();
- if(exists $box{'pep_aa'} && ! ($box{'pep_aa'} eq '')) {
- for(my $k = 0; $k < (length $box{'pep_aa'}); $k++) {
- my $next = substr($box{'pep_aa'}, $k);
- if($next =~ /^[a-z,A-Z](\d\d+)/) {
- my $mass = $1;
- push(@select_aas, substr($box{'pep_aa'}, $k, 1) . '[' . $mass . ']');
- $k += (length $mass);
- }
- else {
- push(@select_aas, substr($box{'pep_aa'}, $k, 1));
- }
- }
- }
-
-
- unlink($tempxslfile) if(-e $tempxslfile);
- unlink($tempfile) if(-e $tempfile);
- writeGaggleNameValueXSLFile($tempxslfile, \%box);
-
- if($xslt =~ /xsltproc/) {
- system("$engine $tempxslfile $xml > $tempfile");
- }
- else {
- system("$engine $xml $tempxslfile > $tempfile");
- }
-
- open(OUT, ">$outfile") or die "cannot open $outfile $!\n";
- open(IN, "$tempfile") or die "cannot open $tempfile $!\n";
-
- my $nrows = 0;
- my $start = 0;
- my $active = 0;
- my $prot_ind = -1;
- my $pep_ind = -1;
- my $first = 1;
- while(<IN>) {
- if(index($_, $start_string_comment) >= 0) {
- $start = ...
[truncated message content] |