[Bioperl-l] substitutions

Hilmar Lapp hlapp@gnf.org
Mon, 9 Sep 2002 23:15:57 -0700


On Monday, September 9, 2002, at 10:56  PM, Hilmar Lapp wrote:

>
> On Monday, September 9, 2002, at 10:00  PM, Aaron J Mackey wrote:
>
>>
>> Turns out, to pass both SeqIO.t and LocationFactory.t you need this:
>>
>> Index: Bio/Factory/FTLocationFactory.pm
>> ===================================================================
>> RCS file:
>> /home/repository/bioperl/bioperl-
>> live/Bio/Factory/FTLocationFactory.pm,v
>> retrieving revision 1.5
>> diff -u -b -B -r1.5 FTLocationFactory.pm
>> --- Bio/Factory/FTLocationFactory.pm    10 Sep 2002 02:24:36 
>> -0000      1.5
>> +++ Bio/Factory/FTLocationFactory.pm    10 Sep 2002 04:48:54 -0000
>> @@ -196,6 +196,8 @@
>>      # remove enclosing parentheses if any
>>      $start =~ s/^\((.*)\)$/$1/;
>>      $end   =~ s/^\((.*)\)$/$1/ if $end;
>> +    $start =~ s/^\(//;
>> +    $end   =~ s/\)$// if $end;
>>
>
> Are you absolutely sure you need the two additional substitutions? 
> This defies all logic, as the previous two substitutions take care 
> of that.
>
> Can you try
>
> $ perl -e '$a = "(200.300)"; $a =~ s/^\((.*)\)$/$1/; print "$a\n";'
>
> on your system and let me know what it prints?
>
> I've checked this on 5.6.0 on OSX and linux and 5.6.1 on Irix -- it 
> works perfectly and removes both parentheses as you'd think it 
> does. Should there be a difference between 5.6.1 on Irix and Linux?

Finally found a linux machine with perl 5.6.1:

[hlapp@terrier ~]$ perl -e '$a = "(200.300)"; $a =~ 
s/^\((.*)\)$/$1/; print "$a\n";'
200.300
[hlapp@terrier ~]$ perl --version

This is perl, v5.6.1 built for i686-linux-ld
[...]

So why does the additional substitution make a difference for you?

Aaahh, now I'm getting what's the problem: if the location is 
(200..300) then $start and $end would only have one parenthesis. And 
since one of the misc.feature locations is J00194:(100..202) you 
would run into this situation. Actually, according to 
http://www.ncbi.nlm.nih.gov/collab/FT/#location the parentheses are 
not allowed here, but I'm going to fix the parser to allow for this.

Let me know whether after my next changes you continue to see 
warnings. I'm also going to add a test specifically for this to the 
LocationFactory test.

	-hilmar
--
-------------------------------------------------------------
Hilmar Lapp                            email: lapp at gnf.org
GNF, San Diego, Ca. 92121              phone: +1-858-812-1757
-------------------------------------------------------------