[Bioperl-l] regexp / protein database

Mauricio Herrera Cuadra arareko at campus.iztacala.unam.mx
Tue Aug 29 13:13:01 EDT 2006


Supposing that you have an array with all the desired regexps you want 
to search on a record, you can try something like this:

my @regexp = ("regexp1", "regexp2", "regexp3");
for my $i (0 .. $#regexp) {
     while ($record =~ /$i/g) {
         # Do something fancy
     }
}

Regards,
Mauricio.

Chris Fields wrote:
> Funny, I was thinking along the lines of a motif search.  Didn't even think
> of this solution!
> 
> Chris
> 
>> -----Original Message-----
>> From: Cook, Malcolm [mailto:MEC at stowers-institute.org]
>> Sent: Tuesday, August 29, 2006 10:43 AM
>> To: Chris Fields; Hubert Prielinger
>> Cc: bioperl-l at bioperl.org
>> Subject: RE: [Bioperl-l] regexp / protein database
>>
>> For swissprot, you might try SwissKnife
>> (http://swissknife.sourceforge.net/docs/)
>>
>> This will let you write something like this (based on example snippet
>> provided):
>>
>>
>> use SWISS::Entry;
>> # Read an entire record at a time
>> $/ = "\/\/\n";
>> while (<>){
>>   $entry = SWISS::Entry->fromText($_);
>>   next unless $entry->SQs->seq =~ m/$YourRegExp/o;
>>   DO WHAT YOU WANT TO THE SEQUENCE
>> }
>>
>>
>>
>>> -----Original Message-----
>>> From: bioperl-l-bounces at lists.open-bio.org
>>> [mailto:bioperl-l-bounces at lists.open-bio.org] On Behalf Of Chris Fields
>>> Sent: Monday, August 28, 2006 8:41 PM
>>> To: Hubert Prielinger
>>> Cc: bioperl-l at bioperl.org
>>> Subject: Re: [Bioperl-l] regexp / protein database
>>>
>>> Hubert,
>>>
>>> This is answered in the FAQ.  You might also check the mail list
>>> archives via gmane.
>>>
>>> http://www.bioperl.org/wiki/FAQ#Utilities
>>>
>>> http://search.gmane.org/?
>>> query=&email=&group=gmane.comp.lang.perl.bio.general&sort=relev
>>> ance&DEFA
>>> ULTOP=and&query=
>>>
>>> Chris
>>>
>>> On Aug 28, 2006, at 8:15 PM, Hubert Prielinger wrote:
>>>
>>>> Hi,
>>>> Is it possible to scan a protein database (e.g: swissprot..) directly
>>>> with regular expression. I have taken a look at
>>>> Bio::Tools::SeqPattern,
>>>> but it seems it isn't a proper solution.
>>>> like it is done on that webpage: http://scansite.mit.edu/
>>>> dbsequence_reg.html
>>>>
>>>> thanks
>>>> _______________________________________________
>>>> Bioperl-l mailing list
>>>> Bioperl-l at lists.open-bio.org
>>>> http://lists.open-bio.org/mailman/listinfo/bioperl-l
>>> Christopher Fields
>>> Postdoctoral Researcher
>>> Lab of Dr. Robert Switzer
>>> Dept of Biochemistry
>>> University of Illinois Urbana-Champaign
>>>
>>>
>>>
>>> _______________________________________________
>>> Bioperl-l mailing list
>>> Bioperl-l at lists.open-bio.org
>>> http://lists.open-bio.org/mailman/listinfo/bioperl-l
>>>
> 
> _______________________________________________
> Bioperl-l mailing list
> Bioperl-l at lists.open-bio.org
> http://lists.open-bio.org/mailman/listinfo/bioperl-l
> 

-- 
MAURICIO HERRERA CUADRA
arareko at campus.iztacala.unam.mx
Laboratorio de Genética
Unidad de Morfofisiología y Función
Facultad de Estudios Superiores Iztacala, UNAM



More information about the Bioperl-l mailing list