Matrix Science Mascot Parser toolkit
 
Loading...
Searching...
No Matches
resfile_info.pl

Example program for retrieving general search information.

#!/usr/local/bin/perl
##############################################################################
# file: resfile_info.pl #
# 'msparser' toolkit #
# Test harness / example code #
##############################################################################
# COPYRIGHT NOTICE #
# Copyright 1998-2010 Matrix Science Limited All Rights Reserved. #
# #
##############################################################################
# $Source: parser/examples/test_perl/resfile_info.pl $ #
# $Author: robertog@matrixscience.com $ #
# $Date: 2024-09-04 10:23:46 +0100 $ #
# $Revision: 526921a73137894bb1eae0b0fc8ccb4bb52ea662 | MSPARSER_REL_3_0_0-2024-09-24-0-g93ebaeb4f4 $ #
# $NoKeywords:: $ #
##############################################################################
use strict;
##############################################################################
use msparser;
if (!defined($ARGV[0])) { die "Must specify results filename as parameter"; }
my $file = msparser::ms_mascotresfilebase::createResfile($ARGV[0]);
if ($file->isValid) {
searchInformation($file);
}
##############################################################################
# searchInformation #
# - parameter 0 ms_mascotresfilebase #
# Display parameters from the ms_mascotresfilebase object. The functions #
# anyPMF, anyMSMS, anySQ should normally be used in preference to isPMF etc #
# because some people submit MSMS though the sequence query window etc. #
##############################################################################
sub searchInformation {
my ($resfile) = @_;
my $fmt = "%-20s: %s\n";
print "Search information from ms_mascotresfilebase", "\n";
print "========================================", "\n";
printf $fmt, "Number of queries" , $resfile->getNumQueries();
printf $fmt, "Number of sequences" , $resfile->getNumSeqs();
printf $fmt, "Sequences after tax" , $resfile->getNumSeqsAfterTax();
printf $fmt, "Number of residues" , $resfile->getNumResidues();
printf $fmt, "Execution time" , $resfile->getExecTime();
printf $fmt, "Date (seconds)" , $resfile->getDate();
# Let's jump through a few hoops to get the equivalent of a 'C' asctime call
my ($sec, $min, $hour, $mday, $mon, $year, $wday, $yday, $isdst)
= localtime($resfile->getDate);
printf $fmt, "Date", sprintf("%s %s %d %02d:%02d:%02d %d",
(qw(Sun Mon Tue Wed Thu Fri Sat))[$wday],
(qw(Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec))[$mon],
$mday,
$hour,
$min,
$sec,
$year+1900
);
printf $fmt, "Mascot version" , $resfile->getMascotVer();
printf $fmt, "Fasta version" , $resfile->getFastaVer();
printf $fmt, "Is PMF?" , $resfile->isPMF();
printf $fmt, "Is MSMS?" , $resfile->isMSMS();
printf $fmt, "Is SQ?" , $resfile->isSQ();
printf $fmt, "Is Error tolerant" , $resfile->isErrorTolerant();
printf $fmt, "Any PMF?" , $resfile->anyPMF();
printf $fmt, "Any MSMS?" , $resfile->anyMSMS();
printf $fmt, "Any SQ?" , $resfile->anySQ();
printf $fmt, "Any peptide matches" , $resfile->anyFastaMatches();
print "\n";
}
=pod
Running the program as
perl -I../bin resfile_info.pl ../data/F981123.dat
will give the following output under Mascot Server 2.3
Search information from ms_mascotresfilebase
========================================
Number of queries : 67
Number of hits : 50
Number of sequences : 257964
Sequences after tax : 257964
Number of residues : 93947433
Execution time : 6
Date (seconds) : 1171894187
Date : Mon Feb 19 14:09:47 2007
Mascot version : 2.1.119
Fasta version : SwissProt_51.6.fasta
Is PMF? :
Is MSMS? : 1
Is SQ? :
Is Error tolerant :
Any PMF? :
Any MSMS? : 1
Any SQ? :
Any peptide matches : 1
=cut