#!/usr/bin/perl # cap.cgi - a CGI wrapper for running the contig assembly program cap. # Copyright (C) 1999, Humberto Ortiz Zuazaga. # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; either version 2 # of the License, or (at your option) any later version. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. use Neuroseq; use CGI qw(:standard); # Full path to program $program = '/usr/local/bin/cap2'; # Full path to fmtseq sequence formatter. $fmtseq = '/usr/local/bin/fmtseq'; print Neuroseq::title('CAP - Contig Assembly Program'), 'Calls cap to generate consensus sequence from several submitted nucleotide reads of the same sequence', p, hr, start_form, 'Enter multiple sequences in any seqio multi-sequence format:', p, textarea(-name=>'sequence', -default=>'', -rows=>10, -columns=>40), p, submit, reset, defaults('Clear'), end_form, hr; if (param()) { $|=1; # need this to keep program output in place my $sequence = param('sequence'); my $tmpdir = Neuroseq::mktmpdir("/tmp/cap"); chdir $tmpdir or die "error changing to $tmpdir: $!"; my $filename = "sequence"; open (SEQ, ">$filename"); print SEQ $sequence, "\n"; close SEQ; system("$fmtseq -format=fasta-old -all -output=fasta -CASEUPPER $filename"); system("$program fasta contigs 20 85 > stdout"); system("$fmtseq -gapin=. -all -output=output -informat=fasta-old -format=fasta-old contigs"); Neuroseq::printfile("output"); chdir; Neuroseq::nukedir($tmpdir); } print Neuroseq::footer('1999.05.25');