Phenyx-batchsubmit.pl

From GBWiki

Jump to: navigation, search


#!/usr/bin/env perl
use strict;
use File::Find::Rule;
use File::Basename;
use Phenyx::Config::GlobalParam;

#This script is a demo of how to submit a list of files with a given extension, residing below a given directory.
#the parameters should be edited.
#this script is supposed to be source of inspiration for shell command

#extension of file to be submited
my $ext='zip';
#format, one of mgf, pkl, mzxml, dta etc.
my $format='mgf';

#directory where to find the files (they can reside in subdirectories below this one,
#only file with the correct extension will be sent to phenyx
my $dir='/home/alex/olavExamples/data/';

#phenyx job to be taken as template (submition parameters will be copied from this job)
my $templatejob='3400';

#set the user towhich the job wilbelong
my $username="joe";

my $cmdsuffix;
#if phenyx <=2.1, uncomment the following line
#$cmdsuffix="--submitmode=submissionparam.xml --wait4kids";

my @peaklistFiles=File::Find::Rule->file()->name( "*.$ext")->in($dir);

#initialize phenyx parameter
Phenyx::Config::GlobalParam::readParam();
my $path=Phenyx::Config::GlobalParam::get('phenyx.perlscripts')."/cgi";

foreach (@peaklistFiles){
  my $cmd="$^X $path/submitJobs.pl --username=$username --title=\"".basename($_)."\" --paramfromjobid=$templatejob --datafile=\"$format:$_\" $cmdsuffix";
  print STDERR "$cmd\n";
  system($cmd) and die "cannot execute command (or killed)";
}
Personal tools
Create a book