#Author: Jack Crabb #Date: Feb 21, 2006 # #!/usr/bin/perl use strict; use warnings; my $file; my @pkl_iTRAQ; my @mascotResults; my @UniqueMatchesPerHit; my @pkl_sorted_iTRAQ = ( ['1a', '2a', '3a', '4a', '5a', '6a', '7a', '8a', '9a'], ['1b', '2b', '3b', '4b', '5b', '6b', '7b', '8b', '9b'] ); my @array; my $fraction; my $i; my $j; my $line; my $len; my $base; my $QuerySection; my $ProteinSection; my @sorted; my $t0; my $t1; my $td; my $numerator = 0; my $denominator = 0; my $iTRAQThreshold = 0; my $pos = 0; my $i114 = 0; my $i115 = 0; my $i116 = 0; my $i117 = 0; my $ci114 = 0; my $ci115 = 0; my $ci116 = 0; my $ci117 = 0; my $ProteinStatStart = -1; my $NotmatchedToProteinSection = 0; my $Current_Pep_Calc_mr = 0; my $UniqueAvgPeptideRatioMatches = 0; my $ProteinHit = 0; my $RecordPeptideHitvalues = 0; ######################################################################### # used from http://search.cpan.org/~nwclark/perl-5.8.8/lib/Benchmark.pm # ######################################################################### # use Benchmark; # $t0 = new Benchmark; # # ... your code here ... # $t1 = new Benchmark; # $td = timediff($t1, $t0); # print "the code took:",timestr($td),"\n"; use Benchmark; $t0 = new Benchmark; # ... your code here ... # Given 2-d array @array #my $pos = 0; # Position in the "horiztonal" to sort on #@array = sort {$a->[$pos] <=> $b->[$pos]} @array; $i = 0; $QuerySection = 0; # use i to turn on query processing $ProteinSection = 0; # use i to turn on query processing $fraction = 0; $j = 1; $line = 0; $base = $ARGV[0]; # arg demo 1: Process optional -c flag if (@ARGV && ($ARGV[1] =~ /\d+/) && ($ARGV[2] =~ /\d+/) && ($ARGV[3] =~ /\d+/)) { print "\nProgram executing with correct number of arguments...\n\n"; $numerator = $ARGV[1]; #print $numerator; $denominator = $ARGV[2]; #print $denominator; $iTRAQThreshold = $ARGV[3]; #print $iTRAQThreshold; } else{ print "***\n***\n***\nError: Missing arguments- Besure to include 4 arguments.\n\n"; print "ForExample, to process a mascot result file F015723\n"; print "with iTRAQ labels (114/116) and iTRAQ intensity cutoff of 15 use this command:\n"; print "MascotqueryParse.pl F015723.csv 115 117 15\n"; print "***\n***\n***\n"; } #foreach $file (@ARGV){ foreach $file ($ARGV[0]){ open(SP,"$file") || die "Cannot open PKL File $file"; print "PKL File Opened Successfully\n"; print "Processing PKL File...\n\n"; while(){ # REGEX Regular Expression pattern matching; # The pattern matched is within // # \s represents a whitespace character # \S represents a non-whitespace character # \S+ represents a string of non-white space characters # each paranthesized element will be represented as $1 statements # that follow the expression if(/query_number/){ $QuerySection = 1; } # REGEX Regular Expression pattern matching; # carat symbol ^ means we begin matching at the beginning (left) of the line if($QuerySection == 1){ if(/(\d*?),("[^"\r\n]*"),("[^"\r\n]*"|),([^,]+?),(\d*?),("[^"\r\n]*")/){ $i++; $pkl_iTRAQ[$i][0] = 0; $pkl_iTRAQ[$i][1] = 0; $pkl_iTRAQ[$i][2] = 0; $pkl_iTRAQ[$i][3] = 0; $pkl_iTRAQ[$i][4] = 0; $pkl_iTRAQ[$i][5] = 0; $pkl_iTRAQ[$i][6] = 0; $pkl_iTRAQ[$i][7] = 0; $pkl_iTRAQ[$i][8] = 0; $pkl_iTRAQ[$i][9] = 0; $pkl_iTRAQ[$i][10] = 0; $pkl_iTRAQ[$i][11] = 0; $pkl_iTRAQ[$i][12] = 0; $pkl_iTRAQ[$i][13] = 0; $pkl_iTRAQ[$i][14] = 0; $pkl_iTRAQ[$i][15] = 0; $pkl_iTRAQ[$i][16] = 0; $pkl_iTRAQ[$i][17] = 0; $pkl_iTRAQ[$i][18] = 0; $pkl_iTRAQ[$i][19] = 0; $pkl_iTRAQ[$i][20] = 0; $pkl_iTRAQ[$i][21] = 0; $pkl_iTRAQ[$i][22] = 0; $pkl_iTRAQ[$i][23] = 0; $pkl_iTRAQ[$i][24] = 0; $pkl_iTRAQ[$i][25] = 0; $pkl_iTRAQ[$i][0] = $1; $pkl_iTRAQ[$i][1] = $2; $pkl_iTRAQ[$i][2] = $4; $pkl_iTRAQ[$i][3] = $5; if(/[,"](114.[0-9]+):([^,"]*)[,"]/){ $pkl_iTRAQ[$i][7] = $2; } if(/[,"](115.[0-9]+):([^,"]*)[,"]/){ $pkl_iTRAQ[$i][8] = $2; } if(/[,"](116.[0-9]+):([^,"]*)[,"]/){ $pkl_iTRAQ[$i][9] = $2; } if(/[,"](117.[0-9]+):([^,"]*)[,"]/){ $pkl_iTRAQ[$i][10] = $2; } } # '%' is the perl operator for Modulus (Mod) # used here so a decimal point is outputted once every 100 lines. } } close SP; print "File Closed Successfully.\n\n"; open(SP,"$file") || die "Cannot open PKL File $file"; print "File Opened Successfully\n"; print "Processing File for counting Unique Matches per hit...\n\n"; while(){ if(/prot_hit_num/){ $ProteinSection = 1; $UniqueMatchesPerHit[0][0] = 0; $UniqueMatchesPerHit[0][1] = 0; $ProteinHit = 1; $UniqueAvgPeptideRatioMatches = -1; #To compensate for title (header)row } if(/Peptide matches not assigned to protein hits/){ $ProteinSection = 0; #To complete final protein calculations $UniqueMatchesPerHit[$ProteinHit][0] = $mascotResults[$ProteinHit][1]; $UniqueMatchesPerHit[$ProteinHit][1] = $UniqueAvgPeptideRatioMatches; } if($ProteinSection == 1){ ############ For Avg PeptideRatio ################### if(/(^\d+?),(["A-Z0-9]+),/){ if($ProteinHit ne $1){ $UniqueMatchesPerHit[$ProteinHit][0] = $2; $UniqueMatchesPerHit[$ProteinHit][1] = $UniqueAvgPeptideRatioMatches; $UniqueAvgPeptideRatioMatches = 0; $ProteinHit = $1; $Current_Pep_Calc_mr = ""; } } ############ For Peptide ################### if(/(\w+?|),("[^"\r\n]*"|[^,]*|),("[^"\r\n]*"|[^,]*|),(\d+?|),(\d+?|),(\d+?|),(\d+?|),([^,]+?|),([^,]+?|),(\d+?|),([^,]+?|),([^,]+?|),(\d+?|),(\d+?|),(\d+?|),([^,]+?|),(\d+?|),(\d+?|),([^,]+?|),(\d+?|),("[^"\r\n]*"|[^,]*|),("[^"\r\n]*"|[^,]*|),("[^"\r\n]*"|[^,]*|)/){ if($Current_Pep_Calc_mr ne $22){ if($16 >= 25){ print "QUERYQUERY++++++++++++++++\n"; $UniqueAvgPeptideRatioMatches++; $Current_Pep_Calc_mr = $22; } } } print "$line\n"; $line++; } } close SP; $line = 0; print "File Closed Successfully.\n\n"; open(SP,"$file") || die "Cannot open File $file"; print "Processing File for Query Output...\n\n"; while(){ # REGEX Regular Expression pattern matching; # The pattern matched is within // # \s represents a whitespace character # \S represents a non-whitespace character # \S+ represents a string of non-white space characters # \w characters in a word, short hand for [0-9A-Za-z] # | pipe, the operator OR # ("[^"\r\n]*".) -perl recommendation for matching a double quoted string # ("[^"]+"|[^,]+?|) -customized equivalent for matching a double quoted string # ? Makes the preceding item optional. Greedy, so the optional item is included in the match if possible. # (\w+?|) used to match a string of characters used in a word or nothing # each paranthesized element will be represented as $1 statements # that follow the expression if(/prot_hit_num/){ $ProteinSection = 1; if(/(\w+?|),(\w+?|),(\w+?|),(\w+?|),(\w+?|),(\w+?|),(\w+?|),(\w+?|),(\w+?|),(\w+?|),(\w+?|),(\w+?|),(\w+?|),(\w+?|),(\w+?|),(\w+?|),(\w+?|),(\w+?|),(\w+?|),(\w+?|),(\w+?|),(\w+?|),(\w+?|),(\w+?|),(\w+?|)\n/){ $mascotResults[0][0] = $1; $mascotResults[0][1] = $2; $mascotResults[0][2] = $3; $mascotResults[0][3] = $4; $mascotResults[0][4] = $5; $mascotResults[0][5] = $6; $mascotResults[0][6] = $7; $mascotResults[0][7] = $8; $mascotResults[0][8] = $9; $mascotResults[0][9] = $10; $mascotResults[0][10] = $11; $mascotResults[0][11] = $12; $mascotResults[0][12] = $13; $mascotResults[0][13] = $14; $mascotResults[0][14] = $15; $mascotResults[0][15] = $16; $mascotResults[0][16] = $17; $mascotResults[0][17] = $18; $mascotResults[0][18] = $19; $mascotResults[0][19] = $20; $mascotResults[0][20] = $21; $mascotResults[0][21] = $22; $mascotResults[0][22] = $23; $mascotResults[0][23] = $24; $mascotResults[0][24] = $25; $mascotResults[0][25] = "i114"; $mascotResults[0][26] = "i115"; $mascotResults[0][27] = "i116"; $mascotResults[0][28] = "i117"; $mascotResults[0][29] = "RoundedRatio(na/na)"; $mascotResults[0][30] = "FractionLabel"; } } if($NotmatchedToProteinSection == 0){ if(/(\w+?|),("[^"\r\n]*"|[^,]*|),("[^"\r\n]*"|[^,]*|),(\d+?|),(\d+?|),(\d+?|),(\d+?|),([^,]+?|),([^,]+?|),(\d+?|),([^,]+?|),([^,]+?|),(\d+?|),(\d+?|),(\d+?|),([^,]+?|),(\d+?|),(\d+?|),([^,]+?|),(\d+?|),("[^"\r\n]*"|[^,]*|),("[^"\r\n]*"|[^,]*|),("[^"\r\n]*"|[^,]*|)/){ if($4){ $ProteinStatStart = $line + 1; print "$line\n"; } } } if(/Peptide matches not assigned to protein hits/){ $ProteinStatStart = -1; $NotmatchedToProteinSection = 1; } if(/"query_number"/){ $QuerySection = 1; $ProteinSection = 0; } if($ProteinSection == 1){ ############ For Avg PeptideRatio ################### if(/(^\d+?),(["A-Z0-9]+),/){ if($ProteinHit ne $1){ $UniqueAvgPeptideRatioMatches = 0; $ProteinHit = $1; } } ############ For Peptide ################### if(/(\d+?|),("[^"\r\n]*"|[^,]*|),("[^"\r\n]*"|[^,]*|),(\d+?|),(\d+?|),(\d+?|),(\d+?|),([^,]+?|),([^,]+?|),(\d+?|),([^,]+?|),([^,]+?|),(\d+?|),(\d+?|),(\d+?|),([^,]+?|),(\d+?|),(\d+?|),([^,]+?|),(\d+?|),([^,]+?|),([^,]+?|),([^,]+?|),([^,]+?|),([^,]+?|),([^,]+?|),([^,]+?|),([^,]+?|),([^,]+?|),([^,]+?|)\n/){ if($Current_Pep_Calc_mr ne $22){ if($16 >= 25){ $UniqueAvgPeptideRatioMatches++; $Current_Pep_Calc_mr = $22; } } } if(/(\w+?|),("[^"\r\n]*"|[^,]*|),("[^"\r\n]*"|[^,]*|),(\d+?|),(\d+?|),(\d+?|),(\d+?|),([^,]+?|),([^,]+?|),(\d+?|),([^,]+?|),([^,]+?|),(\d+?|),(\d+?|),(\d+?|),([^,]+?|),(\d+?|),(\d+?|),([^,]+?|),(\d+?|),("[^"\r\n]*"|[^,]*|),("[^"\r\n]*"|[^,]*|),("[^"\r\n]*"|[^,]*|)/){ $line++; $mascotResults[$line][0] = $1; $mascotResults[$line][1] = $2; $mascotResults[$line][2] = $3; $mascotResults[$line][3] = $4; $mascotResults[$line][4] = $5; $mascotResults[$line][5] = $6; $mascotResults[$line][6] = $7; $mascotResults[$line][7] = $8; $mascotResults[$line][8] = $9; $mascotResults[$line][9] = $10; $mascotResults[$line][10] = $11; $mascotResults[$line][11] = $12; $mascotResults[$line][12] = $13; $mascotResults[$line][13] = $14; $mascotResults[$line][14] = $15; $mascotResults[$line][15] = $16; $mascotResults[$line][16] = $17; $mascotResults[$line][17] = $18; $mascotResults[$line][18] = $19; $mascotResults[$line][19] = $20; $mascotResults[$line][20] = $21; $mascotResults[$line][21] = $22; $mascotResults[$line][22] = $23; $mascotResults[$line][23] = "na"; $mascotResults[$line][24] = "na"; $mascotResults[$line][30] = $pkl_iTRAQ[$7][1]; $i114 = $pkl_iTRAQ[$7][7]; $i115 = $pkl_iTRAQ[$7][8]; $i116 = $pkl_iTRAQ[$7][9]; $i117 = $pkl_iTRAQ[$7][10]; $mascotResults[$line][25] = $i114; $mascotResults[$line][26] = $i115; $mascotResults[$line][27] = $i116; $mascotResults[$line][28] = $i117; # $7 is the peptide query Number # to be used to collect all information together if($pkl_iTRAQ[$7][15]){ if($pkl_iTRAQ[$7][15] < $20){ #Check If the Rank is better (1 is best, 10 is worst) #Better Rank already in Place; don't overwrite it. $RecordPeptideHitvalues = 0; } else { #Worse Candidate rank needs to be overwritten with this Hit's data $RecordPeptideHitvalues = 1; } } else { #To Reach here- no previous entry for the query was entered. $RecordPeptideHitvalues = 1; } if($RecordPeptideHitvalues){ $pkl_iTRAQ[$7][4] = $8; #pep_exp_mz $pkl_iTRAQ[$7][5] = $9; #pep_exp_mr $pkl_iTRAQ[$7][6] = $10; #pep_exp_z # 6 intensity # 7 NumValues # 8 iTRAQ 114 # 9 iTRAQ 115 # 10 iTRAQ 116 # 11 iTRAQ 117 $pkl_iTRAQ[$7][11] = $16; #pep_score $pkl_iTRAQ[$7][12] = $17; #pep_homology $pkl_iTRAQ[$7][13] = $18; #pep_identity $pkl_iTRAQ[$7][14] = $19; #pep_expect $pkl_iTRAQ[$7][15] = $20; #pep_rank $pkl_iTRAQ[$7][16] = $22; #pep_seq #$pkl_iTRAQ[$7][17] = $25; #pep_var_mod $pkl_iTRAQ[$7][18] = $1; #prot_hit_num $pkl_iTRAQ[$7][19] = $mascotResults[$ProteinStatStart][1]; #prot_acc $pkl_iTRAQ[$7][20] = $mascotResults[$ProteinStatStart][2]; #prot_desc $pkl_iTRAQ[$7][21] = $mascotResults[$ProteinStatStart][3]; #prot_score $pkl_iTRAQ[$7][22] = $mascotResults[$ProteinStatStart][4]; #prot_mass $pkl_iTRAQ[$7][23] = $mascotResults[$ProteinStatStart][5]; #prot_matches if($1){ $pkl_iTRAQ[$7][24] = $UniqueMatchesPerHit[$1][1]; #prot_match_unique_seq } } $fraction = $pkl_iTRAQ[$7][1]; if(substr($fraction,0) =~ /_([0-9]*).pkl/){ $fraction = $1; } else{ $fraction = 0; } #print "This should be a stripped pkl number (ie 13):\t"; #print $fraction; #print "\n"; #################################################################### # Edit this Section Depending on which iTRAQ labels are used # Change 2 sections: # the line- if(($i115>15) && ($i117>15)){ #change 115 and 117 if necessary; Change 15 if threshold is different # ($i115/$i117); #Adjust the ratio as needed- ($i116/$i114) etc... # # # $mascotResults[0][29] = "RoundedRatio(i114/Mix)"; use Switch; $numerator = $ARGV[1]; $denominator = $ARGV[2]; $iTRAQThreshold = $ARGV[3]; switch ($numerator) { case [114]{ $numerator = $i114 } case [115]{ $numerator = $i115 } case [116]{ $numerator = $i116 } case [117]{ $numerator = $i117 } else { $numerator = "na" } } switch ($denominator) { case [114]{ $denominator = $i114 } case [115]{ $denominator = $i115 } case [116]{ $denominator = $i116 } case [117]{ $denominator = $i117 } else { $denominator = "na" } } if(($numerator > $iTRAQThreshold) && ($denominator > $iTRAQThreshold)){ $mascotResults[$line][29] = sprintf "%.3f", ($numerator/$denominator); } else{ $mascotResults[$line][29] = "na"; } # # # # # #################################################################### } if(/(\w+?|),("[^"\r\n]*"|[^,]*|),("[^"\r\n]*"|[^,]*|),(\d+?|),(\d+?|),(\d+?|),(\d+?|),([^,]+?|),([^,]+?|),(\d+?|),([^,]+?|),([^,]+?|),(\d+?|),(\d+?|),(\d+?|),([^,]+?|),(\d+?|),(\d+?|),([^,]+?|),(\d+?|),([^,]+?|),([^,]+?|),([^,]+?|),([^,]+?|),([^,]+?|)\n/){ $mascotResults[$line][23] = $24; $mascotResults[$line][24] = $25; } } } close SP; } print "Displaying full Mascot Results output:\n\n"; print "Lines of output:$line\n"; print "Output completed.\n\n"; print "Displaying Query details output:\n\n"; $len = scalar(@pkl_iTRAQ); print "size of array: $len .\n"; ################################## # OUTFILE must be in Capital letters, otherwise a warning is generated. ################################## # when writing to a file it is best to avoid using colons. # using the colon (:) causes excel to recognize the data as time format # No label is best. ########## $j = 1; open(OUTFILE, ">$base.Proteins.csv"); print OUTFILE "prot_hit_num,prot_acc,prot_desc,prot_score,prot_mass,prot_matches,pep_query,pep_exp_mz,pep_exp_mr,pep_exp_z,pep_calc_mr,pep_delta,pep_start,pep_end,pep_miss,pep_score,pep_homol,pep_ident,pep_expect,pep_rank,pep_res_before,pep_seq,pep_res_after,pep_frame,pep_var_mod,i114,i115,i116,i117,RoundedRatio(i115/i117),pklSourceFile\n"; print "Creating full Mascot Results output File:\n\n"; while($j <= $line) { print OUTFILE "$mascotResults[$j][0],"; print OUTFILE "$mascotResults[$j][1],"; print OUTFILE "$mascotResults[$j][2],"; print OUTFILE "$mascotResults[$j][3],"; print OUTFILE "$mascotResults[$j][4],"; print OUTFILE "$mascotResults[$j][5],"; print OUTFILE "$mascotResults[$j][6],"; print OUTFILE "$mascotResults[$j][7],"; print OUTFILE "$mascotResults[$j][8],"; print OUTFILE "$mascotResults[$j][9],"; print OUTFILE "$mascotResults[$j][10],"; print OUTFILE "$mascotResults[$j][11],"; print OUTFILE "$mascotResults[$j][12],"; print OUTFILE "$mascotResults[$j][13],"; print OUTFILE "$mascotResults[$j][14],"; print OUTFILE "$mascotResults[$j][15],"; print OUTFILE "$mascotResults[$j][16],"; print OUTFILE "$mascotResults[$j][17],"; print OUTFILE "$mascotResults[$j][18],"; print OUTFILE "$mascotResults[$j][19],"; print OUTFILE "$mascotResults[$j][20],"; print OUTFILE "$mascotResults[$j][21],"; print OUTFILE "$mascotResults[$j][22],"; print OUTFILE "$mascotResults[$j][23],"; print OUTFILE "$mascotResults[$j][24],"; print OUTFILE "$mascotResults[$j][25],"; print OUTFILE "$mascotResults[$j][26],"; print OUTFILE "$mascotResults[$j][27],"; print OUTFILE "$mascotResults[$j][28],"; print OUTFILE "$mascotResults[$j][29],"; print OUTFILE "$mascotResults[$j][30]\n"; $j++; } close(OUTFILE); $j = 1; open(OUTFILE, ">$base.out"); ############ # Begin with headings ############ # (Query) (Observed) (PKL-Line#) (#of Ions in ms-ms set) (114) (115) (116) (117) # Query The peak submitted to mascot for identification. # Typically each sample analyzed on the Mass Spectrometer (60 min) # produces one peaklist file with 150-650 peaks for identification # # Observed- Observed is the mass (molecular weight in kDa) of the peak identified # in the first dimension (MS) # # PKL-Line#- The pkl file generated from the data can be very long; over 1,000,000 lines # Mascot reports errors in reference to the line where they occurred. # Useful in troubleshooting. # # # of ions- Each of the peaks collected for the sample are subfragmented. # The peaks are listed as an ms-ms set. # Mascot sets the maximum number of ions (ms-ms set) for one peak at 10,000. # # 114 intensity reported at iTRAQ reporter ion 114.1 # # 115 intensity reported at iTRAQ reporter ion 115.1 # # 116 intensity reported at iTRAQ reporter ion 116.1 # # 117 intensity reported at iTRAQ reporter ion 117.1 # ############################################################################################### # Useful for troubleshooting Mascot errors such as: # # "Warning : Max number of ions is 10000. Ignoring ms-ms set starting at line 125394" # ############################################################################################### #print "Query\tMr(Expt)\tObserved m/z\tintensity\tcharge state\tPKL-Line#\tNumVals(msms)\t114.1\t115.1\t116.1\t117.1\n"; #print OUTFILE "Query\tSampleName\tms_intensity\tnumValues(msms)\tpep_exp_mz\tpep_exp_Mr\tpep_exp_z\t114.1\t115.1\t116.1\t117.1\n"; print OUTFILE "Query\tMr(Expt)\tObserved m/z\tintensity\tcharge state\tPKL-Line#\tNumVals(msms)\t114.1\t115.1\t116.1\t117.1\tpep_score\tpep_homology\tpep_identity\tpep_expect\tpep_rank\tpep_seq\tprot_hit_num\tprot_acc\tprot_desc\tprot_score\tprot_mass\tprot_matches\tprot_Unique_matches\n"; while($j <= $i) { print OUTFILE "$pkl_iTRAQ[$j][0]\t"; print OUTFILE "$pkl_iTRAQ[$j][1]\t"; print OUTFILE "$pkl_iTRAQ[$j][2]\t"; print OUTFILE "$pkl_iTRAQ[$j][3]\t"; print OUTFILE "$pkl_iTRAQ[$j][4]\t"; print OUTFILE "$pkl_iTRAQ[$j][5]\t"; print OUTFILE "$pkl_iTRAQ[$j][6]\t"; print OUTFILE "$pkl_iTRAQ[$j][7]\t"; print OUTFILE "$pkl_iTRAQ[$j][8]\t"; print OUTFILE "$pkl_iTRAQ[$j][9]\t"; print OUTFILE "$pkl_iTRAQ[$j][10]\t"; print OUTFILE "$pkl_iTRAQ[$j][11]\t"; print OUTFILE "$pkl_iTRAQ[$j][12]\t"; print OUTFILE "$pkl_iTRAQ[$j][13]\t"; print OUTFILE "$pkl_iTRAQ[$j][14]\t"; print OUTFILE "$pkl_iTRAQ[$j][15]\t"; print OUTFILE "$pkl_iTRAQ[$j][16]\t"; #print OUTFILE "$pkl_iTRAQ[$j][17]\t"; #pep_var_mod problematic print OUTFILE "$pkl_iTRAQ[$j][18]\t"; print OUTFILE "$pkl_iTRAQ[$j][19]\t"; print OUTFILE "$pkl_iTRAQ[$j][20]\t"; print OUTFILE "$pkl_iTRAQ[$j][21]\t"; print OUTFILE "$pkl_iTRAQ[$j][22]\t"; print OUTFILE "$pkl_iTRAQ[$j][23]\t"; print OUTFILE "$pkl_iTRAQ[$j][24]\n"; $j++; } print "Output completed.\n\n"; close(OUTFILE); print "Output file closed.\n\n"; $t1 = new Benchmark; $td = timediff($t1, $t0); print "the code took:",timestr($td),"\n";