DETECTER
Site
|  Contains site data in each node
 | 
| No package variables defined. | 
|  my $site = new Site();$site->set_site($id,$seq,$probability);
 
 | 
|  Site is a module that processes posterior probability data and identifies unique amino acids that surpass a specific probability
 
 | 
Methods description
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
Title    : new
Usage    : $site_obj = new Site();
Function : creates new object for storing site data
Returns  : new site object
Argument : none
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
 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
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
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
sub get_site_id
 {	my $class = shift;
	return $class->{id};}
sub new
 {	my $class = shift;
	my $data  = {
		'id'          => undef,
		'uniq_seq'    => undef,
		'probability' => undef
	};
	bless ($data,$class);
	return $data;}
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;
}
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;}
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);}
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