[Bioperl-l] Getting a Subset of an Existing EnzymeCollection

Ursula at BT ursula_cox at btinternet.com
Wed May 9 22:12:26 UTC 2007

Dear BioPerl List,


I'm new to BioPerl (and Perl for that matter). I have an array of enzyme
names, and a larger collection of enzymes (guaranteed to be a superset by
the way it's constructed). I need to make a new collection containing just
the enzymes corresponding to the names I have in the array.


I was hoping that something like:


my $all_rebase =

my $all_rebase_collection = $all_rebase->read();


my @enzymes =


my $new_collection = Bio::Restriction::EnzymeCollection(-empty => 1);

foreach $enzyme (all_rebase_collection)


            $new_collection($enzyme) if grep $_ eq $enzyme->name, @enzymes;



would work, but I get a syntax error near "$new_collection(".


Any clues much appreciated,


Ursula Cox

More information about the Bioperl-l mailing list