#!/usr/bin/perl # clustal2.cgi - a CGI wrapper for running the multiple sequence alignment program clustalw. # 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 CGI qw(:standard); use Neuroseq; # Full path to clustalw $clustalw = '/usr/local/bin/clustalw'; # Full path to fmtseq sequence formatter. $fmtseq = '/usr/local/bin/fmtseq'; print Neuroseq::title('ClustalW Multiple Sequence Alignments'), 'Calls clustalw 1.7 to generate a multiple sequence alignment of submitted nucleotide or amino acid 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/clustal2"); chdir $tmpdir or die "error changing to $tmpdir: $!"; my $filename = "sequence"; open (SEQ, ">$filename"); print SEQ $sequence, "\n"; close SEQ; system("$fmtseq -format=fasta -all -output=fasta $filename"); system("$clustalw -infile=$tmpdir/fasta -align > stdout"); Neuroseq::printfile("$tmpdir/stdout"); print hr; Neuroseq::printfile("$tmpdir/fasta.aln"); chdir; Neuroseq::nukedir($tmpdir); } print Neuroseq::footer('1999.05.25');