Matcher

Jason Stajich jason at cgt.mc.duke.edu
Tue Nov 26 14:54:19 UTC 2002


Bioperl will also do the behind-the-scenes work of creating the tempfile
and cleaning it up for you if you just pass in a Bio::PrimarySeqI object.
It detects if you pass in an object or a string and proceeds accordingly.


Jason Stajich
Duke University
jason at cgt.mc.duke.edu

On Tue, 26 Nov 2002, Vilanova,David,LAUSANNE,NRC/BS wrote:

> Thanks Peter,
> Sorry for the mistake.
> I'm writing a bioperl script which automatically runs an emboss aplication.
> I could have worked by generating foreach sequence I read a new file but it
> looks pretty nice like that.
>
> Regards,
> David
>
>
> #! /usr/bin/perl -w
>
> use Bio::Factory::EMBOSS;
> use Bio::SeqIO;
>
> die "Usage: perl script.pl [seqfileA] [seqfileB] [outfile]\n" unless @ARGV
> eq '3';
>
> #Read input files
> ($seqfileA,$seqfileB,$outfile) = @ARGV;
>
> #Initialize Object
> $EMBOSS = new Bio::Factory::EMBOSS;
>
> #Define emboss program to run
> $application = $EMBOSS->program('matcher');
>
> #Manipulate SeqfileA file
> $seqA = new Bio::SeqIO (-file => $seqfileA,
> 			-format => 'fasta');
>
>
> while ($seqinA = $seqA->next_seq){
>     $inseqA = "asis::".$seqinA->seq;
>     $seqidA = $seqinA->id;
>     #$seqoutA->write_seq($inseqA);
>
>     print "####$seqidA\n";
>     #Initialize seqB at every iteration of SeqA
>     $seqB = new Bio::SeqIO (-file => $seqfileB,
> 			    -format => 'fasta');
>
>     while ($seqinB = $seqB->next_seq){
> 	$inseqB = "asis::".$seqinB->seq; #Format like asis::ATGCGA (required
> for emboss)
> 	$seqidB = $seqinB->id;
> 	#$seqoutB->write_seq($inseqB);
> 	#print "####$inseqA\n";
> 	print "Processing sequence $seqidA..vs..$seqidB...";
>
>
> 	#Define program parameters and run...
> 	$application->run({
> 	    -sequencea => $inseqA,
> 	    -sequenceb => $inseqB,
> 	    -outfile => $outfile });
> 	print "done\n";
> ....
> Manipulate alignments.....
> ....
>     }
>
> }
>
>
>
>
>
> -----Original Message-----
> From: Peter Rice [mailto:peter.rice at uk.lionbioscience.com]
> Sent: mardi, 26. novembre 2002 14:54
> To: Vilanova,David,LAUSANNE,NRC/BS
> Cc: 'emboss at embnet.org'
> Subject: Re: Matcher
>
>
> Vilanova,David,LAUSANNE,NRC/BS wrote:
> > Dear all,
> > I was wondering if matcher program accepts a sequence via stdin.
> >
> > the following exemple doesn't work for me.
> >
> > matcher -sequencea 'ATGCGA' -sequenceb 'ATCTAGATATGCGA'
> >
> >>cannot open ATGCGA file for read.
> >
> >
> > Is there anyway to submit a sequence via stdin ???
>
> You don't mean stdin (that can only read one sequence anyway) ... you mean
> "can I specify a sequence on the command line?"
>
> Yes!!!! You need the "asis" special format.
>
> matcher -sequencea 'asis::ATGCGA' -sequenceb 'asis::ATCTAGATATGCGA'
>
> (assuming your shell allows the command line to be long enough for your
> sequences :-)
>
> Hope this helps
>
> Peter
>
> --
> ------------------------------------------------
> Peter Rice, LION Bioscience Ltd, Cambridge, UK
> peter.rice at uk.lionbioscience.com +44 1223 224723
>



More information about the EMBOSS mailing list