[Bioperl-l] Bio::Restriction refactor [Was:Bio::Restriction::Analysis. Exception when using rebasefile.]

Chris Fields cjfields at illinois.edu
Tue Jun 16 18:31:10 UTC 2009


Everything passes on my end (Mac OS X 10.5, perl 5.10.0).  +1 on the  
merge.

Also (as mentioned some time back w/ Hilmar among others), we can  
probably delete this branch seeing as the code will be merged to trunk  
(it being a feature branch and all).  Worth doing the same for a few  
other feature branches as well.

chris

On Jun 16, 2009, at 12:58 PM, Mark A. Jensen wrote:

> Dear All,
>
> There are tests for the new functionality of Bio::Restriction
> now in t/Restriction on the branch, along with the withrefm.906
> in t/data that revealed the bug in RON's post. All tests pass without
> warnings on my machine (which is bioperl live, perl 5.10.10,
> under Vista/cygwin - yes, I still don't have a real computer).
> We're ready for a merge on my end.
>
> Thanks all for your silent assent to these machinations.
> cheers
> Mark
>
> ----- Original Message ----- From: "Mark A. Jensen"  
> <maj at fortinbras.us>
> To: "Rasmus Ory Nielsen" <ron at ron.dk>; <bioperl-l at lists.open-bio.org>
> Sent: Monday, June 15, 2009 7:49 PM
> Subject: [Bioperl-l] Bio::Restriction refactor  
> [Was:Bio::Restriction::Analysis. Exception when using rebasefile.]
>
>
>> Dear All,
>>
>> The revamped Bio::Restriction::* in branch
>>
>> REPOS/bioperl-live/branches/restriction-refactor
>>
>> passes all existing tests, including those in t/Restriction.
>> New tests will be added within the next day or so.
>> The original bug occurred because only a subset of
>> the possible rebase withrefm-formatted enzymes were
>> handled; it choked on freshly-downloaded rebase
>> files because of this.
>>
>> The refactored version now handles *all* rebase types,
>> including those of rebase forms
>>
>> XXX^X                [ intrasite cutters, the main types
>>                              built in to base.pm]
>> XXXX(m/n)          [ right-end extrasite cutters ]
>> (s/t)XXXX            [ left-end ditto ]
>> (s/t)XXXX(m/n)    [ double-end ditto],
>>
>> palindromic and non-palindromic, as well as multisite
>> enzymes that string together combinations of these
>> forms. Much rationalization (well, seems rational to me
>> anyway) and cruft removal in the affected code has also
>> occurred. itype2.pm has been updated as well, to
>> conform to the refactoring.
>>
>> If you're dying to try this now, get a working copy
>> of the branch like so
>>
>> $ svn co svn://code.open-bio.org/bioperl/bioperl-live/branches/ 
>> restriction-refactor bioperl-rr
>> $ cd bioperl-rr
>> $ perl Build.PL
>> $ ./Build test
>> $ ./Build install
>>
>> This will only hammer your current installation in the
>> $SITE_LIB/Bio/Restriction path; I worked only on
>> a sparse checkout of the necessary files. To revert to your
>> old install, do
>>
>> $ cd $MY_OLD_BIOPERL_WORKINGDIR
>> $ ./Build install
>>
>> [In the possible event that these instructions are in error,
>> there will be a response on this list in a matter of
>> milliseconds, so stand by.]
>>
>> Happy coding-
>> Mark
>>
>>
>>
>>
>> ----- Original Message ----- From: "Rasmus Ory Nielsen" <ron at ron.dk>
>> To: <bioperl-l at lists.open-bio.org>
>> Sent: Wednesday, June 10, 2009 3:35 AM
>> Subject: [Bioperl-l] Bio::Restriction::Analysis. Exception when  
>> using rebasefile.
>>
>>
>>> Hi,
>>>
>>> This is my first time using bioperl for restriction analysis, so  
>>> please bear with me, if this is a FAQ.
>>>
>>> I downloaded withrefm.906 from ftp://ftp.neb.com/pub/rebase/ and  
>>> created the script shown at the bottom of the mail.
>>> My bioperl version is bioperl-live nightly from 09-Jun-2009.
>>>
>>> The scripts throws an exception - see below. But, if I comment out  
>>> the '-enzymes' argument, so it uses the built-in collection of  
>>> enzymes, it works.
>>>
>>> My problem is, that I need to use some of the enzymes that are  
>>> only available in rebase. So how do I get this working?
>>>
>>> Thanks for your attention.
>>>
>>> Best regards,
>>> Rasmus Ory Nielsen
>>>
>>>
>>> ############################################################
>>> Output from the script:
>>> ############################################################
>>>
>>> [roni at ksdhcp ~]$ ./restriction_test.pl
>>>
>>> --------------------- WARNING ---------------------
>>> MSG: The enzyme name CviKI-1 was changed to CviKI-I
>>> ---------------------------------------------------
>>>
>>> ------------- EXCEPTION -------------
>>> MSG: Bad end parameter (11). End must be less than the total  
>>> length of sequence (total=7)
>>> STACK Bio::PrimarySeq::subseq /usr/local/lib/perl5/site_perl/ 
>>> 5.10.0/Bio/PrimarySeq.pm:401
>>> STACK Bio::Restriction::Analysis::_enzyme_sites /usr/local/lib/ 
>>> perl5/site_perl/5.10.0/Bio/Restriction/Analysis.pm:900
>>> STACK Bio::Restriction::Analysis::_cuts /usr/local/lib/perl5/ 
>>> site_perl/5.10.0/Bio/Restriction/Analysis.pm:801
>>> STACK Bio::Restriction::Analysis::cut /usr/local/lib/perl5/ 
>>> site_perl/5.10.0/Bio/Restriction/Analysis.pm:379
>>> STACK Bio::Restriction::Analysis::fragment_maps /usr/local/lib/ 
>>> perl5/site_perl/5.10.0/Bio/Restriction/Analysis.pm:515
>>> STACK toplevel ./restriction_test.pl:30
>>> -------------------------------------
>>>
>>> [roni at ksdhcp ~]$
>>>
>>>
>>> ############################################################
>>> Output from the script with the '-enzymes' argument commented out
>>> ############################################################
>>>
>>> [roni at ksdhcp ~]$ ./restriction_test.pl
>>>
>>> --------------------- WARNING ---------------------
>>> MSG: The enzyme name CviKI-1 was changed to CviKI-I
>>> ---------------------------------------------------
>>> $VAR1 = [
>>>          {
>>>            'seq' => 'CTCGACCGTTAGCAA',
>>>            'end' => 15,
>>>            'start' => '1'
>>>          },
>>>          {
>>>            'seq' => 'AGCTTTCTACCGTTATCGT',
>>>            'end' => 34,
>>>            'start' => '16'
>>>          }
>>>        ];
>>> [roni at ksdhcp ~]$
>>>
>>> ############################################################
>>>
>>> #!/usr/bin/perl
>>> use strict;
>>> use warnings;
>>> use Bio::PrimarySeq;
>>> use Bio::Restriction::IO;
>>> use Bio::Restriction::Analysis;
>>> use Data::Dumper;
>>>
>>> # create seq obj
>>> my $seqobj = new Bio::PrimarySeq(
>>>    -seq        => 'CTCGACCGTTAGCAAAGCTTTCTACCGTTATCGT',
>>>    -primary_id => 'test',
>>>    -molecule   => 'dna'
>>> );
>>>
>>> # read rebase file
>>> my $rebase_io = Bio::Restriction::IO->new(
>>>    -file   => 'withrefm.906',
>>>    -format => 'withrefm',
>>> );
>>> my $rebase_collection = $rebase_io->read;
>>>
>>> # start restriction analysis
>>> my $restriction_analysis = Bio::Restriction::Analysis->new(
>>>    -seq     => $seqobj,
>>>    -enzymes => $rebase_collection,    # it works with this line  
>>> commented out
>>> );
>>>
>>> # retrieve fragment maps
>>> my @fragment_maps = $restriction_analysis->fragment_maps('HindIII');
>>> print Dumper \@fragment_maps;
>>> _______________________________________________
>>> 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
>>
>




More information about the Bioperl-l mailing list