These documents are For the HEAD of the CVS repository on July 19, 2007
Api docs for previous releases
Modware
Protein_info
Modware::Protein_info - Results of many calculations based on protein sequence.
|
Privates (from my definitions) |
@accessors = qw( ala arg asn asp cys gln glu gly his ile leu lys met phe pro ser thr trp tyr val molecular_weight protein_length n_term_seq c_term_seq) |
%protein_lookup = ( 'ala' => 'A', 'asx' => 'B', 'cys' => 'C', 'asp' => 'D', 'glu' => 'E', 'phe' => 'F', 'gly' => 'G', 'his' => 'H', 'ile' => 'I', 'lys' => 'K', 'leu' => 'L', 'met' => 'M', 'asn' => 'N', 'pro' => 'P', 'gln' => 'Q', 'arg' => 'R', 'ser' => 'S', 'thr' => 'T', 'val' => 'V', 'trp' => 'W', 'xaa' => 'X', 'tyr' => 'Y', 'glx' => 'Z', 'ter' => '*', 'sec' => 'U' ) |
Bio::PrimarySeq |
Bio::Tools::SeqStats |
# SEE DESCRIPTION FOR AUTOLOADED METHODS WHICH DO NOT APPEAR IN THIS DOC!!!!!!!!!
# THIS CLASS SHOULD ONLY BE USED THROUGH THE FEATURE OBJECT
# USE CASE: ACCESS MOLECULAR WEIGHT AND N-TERMINAL SEQ FOR A FEATURE
my $feature = new Modware::Feature( -primary_id => 'DDB0191090' );
print $feature->protein_info->molecular_weight(),"\n"; print $feature->protein_info->n_term_seq(),"\n";
|
Since this class calculates protein info on a feature in the database, a feature_id is a required argument to new. Creating a new object will pull all of the stored protein_info from the database into the object. If you wish to update the protein_info based on a new sequence, you have to change the sequence through the seq
Since this class uses the Class::Accessor superclass, there are many methods that do no appear in the list genereated by pdoc. Each of the amino acid counts can be accessed by one of the following:
ala arg asn asp cys gln glu gly his ile leu lys met phe pro ser thr trp tyr val
Other mehtods available are:
molecular_weight : get/set Molecular weight of protein sequence protein_length : get/set length of the protein n_term_seq : get/set n-terminal sequence of the protein seq c_term_seq : get/set c-terminal sequence of the protein seq
|
Methods description
Title : calculate
Function : when sequence changes, you want protein info on that sequence,
: not what is in the database, this method recalculates all info based
: on this new sequence
Returns : nothing
Args : none
Title : new
Usage : generally used through the feature object
Function : creates a new protein info object
Returns : Modware::Protein_info object
Args : reference to sequenc (required)
Title : percent
Function : calculate percentage of total aa's that particular aa is present in sequence
Usage : print "The percent of arginine is ".$prot_info->percent( 'arg' );
Returns : percentage
Args : 3 letter amino acid code ( arg, cys etc) case insensitive
Title : protein_lookup
Note : protein_lookup is a hash keyed on 3 letter code accessors. the values are
: the one letter codes that show up in the sequence. example:
: $prot_info->protein_lookup{'ala'} would return 'A'
Function : gets protein_lookup hash
Returns : protein_lookup hash
Args : protein_lookup ( optional )
Title : sequence
Function : get/set sequence
Note : need to call 'calculate' after sequence has been changed
Returns : protein sequence
Args : protein sequence ( optional )
Methods code
sub calculate
{ my ($self, @args) = @_;
$seqobj = Bio::PrimarySeq->new( -seq => $self->sequence, -alphabet => 'protein' );
$seq_stats = Bio::Tools::SeqStats->new(-seq=>$seqobj);
$count_ref = $seq_stats->count_monomers(); # eg for DNA sequence
my @amino_acids = qw(ala arg asn asp cys gln glu gly his ile leu lys met phe pro ser thr trp tyr val);
foreach my $aa ( @amino_acids ) {
$count_ref->{ $protein_lookup{ $aa } } = 0 if !$count_ref->{ $protein_lookup{ $aa } };
my $accessor_name = lc($aa);
#print $count_ref->{ $protein_lookup{ $aa } }."\n";
$self->$accessor_name( $count_ref->{ $protein_lookup{ $aa } } );
}
# my $iep = $analysis->wait_for ( { 'sequencea_direct_data' => $display_seq } ) ->result;
# my @tmp = ($iep =~ /Isoelectric Point = ([\d\.]+)/);
# $iep = $tmp[0];
$self->molecular_weight( $seq_stats->get_mol_wt()->[0] );
$self->protein_length( $seqobj->length );
$self->n_term_seq( $seqobj->length >= 7 ? $seqobj->subseq(1,7) : $seqobj->seq );
$self->c_term_seq( $seqobj->length >= 7 ? $seqobj->subseq($seqobj->length - 6,$seqobj->length): $seqobj->seq );
}
sub new
{ my ($class, $seqref) = @_;
my $self = {};
bless $self, $class;
my $seq = $$seqref;
$seq =~ s/\*//g;
$self->sequence( $seq );
$self->calculate();
return $self;
}
sub percent
{ my ( $self, $aa ) = @_;
if ( !$aa || !$self->protein_lookup->{$aa} ) {
$self->throw(" need to pass in valid 3 letter amino acid code to calculate percent ");
}
$aa = lc($aa);
return sprintf("%.1f", $self->$aa/$self->protein_length*100);
}
sub protein_lookup
{
return\% protein_lookup;
}
sub sequence
{ my ($self, $obj) = @_;
if($obj) {
$self->{sequence} = $obj;
}
return $self->{sequence};
}
General documentation
Copyright © 2006, Northwestern University
All rights reserved.
|
|