[Bioperl-l] Bio::Tools::IUPAC inconsistency
Aaron J. Mackey
amackey at pcbi.upenn.edu
Wed Aug 18 11:33:56 EDT 2004
The problem is that Bio::Tools::IUPAC doesn't know that your first
sequence is DNA (it tries to guess, but guesses wrong). Try setting
-alphabet => "dna" in your Bio::Seq->new() call.
-Aaron
On Aug 18, 2004, at 11:03 AM, mql201 wrote:
> Hello
>
> I'm using the mod above. I'm getting inconsistent output. This fn,
> which
> takes an ambiguous DNA
> sequence and returns an array of all the possible variants expanded
> from IUPAC
> meta symbols:
>
> sub expandMeta {
> my($uniqueseq); # unique sequence object
> my(@rAr) = (); # return array
> my($seqstr) = ""; # sequence attr of a sequence object
>
> my($ure) = $_[0]; # upstream regulatory element (sequence
> to
> check)
>
> my($ambiseq) = new Bio::Seq (-seq => $ure, -type => 'Dna');
> my($stream) = new Bio::Tools::IUPAC(-seq => $ambiseq);
>
> while($uniqueseq = $stream->next_seq()) {
> $seqstr = $uniqueseq->seq();
> print("$ure -> |$seqstr|<br>");
> ## process the unique Seq object.
> #
> @rAr = (@rAr, $seqstr);
> }
> return(@rAr);
> }
>
> when i feed it these two sequences, for example,
> ANTTW
> GGWAGGT
>
> the print statement in the while loop outputs this:
>
> ANTTW -> |ANTTW|
> GGWAGGT -> |GGAAGGT|
> GGWAGGT -> |GGTAGGT|
>
> the fact that both strings go through the loop means they're being
> picked up,
> but i'd expect this
> kind of output:
>
> ANTTW -> |AATTA|
> ANTTW -> |ATTTA|
> ANTTW -> |ACTTA|
> ANTTW -> |AGTTA|
> ANTTW -> |AATTT|
> ANTTW -> |ATTTT|
> ANTTW -> |ACTTT|
> ANTTW -> |AGTTT|
> GGWAGGT -> |GGAAGGT|
> GGWAGGT -> |GGTAGGT|
>
> I suspect this is an easy one, but i can't see where its going wrong.
>
> many thanks IA
> mark
>
> _______________________________________________
> Bioperl-l mailing list
> Bioperl-l at portal.open-bio.org
> http://portal.open-bio.org/mailman/listinfo/bioperl-l
>
>
--
Aaron J. Mackey, Ph.D.
Dept. of Biology, Goddard 212
University of Pennsylvania email: amackey at pcbi.upenn.edu
415 S. University Avenue office: 215-898-1205
Philadelphia, PA 19104-6017 fax: 215-746-6697
More information about the Bioperl-l
mailing list