InSilicoSpectro

 view release on metacpan or  search on metacpan

lib/InSilicoSpectro/InSilico/ModRes.pm  view on Meta::CPAN

use strict;

package InSilicoSpectro::InSilico::ModRes;
require Exporter;
use Carp;

use InSilicoSpectro::Utils::io;
use InSilicoSpectro::InSilico::MassCalculator;

=head1 NAME

InSilicoSpectro::InSilico::ModRes Residue modifications package


=head1 SYNOPSIS

  #read all modres definitions in the default file ({phenyx.config.modres})
  InSilicoSpectro::InSilico::ModRes::init();

  #or, if the ohenyx system is not installed
  InSilicoSpectro::InSilico::ModRes::init("some/path/to/defatultdef.xml");

  #print all the modifications
  foreach (InSilicoSpectro::InSilico::ModRes::getList()){
    $_->print();
  }

  #given a swissprot FT valkue, return the related modres
  foreach ('PHOSPHORYLATION', 'ACETYLATION (IN ISOFORM SHORT))', 'PHOSPHORYLATION', 'ACETYLATION', 'SULFATION'){
    print "$_ => ".InSilicoSpectro::InSilico::ModRes::getModifFromSprotFT($_)->get('name')."\n";
  }

=head1 DESCRIPTION

Manage all what is related to residue modifications (masses, positions, SwissProt annotations...)

=head1 FUNCTIONS

=head2 Initialization

=head3 init([$files, [$files, [...]]])

Opens the given files or try to locate the file ${phenyx.config.modres} and stores all the modif in the dictionnary

=head3 getFromDico(name)

A dictionnary holds all the enzymes, based on their key

=head3 getList()

Returns a list of all the enzymes, sorted by name

=head3 registerModResHandler([\&sub])

get/set a subroutine to be called whenever a new modres is instanciated (for example, register into MassCalaculator

=head1 METHODS

=head3 my $mr=InSilicoSpectro::InSilico::ModRes->new([$h])

$h contains a pointer to a hash for definition

=head3 $mr->name([$str])

Set the name if an argument is given.

Returns the name value

=head3 $mr->regexp([$str]);

Set the modif regular expression from a string (or return this regular expression if no argument is given)

=head3 $mr->cTerm([$val]);
=head3 $mr->nTerm([$val]);

Set if the modif is peptide C/N terminus (or just returns the current status is no value is passed to the function)

=head3 $mr->protCTerm([$val]);
=head3 $mr->protNTerm([$val]);

Set if the modif is protein C/N terminus (or just returns the current status is no value is passed to the function)

=head3 $mr->seq2pos($seq);

returns an array of position where the modif can appear on sequence $seq.

This array contains

=over 4



( run in 1.106 second using v1.01-cache-2.11-cpan-39bf76dae61 )