#! /usr/bin/perl -w # Thomas Trolle, July 2014 # trolle@cbs.dtu.dk # Tested on Perl 5.12.4 use CGI qw(:standard); use strict; # Define the path to the program that the server should run. my $PROG = "/path/to/your/method"; # Parse the input data sent in the URL. Note that # the following request format is assumed: # '?peptide=&allele=' my $query = new CGI; my $peptide = $query->param('peptide'); my $allele = $query->param('allele'); if ($peptide and $allele) { # Check that the input data makes sense. if ($peptide !~ m/[ACDEFGHIKLMNPQRSTUVWY,]+/) { print "Invalid peptide input\n"; } my @supported_alleles = ("HLA-A*02:01", "HLA-A*24:02", "HLA-B*07:02", "HLA-B*08:01"); if ($allele !~ @supported_alleles) { print "Invalid allele input\n"; } # Call the program $PROG and save the output in $result my $result = `$PROG -mode peptide $allele $peptide`; # Parse the output from your program here if necessary. For the # IEDB benchmark, results for each peptide are expected in the # following format: # Allele\tPeptide\tPrediction\n print "$result\n"; } else { print "Please supply some data in the following format: '?peptide=PEPTIDE&allele=ALLELE'\n"; }