[Bioperl-l] [Bioperl -l] Setting Sequence with nonstandard characters

Jason Stajich jason.stajich at duke.edu
Tue Sep 20 10:50:35 EDT 2005


You can also specifically override validate_seq in your code if you like

Here I am specifically allowing numbers in my alignments to code for  
intron phases, the ? is also allowed for LocatableSeqs.

sub Bio::LocatableSeq::validate_seq {
     my ($self,$seqstr) = @_;
     if( ! defined $seqstr ){ $seqstr = $self->seq(); }
     return 0 unless( defined $seqstr);
     if((CORE::length($seqstr) > 0) && ($seqstr !~ /^([A-Za-z\-\.\*\? 
\d]+)$/)) {
         $self->warn("seq doesn't validate, mismatch is " .
                     ($seqstr =~ /([^A-Za-z\-\.\*\?\d]+)/g));
         return 0;
     }
     return 1;
}

On Sep 20, 2005, at 9:25 AM, Iain Wallace wrote:

> Yes, it is just going to be a marker for that position in the  
> sequence.
> Although. I could infact use N instead, thanks for pointing that out.
>
> However, it would be nice to know if it is possible to use arbitary
> characters as a sequence
>
> On 9/20/05, Andreas Kahari <ak at ebi.ac.uk> wrote:
>
>> On Tue, Sep 20, 2005 at 10:28:19AM +0100, Iain Wallace wrote:
>>
>>> Hi,
>>>
>>> I wonder if anyone could tell me how to set a sequence with
>>> non-standard characters?
>>>
>>> I would like to use the string "???AGCTAGTAC" as a sequence  
>>> string but
>>> when I set it using
>>> $string = "???AGCTAGTAC";
>>> $seq->seq($string);
>>>
>>> I get an exception complaining that the sequence doesn't look  
>>> healthy.
>>> Is there any way I can turn this check of?
>>>
>>
>> Are your question marks supposed to convey some very different
>> information from what is ordinarily meant when using 'N'?
>>
>> E.g., $string = "NNNAGCTAGTAC";
>>
>>
>> Andreas
>>
>> --
>> Andreas Kähäri
>> EMBL-EBI/ensembl
>>
>> ------{ www.embl.org }----{ www.ebi.ac.uk }---- 
>> { www.ensembl.org }------
>>
>>
>
> _______________________________________________
> Bioperl-l mailing list
> Bioperl-l at portal.open-bio.org
> http://portal.open-bio.org/mailman/listinfo/bioperl-l
>

--
Jason Stajich
Duke University
http://www.duke.edu/~jes12





More information about the Bioperl-l mailing list