DETECTER

Site

Summary Package variables Synopsis Description General documentation Methods

Summary
 Contains site data in each node
Package variables top
No package variables defined.
Synopsistop
 my $site = new Site();
$site->set_site($id,$seq,$probability);
Descriptiontop
 Site is a module that processes posterior probability data and identifies unique 
amino acids that surpass a specific probability
Methodstop
get_site_idDescriptionCode
newDescriptionCode
process_probDescriptionCode
process_sequenceDescriptionCode
set_siteDescriptionCode
uniqueDescriptionCode

Methods description

get_site_idcodetopprevnext
Title    : get_site_id
Usage : $site_id = $site_obj->get_site_id
Function : fetches site identifier from the site object( e.g. 001)
Returns : site identifier
Argument : none
newcodetopprevnext
Title    : new
Usage : $site_obj = new Site();
Function : creates new object for storing site data
Returns : new site object
Argument : none
process_probcodetopprevnext
Title    : process_prob
Usage : $prob_hash = $site_obj->process_prob($prob_string)
Function : strips out all of the amino acids that are associated with posterior
probability values. This is the utility function of $this->set_site
Returns : hash of posterior probabilities
Argument : probability values as string from PAML file
process_sequencecodetopprevnext
 Title    : process_sequence
Usage : $unique_processed_seq = $site_obj->process_sequence($sequence)
Function : process the sequence to get unique amino acids and eliminates the first
gap problem in excel
Returns : unique processed sequence
Argument : sequence as string from PAML file
set_sitecodetopprevnext
Title    : set_site
Usage : $site_obj->set_site($id_string, $sequence_string,$probability_string)
Function : sets the site identifier, processes the input sequence string to remove
duplicate amino acids and parses the probibility values and store
them to the object
Returns : none
Argument : identifier, sequence, and probability strings
uniquecodetopprevnext
Title    : unique
Usage : $unique_seq = $site_obj->unique($sequence)
Function : appends all of the unique posterior amino acids (that surpass a threshold
probability) to the extant sequence (in lowercase). This is the utility
function of $this->process_sequence
Returns : unique sequence
Argument : sequence string

Methods code

get_site_iddescriptiontopprevnext
sub get_site_id {
	my $class = shift;
	return $class->{id};
}
newdescriptiontopprevnext
sub new {
	my $class = shift;
	my $data  = {
		'id'          => undef,
		'uniq_seq'    => undef,
		'probability' => undef
	};
	bless ($data,$class);
	return $data;
}
process_probdescriptiontopprevnext
sub process_prob {
	my $class = shift;
	my $prob  = shift;
	$prob =~s/^\s*//g;
my @case = split(/\s+/,$prob); my $prob_hash = {}; foreach my $case (@case) { ($aa,$value) = ($case =~ /(\w)\((.*)\)/); $prob_hash->{lc($aa)} = $value; ##print "$aa $value\n";
} return $prob_hash;
}
process_sequencedescriptiontopprevnext
sub process_sequence {
	my $class        = shift;
	my $my_element   = shift;
	my $uniq_element = $class->unique($my_element);
	if (substr($uniq_element,0,1) eq '-'){
		$uniq_element =~s/-//g;
$uniq_element .= '-'; } return $uniq_element;
}
set_sitedescriptiontopprevnext
sub set_site {
	my $class    = shift;
	my $id       = shift;
	$class->{id} = $id;
	$class->{uniq_seq}    = $class->process_sequence(shift);
	$class->{probability} = $class->process_prob(shift);
}
uniquedescriptiontopprevnext
sub unique {
	my $class   = shift;
	my $my_data = shift;
	my @my_data = split(//,$my_data);
	@my_data = do { my %seen; grep !$seen{lc($_)}++, @my_data };
	return join('',@my_data);
}

General documentation

Site top
 Package 'Site'
FEEDBACK top
 All feedback (bugs, feature enhancements, etc.) are greatly appreciated.
AUTHOR top
 Danny W. De Kee (dan.dekee@gmail.com)