#!/usr/local/bin/perl use strict; #use warnings; use CGI; use CGI::Carp qw( fatalsToBrowser ); use RefSeqVerifier; use constant MAX_FILE_SIZE => 50 * 1_048_576; # limit each upload to 50 MB $CGI::DISABLE_UPLOADS = 0; $CGI::POST_MAX = MAX_FILE_SIZE; my $query = new CGI(); print $query->header('text/html'); print $query->start_html(-title=>'Bioinformatics Sequence Verifier', -style=>{'src'=>'style.css'}, -BGCOLOR=>'#ffffff'); print""; print "

"; print"

 

"; print "

RefSeq Verifier Web Site

"; print "

For a given query file including UniGene ID, Affy probeset ID and GenBank accession number, this website provides a tool to perform RefSeq match for pairs of affy probe set and cDNA sequences that correspond to the same UniGene cluster by using blast search program 'bl2seq'.

"; print "

For any question concerning QDA behind the scene, please contact Jiexin Zhang (jiexinzhang\@mdanderson.org)

"; print "

Corresponding publication:

"; print q%
    Yuan Ji, Kevin Coombes, Jiexin Zhang, Sijin Wen,James Mitchell, Lajos Pusztai, W. Fraser Symmans and Jing Wang. RefSeq refinements of UniGene-based gene matching improve the correlation of expression measurements between two microarray platforms. Applied Bioinformatics. 2006; 5(2): 89-98.
%; print "

Sample query file format and result explanation"; print "

"; print $query->startform(-method=>"post", -name=>"frmInfo",-action=>"VerifyRefSeq.pl", -ENCTYPE=>"multipart/form-data", -onSubmit=>"return checkForm(this)"); print""; print""; print" "; print""; print""; print" "; print"
Select a file
OR
Enter Query
"; print $query->submit(-name=>"VerifyRefSeq",-value=>"Verify RefSeq", -id=>"submit"); print "  "; print $query->reset(-name=>"Reset"); print "  "; print $query->button(-name=>"cancel", -value=>"Cancel", -onClick=>"window.close()"); print $query->endform; print "

"; print "Processing...... Please wait.  Results will appear below."; print "
"; #if(!$query->param("VerifyRefSeq")) #{ # print"

Results will appear below.

"; #} print "
"; if($query->param("VerifyRefSeq")) { print"

Your results are as follows:

"; my $fh; # create file handle my $file = $query->param("uploadfile"); my $queryFile = $query->param("queryString"); if($queryFile) { $fh = RefSeqVerifier->saveCurrentString($queryFile); } elsif($file) { if(-z $file) { RefSeqVerifier->errorMessage("The input file is empty. Please retry command with valid input file."); } $fh = $query->upload("uploadfile") or RefSeqVerifier->errorMessage("File upload failed."); } #### get the hash table for uid ref my %uidRef; my $hashRef; $hashRef = RefSeqVerifier -> uidRefHash(); %uidRef = %{$hashRef}; my ($refUid, $refAffyid, $refCdnaid); my(@uid, @affyid, @cdnaid); my $badFormatData; ($refUid, $refAffyid, $refCdnaid, $badFormatData) = RefSeqVerifier -> readQuery($fh); push(@uid, @$refUid); push(@affyid, @$refAffyid); push(@cdnaid, @$refCdnaid); my $refResult; my @result; my $refBadDataResult; my @badDataResult; ($refResult, $refBadDataResult)= RefSeqVerifier -> sequenceMatch($hashRef,$refUid, $refAffyid, $refCdnaid); push(@badDataResult, @$refBadDataResult); push(@result, @$refResult); my $i=0; if(scalar(@badDataResult)>0) { for $i(0..$#badDataResult) { print "

$badDataResult[$i]

"; } } if(scalar(@result)>0) { my @resultHeader; my $refResultHeader = RefSeqVerifier -> getResultHeader(); push(@resultHeader, @$refResultHeader); my $i = 0; my $j=0; my $count = 0; my @resultTemp; my $resultStr = RefSeqVerifier ->getResultStr($refResult); if($badFormatData) { print "

The following data have bad format, which are not processed. Please check the data and try again.

"; print "

$badFormatData

"; } print "

Save Results as a text file, could be opened with MS Excel for better viewing.

"; print ""; print ""; for $i(0..$#resultHeader) { print ""; } print ""; for $i(0..$#result) { @resultTemp = split(',',$result[$i]); print ""; for $j(0..$#resultTemp) { print " "; } print ""; } print "
$resultHeader[$i]
$resultTemp[$j]
"; print "
"; print "Back to top"; } } print "
"; $query->end_html;