Bio::ProteaseI - A base class to build your customized Protease



NAME

Bio::ProteaseI - A base class to build your customized Protease


VERSION

version 1.092550


SYNOPSIS

    package My::Protease;
    use Moose;
    extends qw(Bio::ProteaseI);
    augment _cuts => sub {
        my ($self, $substrate) = @_;
        # some code that decides
        # if $peptide should be cut or not
        if ( $peptide_should_be_cut ) { return 1 }
        else                          { return   }
            };


DESCRIPTION

This module describes the interface for Bio::Protease. You only need to use this if you want to build your custom specificity protease and regular expressions won't do; otherwise look at Bio::Protease instead.


METHODS

All of the methods provided in Bio::Protease (namely, cut, digest, is_substrate and cleavage_sites) are defined here, incluiding a stub of the specificity-determining one, '_cuts'. It has to be completed by the subclass with an 'augment' call.


HOW TO SUBCLASS

Step 1: create a child class.

    package My::Protease;
    use Moose;
    extends qw(Bio::ProteaseI);
    1;

Simply create a new Moose class, and inherit from the Bio::ProteaseI interfase using extends.

Step 2: augment _cuts()

The _cuts subroutine will be used by the methods digest, cut, cleavage_sites and is_substrate. It will always be passed a reference to a string of 8 characters; if the subroutine returns true, then the peptide bond between the 4th and 5th residues will be marked as siscile, and the appropiate action will be performed depending on which method was called.

Your specificity logic should only be concerned in deciding whether the 8-residue long peptide passed to it as an argument should be cut between the 4th and 5th residues. This is done by using the augment method modifier (for more information on Method Modifiers, please read up on the Moose::Manual::MethodModifiers manpage), like so:

    augment _cuts => sub {
        my ( $self, $peptide ) = @_;
        # some code that decides
        # if $peptide should be cut or not
        if ( $peptide_should_be_cut ) { return 1 }
        else                          { return   }
            };

And that's it. Your class will inherit all the methods mentioned above, and will work according to the specificity logic that you define in your _cuts() subroutine.

Example: a ridiculously specific protease.

Suppose you want to model a protease that only cleaves the sequence MAEL^VIKP. Your Protease class would be like this:

    package My::Ridiculously::Specific::Protease;
    use Moose;
    extends qw(Bio::ProteaseI);
    augment _cuts => sub {
        my ( $self, $substrate_ref ) = @_;
        if ( $$substrate_ref eq 'MAELVIKP' ) { return 1 }
        else                                 { return   }
            };
    1;

Then you can use your class easily in your application:

    #!/usr/bin/env perl
    use Modern::Perl;
    use My::Ridiculously::Specific::Protease;
    my $protease = My::Ridiculously::Specific::Protease->new;
    my @products = $protease->digest( 'AAAAMAELVIKPYYYYYYY' );
    say for @products; # ["AAAAMAEL", "VIKPYYYYYYY"]
 Bio::ProteaseI - A base class to build your customized Protease