[Bioperl-l] local emboss

Jason Stajich jason@cgt.mc.duke.edu
Mon, 18 Feb 2002 17:55:09 -0500 (EST)


I've added some code Bio::Tools::Run::EMBOSSApplication so that one
doesn't have to explicitly write out a sequence to a file in order to run
an emboss app.  This works wherever you pass in a Bio::PrimarySeqI or
array of Bio::PrimarySeqI to an EMBOSS application handle.  See the
following for an example

So the following

use Bio::Factory::EMBOSS;
use Bio::SeqIO;
use Bio::AlignIO;

my $factory = new Bio::Factory::EMBOSS();
my $water = $factory->program('water');

my @seqs_to_check; # assume this is a list of seqs
my $seq_to_test; # assume this is a single seq to eval
my $waterout = 'out.water';

# all of this --
my $outseq = new Bio::SeqIO(-file => ">seqfile1");
$outseq->write_seq($seq_to_test);

$outseq= new Bio::SeqIO(-file => ">seqdb");

foreach my $seq ( @seqs_to_check ) {
$outseq->write_seq($seq);
}
$outseq->close();

$water->run({ '-sequencea' => 'seqfile1',
              '-seqall'    => 'seqdb',
              '-gapopen'   => '10.0',
              '-gapextend' => '0.5',
              '-outfile'   => $wateroutfile});
#--

# can be replaced with this

$water->run({ '-sequencea' => $seq_to_test,
	      '-seqall'    => \@seqs_to_check,
	      '-gapopen'   => '10.0',
	      '-gapextend' => '0.5',
	      '-outfile'   => $wateroutfile});

#--

Additionally you can read in the alignment output

my $alnin = new Bio::AlignIO(-format => 'emboss',
			     -file   => $wateroutfile);

while( my $aln = $alnin->next_aln ) {
  # process the alignment
}


This is not in Alpha release but will make it in next push out.

-jason

-- 
Jason Stajich
Duke University
jason@cgt.mc.duke.edu