view release on metacpan or search on metacpan
sql/markerdb-mysql.sql view on Meta::CPAN
CREATE TABLE marker_microsatellite (
marker_id integer(11) not null PRIMARY KEY,
oligo1_id integer(11) not null,
oligo2_id integer(11) not null,
flanking_gc_percent float(8,4),
length_low integer(6),
length_high integer(6),
motif varchar(128) not null
);
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Bio/Tools/Run/MCS.pm view on Meta::CPAN
for the latter stages (the stages involving align2binomial.pl,
generate_phyloMAX_score.pl and generate_mcs_beta.pl).
You can try supplying normal MCS command-line arguments to new(), eg.
$factory->new(-percentile => 95)
or calling arg-named methods (excluding the initial
hyphens, eg.
$factory->percentile(95)
to set the --percentile arg).
You will need to enable this MCS wrapper to find the MCS scripts.
This can be done in (at least) three ways:
lib/Bio/Tools/Run/MCS.pm view on Meta::CPAN
our $PROGRAM_NAME = 'align2binomial.pl';
our $PROGRAM_DIR;
# methods for the mcs args we support
our @PARAMS = qw(neutral percentile mcs specificity sensitivity name);
our @SWITCHES = qw(neg-score);
# just to be explicit, args we don't support (yet) or we handle ourselves
our @UNSUPPORTED = qw(ucsc gtf neutral-only fourd-align align-only ar);
view all matches for this distribution
view release on metacpan or search on metacpan
Bio/Align/AlignI.pm view on Meta::CPAN
# some descriptors
print $aln->length, "\n";
print $aln->num_residues, "\n";
print $aln->is_flush, "\n";
print $aln->num_sequences, "\n";
print $aln->percentage_identity, "\n";
print $aln->consensus_string(50), "\n";
# find the position in the alignment for a sequence location
$pos = $aln->column_from_residue_number('1433_LYCES', 14); # = 6;
Bio/Align/AlignI.pm view on Meta::CPAN
=head2 consensus_string
Title : consensus_string
Usage : $str = $ali->consensus_string($threshold_percent)
Function : Makes a strict consensus
Returns : consensus string
Argument : Optional threshold ranging from 0 to 100.
The consensus residue has to appear at least threshold %
of the sequences at a given location, otherwise a '?'
Bio/Align/AlignI.pm view on Meta::CPAN
sub num_sequences {
my ($self) = @_;
$self->throw_not_implemented();
}
=head2 percentage_identity
Title : percentage_identity
Usage : $id = $align->percentage_identity
Function: The function calculates the percentage identity of the alignment
Returns : The percentage identity of the alignment (as defined by the
implementation)
Argument: None
=cut
sub percentage_identity{
my ($self) = @_;
$self->throw_not_implemented();
}
=head2 overall_percentage_identity
Title : overall_percentage_identity
Usage : $id = $align->overall_percentage_identity
Function: The function calculates the percentage identity of
the conserved columns
Returns : The percentage identity of the conserved columns
Args : None
=cut
sub overall_percentage_identity{
my ($self) = @_;
$self->throw_not_implemented();
}
=head2 average_percentage_identity
Title : average_percentage_identity
Usage : $id = $align->average_percentage_identity
Function: The function uses a fast method to calculate the average
percentage identity of the alignment
Returns : The average percentage identity of the alignment
Args : None
=cut
sub average_percentage_identity{
my ($self) = @_;
$self->throw_not_implemented();
}
=head1 Alignment positions
view all matches for this distribution
view release on metacpan or search on metacpan
bin/abacas.pl view on Meta::CPAN
-d use default nucmer/promer parameters
-s int minimum length of exact matching word (nucmer default = 12, promer default = 4)
-m print ordered contigs to file in multifasta format
-b print contigs in bin to file
-N print a pseudomolecule without "N"s
-i int mimimum percent identity [default 40]
-v int mimimum contig coverage [default 40]
-V int minimum contig coverage difference [default 1]
-l int minimum contig length [default 1]
-t run tblastx on contigs that are not mapped
-g string (file name) print uncovered regions (gaps) on reference to file name
view all matches for this distribution
view release on metacpan or search on metacpan
# Category :
# Version : 2.2
#-----------------------------------------------------------------------------
sub get_isearch_result_stat{
my (@keys, $num_enq_seq, @pdbg_seqs_ori, $c, $d, $i, %correct_pairs,
$sum_correct, $sum_false, $match_seq, $percent_correct, $correct, @correct,
$av_correct, $av_false, $actual_e_value, $correct_matched,
%correcting_pairs, @correcting_pairs, %correct);
my %seqs=%{$_[0]};
my @pdbg_seqs=@{$_[1]};
$correct_group{$base} .="Nomolog: $sorted $base $msp_0{$sorted}\n";
}
$correct{$sorted} = "Nomolog: $base $msp_0{$sorted}";
}
}
if(@match_seqs == 0){ @match_seqs=1; $percent_correct=0; }
$sum_correct += $correct;
$sum_false += $false_positive;
}
$av_correct = $sum_correct/$num_enq_seq;
$av_false = $sum_false /($num_enq_seq);
my($i,$j,$c,$d,$e,$f,$g,$h,$k,$l,$m,$n,$o,$p,$q,$r,$s,$t,$u,$v,$w,$x,$y,$z);
if($debug==1){print "\n\t\@hash=\"@hash\"
\@raw_string=\"@raw_string\"\n\t\@array=\"@array\"\n\t\@num_opt=\"@num_opt\"
\@char_opt=\"@char_opt\"\n\t\@file=\"@file\"\n\t\@string=\"@string\"\n" }
#""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
my($merge, $verbose, $sat_file, $length_thresh, $factor, $indup, $indup_percent,
$score, @temp_show_sub, $optimize, $file, $evalue, $over_write, $din_dom,
$sum_seq_num, $base_1, $output_clu_file, $short_region, $large_region,
$average_region, $dynamic_factor, @sub_clustering_clu_files);
$factor=7; # default factor is 7 for 70%
}if($vars{'s'}=~/\d+/){ $score = $vars{'s'};
}if($vars{'e'}=~/\d+/){ $evalue= $vars{'e'};
}if($vars{'E'}=~/\d+/){ $evalue= $vars{'E'}; # synonym of e
}
$percent_fac=$factor*10;
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# (0) When one file input was given (yes, divclus can handle multiple files, Sarah!)
#________________________________________________________________________________
if(@file == 1){ #<=== @file has xxxx.msp, yyyy.msp zzzz.msp ....,
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# (5) This is showing the result in clu file format
#________________________________________________________________________________
@temp_show_sub=&show_subclusterings(\@out, $file, $sat_file, $dindom, $indup,
"e=$evalue", "p=$percent_fac", "f=$factor" );
$good_bad = $temp_show_sub[0];
$indup_c = $temp_show_sub[1];
$sum_seq_num += $temp_show_sub[2];
push(@sub_clustering_out_files, @{$temp_show_sub[3]});
@out=@{&cluster_merged_seqlet_sets(\@grouped_seq_names, "f=$factor", $optimize, $dynamic_factor,
$short_region, $large_region, $average_region)};
@temp_show_sub=&show_subclusterings(\@out, $big_msp_file, $sat_file, $dindom, $indup,
"e=$evalue", "p=$percent_fac", "f=$factor");
$good_bad = $temp_show_sub[0];
$indup_c = $temp_show_sub[1];
$sum_seq_num += $temp_show_sub[2];
push(@sub_clustering_out_files, @{$temp_show_sub[3]});
if($debug==1){print "\n\t\@hash=\"@hash\"
\@raw_string=\"@raw_string\"\n\t\@array=\"@array\"\n\t\@num_opt=\"@num_opt\"
\@char_opt=\"@char_opt\"\n\t\@file=\"@file\"\n\t\@string=\"@string\"\n" }
#""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
my ($max_size, $sat_file_name, $clu_file_name,
$ori_cluster_size, $ori_cluster_num, $good_bad, @keys, $percentage_fac,
$indup, @sizes, $sum_seq_num, $indup_percent, $indup_count, %tem4,
@sub_clustering_out_files); # clusall_1e-5_clu_14-324_ss.sat
my @out=@{$array[0]};
$indup_count=0;
if($char_opt=~/d/){ $dindom=1; }
if($char_opt=~/i/){ $indup=1; }
if($vars{'f'}=~/\S+/){ $factor= $vars{'f'}; }
if($vars{'p'}=~/\d+/){ $percentage_fac= int($vars{'p'}); }
if($vars{'s'}=~/\d+/){ $score = $vars{'s'}; }
if($vars{'e'}=~/\d+/){ $evalue= $vars{'e'}; }
#print "\n# (1) show_subclusterings : \@file has : @file\n";
if( $file[0]=~/([\S+_]*?(\d+)\-(\d+)[_\w]*)\.msp/ or
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# Local subroutine
#_______________________________________________________________
sub print_summary_for_divclus{ #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
my(@keys, $indup_count, $x, $m, $percentage_fac);
my $count=$_[0]; # count of cluster
my %tem2=%{$_[1]}; my $num_seq=@keys=sort keys %tem2;
my %tem=%{$_[2]}; my $ori_cluster_num=$_[3];
my $new_clus_NAME=$ori_cluster_num.'0'.$count.'0'.$num_seq;
my $ori_cluster_size=$_[4];
}
#~~~~~~~~~~ Summary ~~~~~~~~~~~~~~~~~~~~~~~~~~~
print CLU "Cluster size $num_seq\n";
printf CLU ("Cluster number %-12s # E:%-5s Factor:%-2s P:%-2s, Ori size:%-4s Sub:%-4s From:%-12s\n",
$new_clus_NAME, $evalue, $factor, $percentage_fac,
$ori_cluster_size, $num_seq, $ori_cluster_num);
print "Cluster size $num_seq\n";
printf ("Cluster number %-12s # E:%-5s Factor:%-2s P:%-2s, Ori size:%-4s Sub:%-4s From:%-12s\n",
$new_clus_NAME, $evalue, $factor, $percentage_fac,
$ori_cluster_size, $num_seq, $ori_cluster_num);
for($x=0; $x <@keys; $x++){
printf CLU (" %-4s %-5s %-17s %-10s %-3s leng: %-s\n",
$num_seq, $ori_cluster_num, $keys[$x], $tem3{$keys[$x]}, $tem{$keys[$x]}, $tem4{$keys[$x]});
printf (" %-4s %-5s %-17s %-10s %-3s leng: %-s\n",
# 1cdg_6taa 67%
# 1cdg_2aaa 67%
#
# Warning :
# Keywords :
# Options : 'p' or 'P' for percentage term(default)
# 'r' or 'R' for ratio term (0.0 - 1.0), where 1 means all the
# segments were wrongly aligned.
# 's' or 'S' for Shift rate (it actually caculates the position shift
# rate for the secondary structure segment.
# 'h' or 'H' for position Shift rate (it actually caculates the position
# shift rate for helical segments). If this is the only option, it
# will show the default percentage term rate for helical segments.
# If used with 'r', it will give you ratio (0.0 - 1.0) for helical
# segment. If used with 's' option, it will give you position shift
# rate for only helical segments.
# 'e' or 'E' for position Shift rate (it actually caculates the position
# shift rate for beta segments). If this is the only option, it will
# show the default percentage term rate for beta segments. If used
# with 'r', it will give you ratio (0.0 - 1.0) for beta. If used
# with 's' option, it will give you position shift rate for only
# beta segments.
# Returns :
# Argument : Two references of hashes. One for error rate the other for sec.
# 2aaa_6taa -------00000---------00000000----0000-------00000-
# 1cdg_6taa -------442---------------2222-----------------000-
# 1cdg_2aaa -------222---------------2222-----------------000-
#
# In the above there are two segments wrong in 3 segment blocks = 2/3
# <output example> hash of 3 percentage rates.
#
# 2aaa_6taa 0 %
# 1cdg_6taa 66.6666666666667 %
# 1cdg_2aaa 66.6666666666667 %
#
# seq1 00111110000, The 'a' value of 0 and 1 as in the seq2
# seq2 33000040000 is 0-> 6/6, 1-> 4/5, while the 'n'
# calc would be, 0-> 6 (60%), 1-> 4(40%)
#
# Argument : (\%hash1, \%hash2) or optionally (\%hash1, \%hash2, ['n', 'i', 'p', 'a'])
# 'n' => normalizing, 'p' => percentage out, 'i' => make int out, 'a'=> averaged
# Category :
# Version : 1.2
#--------------------------------------------------------------------
sub tally_2_hashes{
#"""""""""""""""""< handle_arguments{ head Ver 4.1 >"""""""""""""""""""
for ($t=0; $t< @input; $t++){ $length=length($input[$t]) if(length($input[$t])>$length);}
if ($length < $window_size){ $window_size = $length; }
#___________ getting ratio for the whole sequence ___________
$compos_whole_seq=${&main::compos_id_percent_array(\@input)}; ## for whole composition rate
$seq_id_whole_seq=${&main::seq_id_percent_array(\@input)};
print "\nComposition ID of the alignment: $compos_whole_seq\%\n";
print "Sequence ID of the alignment: $seq_id_whole_seq\%\n";
if ($seq_id_whole_seq == 0){ $ratio_whole_seq =0; }
else{ $ratio_whole_seq = $compos_whole_seq/$seq_id_whole_seq; }
print "Composition and Sequ. ID Ratio: $ratio_whole_seq\n";
}
#####################################################################
## Getting Compos and Seq ids ##
#####################################################################
$compos_id=${&main::compos_id_percent_array(\@array_of_2_seq)};
$seq_id =${&main::seq_id_percent_array(\@array_of_2_seq)};
#####################################################################
#### Go back if the Seq id is bigger than Compos id #######
#####################################################################
$length=length($input[$t]) if (length($input[$t])>$length); }
if ($length < $window_size){ $window_size = $length; }
#___________ getting ratio for the whole sequence ___________
$compos_whole_seq=${&compos_id_percent_array(\@input)};
$seq_id_whole_seq=${&seq_id_percent_array(\@input)};
if ($seq_id_whole_seq == 0){ $ratio_whole_seq =$compos_whole_seq/10; }
else{ $ratio_whole_seq =$compos_whole_seq/$seq_id_whole_seq; }
#___________ getting ratio for each window sequence ___________
for ($w=0; $w < $length; $w++){
$offset = $w - int($window_size/2); # $offset starts from -5 when window_size is 10.
$offset=0 if ($offset < 0);
$window_1=substr($input[0], $offset, $window_size); # window_1 is one segment
$window_2=substr($input[1], $offset, $window_size); # of defined length(size)
@array_of_2_seq=($window_1, $window_2); # making an array like this = ('ABCDE', 'BDESA')
$compos_id=${&compos_id_percent_array(\@array_of_2_seq)};
$seq_id =${&seq_id_percent_array(\@array_of_2_seq)};
#print "\n offset = $offset Wind1 = $window_1 Wind2 = $window_2 ";
#print " Compos1 = $compos_id Seqid = $seq_id \n";
#______ Handle special case when $seqid is zero > the rate becomes $compos_id/10 ______
if (($seq_id == 0) && ($compos_id != 0)){ $ratio_compos_vs_seqid = $compos_id/10; }
# Example :
# Warning :
# Keywords : composition of chars, composition table making,
# make_composition, make composition table
# occurances_of_char, get_char_occurances, occurances
# get_percentage_occurances_of_char, percentage_occurances_of_char
# Options : 'p' for percentage output of the char among others
# 'n' for NO name option when HASH input is given
# Returns : one ref. of hash (a =>5, b=>6, c=>4,,,,,)
# Argument : one ref. of hash (seq1 alsdfjlsj
# seq2 asldfjsld
# seq3 owiurouou);
# Category :
# Version : 1.4
#--------------------------------------------------------------------
sub get_occurances_of_char{
my ($i, %H, $no_name, %out, $N,@splited, $val,$percentage_out,
$split, $sum);
for($i=0; $i< @_; $i++){
if($_[$i]=~/^[\-]?p$/i){
$percentage_out=1; splice(@_, $i, 1); $i--;
}elsif($_[$i]=~/^[\-]?n$/i){
$no_name=1; splice(@_, $i, 1); $i--;
}
}
}elsif( !(ref($_[$i])) ){
@splited = split(//, $_[$i]);
for $split (@splited){ $out{$split}++; $sum++ }
}
}
if($percentage_out==1){
my @keys=keys %out;
my %percent;
for($i=0; $i< @keys; $i++){
$percent{$keys[$i]} = $out{$keys[$i]}/$sum*100;
}
return(\%percent);
}else{
return(\%out);
}
}
}
#________________________________________________________________________
# Title : amino_acid_compos_id_percent
# Usage : $percent = &amino_acid_compos_id_percent (%any_hash_with_sequences);
# The way identity(composition) is derived is;
#
# Function : gets amino acid composition identity of any given
# number of sequences(at least 2).
# Example :
# Options :
# Argument : hash of at least 2 sequences.
# Category :
# Version : 1.1
#--------------------------------------------------------------------
sub amino_acid_compos_id_percent{
my(%input)= %{$_[0]};
my(@names)=keys (%input);
my(@temp, $i, $j, $iden, @all_pairs_id, $iden_sum);
my(%compos_table1, %compos_table2, $final_iden, $larger);
for ($i=0; $i < @names; $i ++){ # putting seqs in arrays.
$final_iden=$iden_sum/@all_pairs_id;
\$final_iden;
}
#________________________________________________________________________
# Title : seq_id_percent_array (more than 2 elements array)
# Usage : $percent = &seq_id_percent_array(@any_array_sequences);
# The way identity(pairwise) is derived is;
#
# Function : produces amino acid composition identity of any given number of sequences.
# Example :
# Warning : This can handle 'common gaps' in the sequences
# Keywords : get_percent_composition_identity, seq_composition_identity,
# percent_sequence_composition_id
#
# Options :
# Returns :
# Argument :
# Category :
# Version : 1.0
#--------------------------------------------------------------------
sub seq_id_percent_array{
my(@input, $denominator,@all_pairs_id, $percent_id);
my($largest,$p,$i,$j,$k,$iden_residue_num,$iden,@temp,$iden_sum,$gap_num,$final_iden);
for($d=0; $d<@_; $d++){
if(ref($_[$d]) eq 'ARRAY'){ @input=@{$_[$d]}; }
elsif( (ref($_[$d]) eq 'SCALAR') &&( ${$_[$d]}=~/^[aA]/) ){ $average_len_opt =1 }
elsif( !(ref($_[$d])) && ( $_[$d] =~/^[aA]/) ){ $average_len_opt =1 } }
if ((@input== 1)||( @input== 0)){
print "\n\n \" $0 \" requires at least 2 sequences\n\n";
print "\n Abnormally dying at seq_id_percent_array in $0 \n\n";
print chr(7); exit;}
$shortest=length($input[0]);
my($sans_gap_seq, $length_sum, $average_seq_len);
for($p=0; $p < @input; $p++){
$input[$p]=~ tr/a-z/A-Z/;
$iden_residue_num++; }
elsif((${"string$i"}[$k] =~ /\W/)&&(${"string$i"}[$k]=~ /\W/)){ $gap_num++; }}
if( $average_len_opt == 1){ $denominator = $average_seq_len; }
else{ $denominator = $shortest; }
if($denominator == 0){ $denominator=1; } # in the above it is 50% rather than 0.07%
$percent_id=($iden_residue_num/($denominator))*100;
push(@all_pairs_id, $percent_id);
undef ($iden_residue_num, $gap_num);
}
}
for (@all_pairs_id){ $iden_sum+=$_; }
$final_iden=$iden_sum/($#all_pairs_id+1);
return( \$final_iden );
}
#________________________________________________________________________
# Title : compos_id_percent_array (more than 2 elements array)
# Usage : $percent = &compos_id_percent_array(@any_array_sequences);
# The way identity(composition) is derived is;
# Function : produces amino acid composition identity of any given number of sequences.
# Example :
# Warning :
# Keywords :
# Returns :
# Argument :
# Category :
# Version : 1.0
#--------------------------------------------------------------------
sub compos_id_percent_array{
my(@input)=@{$_[0]};
my($largest,$iden,@temp,$iden_sum,$final_iden, @all_pairs_id);
for($i=0; $i<=$#input; $i++){ $input[$i]=~ tr/a-z/A-Z/; $input[$i]=~ s/[\.\-\s]//g;
@temp = split('', $input[$i]); (@{"string$i"})= @temp;
$largest = @{"string$i"} if @{"string$i"} > $largest; }
#-----------------------------------------------------
return ( \$final_iden ); # final identity for any given set of strings(seq).
}
#________________________________________________________________________________
# Title : compos_id_percent_hash (synonym of amino_acid_compos_id_percent)
# Usage : $percent = &compos_id_percent_hash(%any_hash_with_sequences);
# The way identity(composition) is derived is;
#
# Function : gets amino acid composition identity of any given number of sequences.
# Example :
# Warning :
# Returns :
# Argument :
# Category :
# Version : 1.0
#------------------------------------------------------------------------------
sub compos_id_percent_hash{ my(%input, @names);
if(ref($_[0]) eq 'HASH'){ %input= %{$_[0]}; @names= keys %input; }
else{ print "\n hash ref was not passed to compos_id_percent_hash\n"; exit; }
my(@temp, $iden, @all_pairs_id, $i, $j, $k,$iden_sum);
my(%compos_table1, %compos_table2, $final_iden, $larger);
for ($i=0; $i < @names; $i ++){ $input{$names[$i]}=~ tr/a-z/A-Z/;
$input{$names[$i]}=~ s/\W//g; @temp = split('', $input{$names[$i]});
(@{"string$i"})=@temp; $larger = @{"string$i"} if @{"string$i"}>$larger;}
# ('A', 290, 'C', 199, D, 100)
# uses only two sequences.
# Warning :
# Keywords :
# Options :
# Returns : ref. of a scaler (in percent) eg) 95
# Argument : two references of hash of seqeunces.
# Category :
# Version : 1.0
#--------------------------------------------------------------------
sub common_compos_id_hash{
# ('A', 290, 'C', 199, D, 100)
# uses only two sequences.
# Warning :
# Keywords :
# Options :
# Returns : ref. of a scaler (in percent) eg) 95
# Argument : two references of hash of seqeunces.
# Category :
# Version : 1.0
#--------------------------------------------------------------------
sub calc_compos_id_hash{ my(%hash1)=%{$_[0]}; my(%hash2)=%{$_[1]}; my(%common_of_the_2)=();
$sum_of_the_common_residue_no += $common; }
$compos_id = $sum_of_the_common_residue_no/($sum_residues/2)*100; }
\$compos_id;
}
#________________________________________________________________________
# Title : get_percentage
# Usage : %out= %{&get_percentage(\%result, '1')};
# Function : calculates the percentage content of any single char over the whole
# length of strings in it.
# Example : if the string is 'seq ABCDEEEEEFFEFE' given in a hash
# if you put 'A' as one argument, it counts the occurances of 'A'
# and gets the percentage of it.
# Warning : This converts array and string input as ref. into arbitrary hash and
# returns hash
# programmed by A Biomatic
# Keywords : get_percentage_of_char
# Options : None yet.
# Returns : Numerical Percentage
# Argument : ref. for Scalar string or Array of chars or Hash AND 'the target char'
# Category :
# Version : 1.0
#--------------------------------------------------------------------
sub get_percentage{
my(@in, $k, $sort, $numerator, $residue, @out_hash_ref, %hash_out );
for($k=0; $k< @_ ;$k++){
if( !ref($_[$k])&& (length($_[$k]) == 1 )){
$numerator = $_[$k];
}
for $name(@keys){
my($numerator_count);
my($seq_len) = length($H{$name}); print "\n $name Sequence length: ", $seq_len, "\n";
my(@string) = split(//, $H{$name});
for $residue (@string){ if($residue =~/^$numerator$/){ $numerator_count ++; }}
my($percent) = $numerator_count/$seq_len *100;
$hash_out{$name}=$percent; }
push(@out_hash_ref, \%hash_out); }
if(@out_hash_ref ==1){ return($out_hash_ref[0]); }
elsif( @out_hash_ref > 1){ return(@out_hash_ref); }
}
#________________________________________________________________________
# Title : pairwise_percent_id (pairwise sequence identity in percentage)
# Usage : $identity = ${&pairwise_percent_id(%arrayinput)};
#
# Function : takes a ref. of a hash of names and sequences, returns
# percent identity.
# Example :
# Warning :
# Keywords :
# Options :
# Returns :
# Argument :
# Category :
# Version : 1.0
#--------------------------------------------------------------------
sub pairwise_percent_id{
my($i,$j,$k, @iden_array_ref);
for($i=0; $i< @_; $i++){ my %input= %{$_[$i]}; my @names= sort keys %input;
my(@temp, $iden, @all_pairs_id, $whole_seq_len, $residue_sum1,$residue_sum2);
my($final_av_iden, $larger, $percent_for_pair,@percent_for_pair, $iden_sum);
for ($i=0; $i < @names; $i ++){ $input{$names[$i]}=~ tr/a-z/A-Z/;
@temp = split('', $input{$names[$i]}); (@{"string$i"})=@temp;
$larger = @{"string$i"} if @{"string$i"} > $larger; }
for ($i=0; $i < @names; $i++){ # to make permutated pairs.
for ($j=$i+1; $j < @names; $j ++){
for ($k=0; $k < $larger; $k ++){ # getting composition tables for two seqs.
$iden+=2 if ((${"string$i"}[$k] eq ${"string$j"}[$k])&&(${"string$i"}[$k] =~ /\w/));
$residue_sum1++ if (${"string$i"}[$k] =~ /\w/);
$residue_sum2++ if (${"string$j"}[$k] =~ /\w/); }
$whole_seq_len =($residue_sum1+$residue_sum2);
$percent_for_pair = $iden/$whole_seq_len*100;
push(@percent_for_pair,$percent_for_pair);
$residue_sum1=0; $residue_sum2=0; $iden=0; } }
for $iden (@percent_for_pair){ $iden_sum+=$iden;}
$final_av_iden=$iden_sum/( @percent_for_pair );
push(@iden_array_ref, \$final_av_iden); }
if(@iden_array_ref ==1){ return($iden_array_ref[0]);}else{ return(@iden_array_ref);}
}
#________________________________________________________________________
# Title : get_seq_identity
# Usage : $identity = ${&get_seq_identity(%arrayinput)};
#
# Function : takes a ref. of a hash of names and sequences, returns
# percent identity. NOT composition identity.
# Example :
# Warning :
# Keywords : get_sequence_identity
# Options :
my($i,$j,$k, $c, @iden_array_ref);
for($c=0; $c< @_; $c++){
my %input= %{$_[$c]};
my @names= sort keys %input;
my(@temp, $iden, @all_pairs_id, $whole_seq_len, $residue_sum1,$residue_sum2);
my($final_av_iden, $larger, $percent_for_pair,@percent_for_pair, $iden_sum);
for ($i=0; $i < @names; $i ++){
$input{$names[$i]}=~ tr/a-z/A-Z/;
@temp = split(//, $input{$names[$i]});
@{"string$i"}=@temp;
$larger = @{"string$i"} if @{"string$i"} > $larger; }
}
$residue_sum1++ if (${"string$i"}[$k] =~ /\w/);
$residue_sum2++ if (${"string$j"}[$k] =~ /\w/);
}
$whole_seq_len =($residue_sum1+$residue_sum2);
$percent_for_pair = $iden/$whole_seq_len*100;
push(@percent_for_pair,$percent_for_pair);
$residue_sum1=0;
$residue_sum2=0;
$iden=0;
}
}
for $iden (@percent_for_pair){
$iden_sum+=$iden;
}
if(@percent_for_pair <1){ @percent_for_pair=(1); }
$final_av_iden=$iden_sum/( @percent_for_pair );
push(@iden_array_ref, \$final_av_iden);
}
if(@iden_array_ref ==1){
return($iden_array_ref[0]);
}else{
#________________________________________________________________________
# Title : get_correct_percent_alignment_rate (made for Bissan)
# Usage : &get_correct_percent_alignment_rate(\$file1, \$file2);
# Function : accepts two files and prints out the sequence identities of the alignment.
# Example :
# Warning : Alpha version, A Biomatic , made for Bissan
# Keywords :
# Options : h # for help
# v # for verbose printouts(prints actual sequences)
# Returns : reference of Scalar for percentage correct alignment(for already
# aligned sequences)
# Argument : two sequence files which have identical sequence names.
# Category :
# Version :
#--------------------------------------------------------------------
sub get_correct_percent_alignment_rate{
my($i, $j, $k, $verbose, @string1, @string2, $larger, $seq_pair_id, @seq_pair_ids );
my(%inputhash1) = %{&read_any_seq_files($_[0])};
my(%inputhash2) = %{&read_any_seq_files($_[1])};
my(@names)= sort keys %inputhash1;
######################################
elsif(@seq_pair_ids > 1){ return( \@seq_pair_ids ); }
}
#________________________________________________________________________
# Title : amino_acid_compos_id_percent_trend
# Usage :
# Function :
# Example :
# Warning :
# Keywords :
# Returns :
# Argument :
# Category :
# Version : 1.0
#--------------------------------------------------------------------
sub amino_acid_compos_id_percent_trend{
my(%input) = %{$_[0]};
my(@common, @string,@accumu_percent_iden)=(); my(%common_so_far, %compos_table);
my($percent_id_so_far, $length_of_one_seq,$length_of_all_seq, $seq_no)=0;
for $key(keys %input){
$input{$key}=~s/[. \d-]//g;
@string= split(//, $input{$key});
print @string; print "\n";
$length_of_one_seq = $#string+1;
%compos_table = &composition_table(@string);
@check = keys (%common_so_far);
if ($#check < 0){ %common_so_far = %compos_table; }
else{ %common_so_far= %{&common_compos_2_hash(\%common_so_far,\%compos_table)};}
for $value(values %common_so_far){ $common_residue_sum +=$value; }
$final_percent_id = $common_residue_sum/($length_of_all_seq/$seq_no)*100;
$common_residue_sum =0; }
for $value(values %common_so_far){ $common_residue_sum +=$value; }
$final_percent_id = $common_residue_sum/($length_of_all_seq/$seq_no)*100;
return(\$final_percent_id);
}
#________________________________________________________________________
# Title : composition_table (can handle both nucleic and protein seq)
# Usage : %output = %{&compos_table(@input_array1, @input_array2,,,,)};
\%common_of_the_2;
}
#________________________________________________________________________
# Title : pair_percent_id_trend
# Usage : @array = &pair_percent_id_trend (%arrayinput);
# Function :
# Example : common gaps means only '.' (dots, not alphabets!!)
# AAA....BBCB
# AAAB..B.BCC --> A.A.....BC. (as in an array)
# A.AAA...BCA
# Returns :
# Argument :
# Category :
# Version :
#--------------------------------------------------------------------
sub pair_percent_id_trend{
my(%input) = %{$_[0]};
my(@common, @string,@accumu_percent_iden)=();
my($percent_id_so_far)=0;
for $key(keys %input){
my($len) = &smaller_one($#common, $#string) unless $#common < 0;
$input{$key}=~s/ //g;
@string= split(//, $input{$key});
$length_of_one_seq = $#string+1;
$common[$k]='.';
}
}
$num_of_iden_char = &count_num_of_char(\@common);
$av_seq_no = $length_of_all_seq/$seq_no;
$percent_id_so_far = $num_of_iden_char/$av_seq_no*100;
print "\n percent_id so far = $percent_id_so_far \n";
push(@accumu_percent_iden,$percent_id_so_far);
} # end of for (after all sequences have been run).
$num_of_iden_char = &count_num_of_char(@common);
$av_seq_no = $length_of_all_seq/$seq_no;
$percent_id_so_far = $num_of_iden_char/$av_seq_no*100;
print "\n percent_id so far = $percent_id_so_far \n";
\@accumu_percent_iden; # final ids array.
}
#________________________________________________________________________
# Title : smaller_one
# Usage : $smaller = & smaller_one($var, $var2);
#
# Version :
#--------------------------------------------------------------------
sub count_num_of_char{
my(@input)={$_[0]};
my($num_of_char)=0;
for $elem(@input){ # this is for the percentage of TWO seqs.
if ($elem =~ /\w/){
$num_of_char +=1;
}
}
$num_of_char;
#
# Warning :
# Keywords : open_prd_files, open_pred_files, predator, open_prdl_files
# open_pre_files, secondary structure prediction file
# Options : 's' for sequence output as well (\%sec_str, \%seq)
# 'p' for percentage of the sec. str.
# 'a' for accumulated percentage. This will
# set 'p' automatically
# 'n' for NO name when outputing Percentage of chars with
# HASH input to get_occurances_of_char sub.
# $reverse_residue_order=r by r
# Returns :
my($i,$j,$c,$d,$e,$f,$g,$h,$k,$l,$m,$n,$o,$p,$q,$r,$s,$t,$u,$v,$w,$x,$y,$z);
if($debug==1){print "\n\t\@hash=\"@hash\"
\@raw_string=\"@raw_string\"\n\t\@array=\"@array\"\n\t\@num_opt=\"@num_opt\"
\@char_opt=\"@char_opt\"\n\t\@file=\"@file\"\n\t\@string=\"@string\"\n" }
#""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
my( @out_ref, $seq_out, %sec_str, %seq, $percent_out, $NO_name_out,
$short_form_out_detected, $long_form_out_detected, $accumulate,
$reverse_residue_order, %rev_sec_str);
if($char_opt=~/s/i){ $seq_out=1 }
if($char_opt=~/a/i){ $accumulate=1 }
if($char_opt=~/p/i){ $percent_out=1 }
if($char_opt=~/n/i){ $NO_name_out='n' }
if($char_opt=~/r/){ $reverse_residue_order='r' }
for($i=0; $i< @file; $i++){
my (%sec_str, %seq) if($accumulate !=1);
}
}
close (PREDATOR_FILE);
print "\n \%sec_str is: ", %sec_str, "\n" if ($debug == 1);
if($seq_out==1){ push(@out_ref, \%sec_str, \%seq);
}elsif($percent_out==1 ){
push(@out_ref, [%{&get_occurances_of_char(\%sec_str, $NO_name_out, 'p')}] );
}elsif($percent_out !=1){ push(@out_ref, \%sec_str) }
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~`
# If -r option is set (for long form, this does not affect
#____________________________________________________________
if($short_form_out_detected and $reverse_residue_order){
# TTTTTTTTTTTFFFFFFFFFFFFFFTTTTTTTTTTTTTTTTTFTT-TTTTFFFFFTFFTTTFTTTFFTTFTFTFF
# >P1;1cdg
# DSSP
# CCCCCCCCCCCCCCCCEEECCHHHHCCCCGGGCCCGGGCCCCCCC-CCCCCCCCHHHHHHHHHCCHHHHHCCCEE
# >P1;1cdg
# percentage accessibility
# 67523272360000000000000002213792129b722248085-14110000030015105660028040200
# 2ltn ----TETTSFLITKFSPDQQNLIFQGDGYTT-KEKLTLTK------AVKNTVGRALYSSP
# 1loe ----TETTSFSITKFGPDQQNLIFQGDGYTT-KERLTLTK------AVRNTVGRALYSSP
#
# 2ltn ----CEEEEEEECCCCCCCCCEEEEPCCEEP-PPCEEEEC------CCCPCEEEEEECCC
%hash, @keys, @array, @hash, $option_string, $string, @in, $line,
$name, %out, $gap_chr, @str1, @str2, $num_opt, @file, @dir,
$char_opt, $char_opt_given, $num_opt_given,
@char_options, @file, $original_dir, @read_files, %array_msf, %array_jp,
$jp_file, $error_rate, $id_compos, @dir, @names, $name, $name_found,
@outref, %sequence, %secondary,%solvent_access, %DSSP, %percent_accessibility,
$name_found,$type_seq, $type_secon, $type_sol, $type_DSSP, $type_acc
);
##################################################
##### Start of general argument handling ######
##################################################
}elsif(($type_sol ==1)&&(/^([\w\-]+)[\*]*$/)){
$solvent_access{$name}.=$1; #from below========= DSSP
}elsif(/^DSSP/){ $type_DSSP = 1;
}elsif(($type_DSSP ==1)&&(/^([\w\-]+)[\*]*$/)){
$DSSP{$name}.=$1; #from below=================== PERCENTAGE ACCESSIBILITY
}elsif(/^percentage accessibility/){ $type_acc = 1;
}elsif(($type_acc ==1)&&(/^([\w\-]+)[\*]*$/)){
$percent_accessibility{$name}.=$1; } }
push(@outref,\%sequence,\%secondary,\%solvent_access,\%DSSP,\%percent_accessibility);
} }
if( ($char_opt =~ /s/i) || ( @outref == 1 ) ){
return(\%sequence); }
elsif( @outref > 1){ return(@outref); } # <-- contains (\%sequence,\%secondary,....)
}
# %array_msf =&open_msf_files($realfile1);
# %array_jp =&open_jp_files ($jp_file);
# $array_ref_msf = \%array_msf;
# $array_ref_jp = \%array_jp;
# $error_rate =&get_posi_shift_hash($array_ref_msf, $array_ref_jp);
# $id_compos =&amino_acid_compos_id_percent($array_ref_jp);
# push(@rates_accumu,$error_rate);
# push(@compos_id,$id_compos);
}
}
else
&caller_info;
}
\$id_counter; # $id_counter is the homology counter;
}
#________________________________________________________________________
# Title : get_percent_homol_arr
# Usage : $homology_out = ${&get_pair_homol(\@any_array_of_2_elem)};= @ar=(ABCDE..., CDEGA..)
# Function : get pair wise seq. identity of any two strings, outputs a scalar (%)
# Example :
# Warning : reliable, but input seq. strings shouldn't contain spaces.
# Keywords :
# Returns :
# Argument :
# Category :
# Version : 1.0
#--------------------------------------------------------------------
sub get_percent_homol_arr{
my(@input)=@{$_[0]};
$input[0] =~ tr/a-z/A-Z/; # capitalizing.
$input[1] =~ tr/a-z/A-Z/; # capitalizing.
my(@string1)= split(//,$input[0]);
my(@string2)= split(//,$input[1]);
if (($#string1 == -1) || ($#string2 == -1)){
print "\n One of the string is empty O.K. ? \n";
}
my($larger)= &max($#string1, $#string2);
my($id_counter, $gap_counter, $non_equal_counter, $sum,$percent_homol)=0;
for ($i = 0; $i<=$larger; $i++){
if (($string1[$i] eq '.')|| ($string2[$i] eq '.')){
$gap_counter+=1;
}elsif ($string1[$i] eq $string2[$i]){
$id_counter +=1;
$sum = ($id_counter + $gap_counter + $non_equal_counter);
if ($sum != ($larger+1)){
print "\n There is something wrong in getting homology in get_pair_homol \n";
&caller_info;
}else{
$percent_homol=($id_counter/$sum)*100;
}
return(\$percent_homol); # $id_counter is the homology counter;
}
#________________________________________________________________________
# Title : get_pair_homol_hash
# Usage : $homology_out = & get_pair_homol (%any_hash); , eg) %hash = (name1, ABCDE..., name2, CDEGA..)
&caller_info;
}
return ($id_counter); # $id_counter is the homology counter;
}
#________________________________________________________________________
# Title : get_percent_homo_hash
# Usage : $homology_out = &get_pair_homol_hash(%any_hash); , eg) %hash = (name1, ABCDE..., name2, CDEGA..)
# Function : get pair wise seq. identity(%) of any two strings put in as a hash
# Example :
# Warning : reliable, but input seq. strings shouldn't contain spaces.
# Keywords :
# Returns :
# Argument :
# Category :
# Version : 1.0
#--------------------------------------------------------------------
sub get_percent_homo_hash{
my(%input)=@_;
&hash_chk(\%input);
my(@keys_input)= keys (%input);
my(@values_input) = values (%input);
$values_input[0] =~ tr/a-z/A-Z/; # capitalizing.
my(@string2)= split(//,$values_input[1]);
if (($#string1 == -1) || ($#string2 == -1)){
print "\n One of the string is empty O.K. ? \n";
}
my($larger)= &max($#string1, $#string2);
my($id_counter, $gap_counter, $non_equal_counter,$percent_homol,)=0;
for ($i = 0; $i<=$larger; $i++){
if (($string1[$i] eq '.')|| ($string2[$i] eq '.')){
$gap_counter+=1;
}elsif ($string1[$i] eq $string2[$i]){
$id_counter +=1;
my($sum) = ($id_counter + $gap_counter + $non_equal_counter);
if ($sum != ($larger+1)){
print "\n There is something wrong in getting homology in get_pair_homol \n";
&caller_info;
}else{
$percent_homol=($id_counter/$sum)*100;
}
return ($percent_homol);
}
#________________________________________________________________________
# Title : file_size
sub file_size { my($infile)=$_[0];
if ( $size=(-s "$infile")){ return $size; }
}
#________________________________________________________________________
# Title : seq_comp_percent2
# Usage : @outarray = &seq_comp_percent2(@any_input_string_array);
# Function : get string seq COMPOSITION identities(a to z). gets array
# of strings and outs array of % numbers
# Example :
# Warning :
# Keywords :
# Returns :
# Argument :
# Category :
# Version : 1.0
#--------------------------------------------------------------------
sub seq_comp_percent2{ # simple and basic seq. id. eg. ABC on ABCABC is 50 % identical.
my(@input)=@_;
my(@array_of_ids2, $id2, @char1, @char2);
&array_chk(sort @input);
my($longest_str_size) = &get_long_str_size (@input), "\n";
my($shortest_str_size) = &get_short_str_size(@input), "\n";
print $cls;
}
#________________________________________________________________________
# Title : seq_comp_percent1
# Usage : @outarray = &seq_comp_percent1(@any_input_string_array);
# Function : get string seq identities(a to z). gets array of strings and outs array of % numbers
# Example :
# Warning :
# Keywords :
# Options :
# Returns : one ref. of an array
# Argument : one ref. of an array
# Category :
# Version :
#--------------------------------------------------------------------
sub seq_comp_percent1{ # this is affected by seq. length
my(@input)=@{$_[0]};
my(@array_of_ids1, $id1, @char1, @char2);
&array_chk(\@input);
@input = sort (@input);
$longest_str_size = &get_long_str_size (@input), "\n";
last;
}
}
}
$identity = $sum_of_same*2/(&sum_array(@num_char1,@num_char2))*100;
# print "percent iden = ", $identity, "\n";
}
#________________________________________________________________________
# Title : get_id_among_2_2
# Usage : $id = &get_id_among_2(*charcount1, *charcount2) <- hashes
# Function : gets the % id of any two sequences, returns in 100.0% format.
}
$seq1=&sum_array(@num_char1);
$seq2=&sum_array(@num_char2);
$longer_seq = &max($seq1, $seq2);
$identity = $sum_of_same/$longer_seq*100;
#print "percent iden = ", $identity, "\n";
}
#________________________________________________________________________
# Title : array_average
# Usage : $output = &array_average(\@any_array);
$range_stop, @files_NOT_processed);
my $source_db_fasta=$ENV{'NRDB_FASTA'}; ## general default
my $evalue_thresh=0.001; # default
my $score_thresh=70; # default
my $range_thresh=10;
my $percent_id_thresh=0.95;
print "\n# (i) Running sub of: make_intermediate_sequence_library\n";
if($vars{'FASTA_DB'}=~/\S+/){ $source_db_fasta=$vars{'FASTA_DB'} }
if($vars{'MSP_DIR'}=~/\S+/){ $msp_seq_file_dir=$vars{'MSP_DIR'} }
if($vars{'p'}=~/\S+/){ $pdbg_file=$vars{'p'}; print "\n# (i) $vars{'p'} is given \n"; } ## PDBG file input
for($j=0; $j< @pdbd_seqs; $j++){
$pdbd_seq=$pdbd_seqs[$j];
$pdbd_seq_long="pdb\_$pdbd_seqs[$j]";
my (@msp_content, $evalue, $sub_dir, $percentage_id, $range_length);
if($pdbd_seq=~/^ *$/){ next; }
$msp_file="$pdbd_seq\.msp";
$msp_file_gz="$pdbd_seq\.msp\.gz";
$msp_file_long="pdb\_$pdbd_seq\.msp"; ## this is to handle Sarah's pdb_ prefixed pdbd files
#_______________________________________________________________________________________
my ($identical_one_added, $interm_seq);
for($k=0; $k< @msp_content; $k++){ ## NEW MSP format
if($msp_content[$k]=~/^ *(\S+) +(\S+) +(\S+) +\d+ +\d+ +[pdb_]*$pdbd_seq[_\d+\-\d+]* +(\d+) +(\d+) +(\S+)/){ # [pdb_]* is for Sarah's pdb_ prefix
#if($pdbd_seq eq $6){ next } ## this is to exclude the same seq match
$evalue=$2; $percentage_id=$3;
$range_length=$5-$4; $score =$1; $interm_seq=$6; $range_start=$4, $range_stop=$5;
if($interm_seq=~/(\S+)_\d+\-\d+/){ $interm_seq=$1; }
if($evalue < $evalue_thresh and $range_length > $range_thresh and $score > $score_thresh){
if($percentage_id <= $percent_id_thresh){ ## to keep one pdb seq ($percentage_id=1)
unless($interm_seq=~/^d\d\S/){ # to remove entries like: d1abc_10-20_d2acb__ (two pdb seqs)
$interm_hash{$superfamily} .=" $interm_seq\_$range_start\-$range_stop\_$pdbd_seq";
}
}elsif($percentage_id ==1 and $identical_one_added < 1){ ## this is to prevent more than 1 100% id seq
$interm_hash{$superfamily} .=" $interm_seq\_$range_start\-$range_stop\_$pdbd_seq";
$identical_one_added++;
}
}
}elsif($msp_content[$k]=~/^ *(\d+) +(\S+) +\d+ +\d+ +$pdbd_seq +(\d+) +(\d+) +(\S+)/){
view all matches for this distribution
view release on metacpan or search on metacpan
ex/example.pl view on Meta::CPAN
print $timeframe;
print "\n";
# 86400
# JSON arrays
# Let's say we want the feerate_percentiles from getblockstats
# https://developer.bitcoin.org/reference/rpc/getblockstats.html
#{
# "avgfee": 8967,
# "avgfeerate": 28,
# "feerate_percentiles": [1,1,3,62,65],
# "height": 584240,
# "maxfee": 850011
#}
$bstats = $btc->getblockstats(584240);
@fps = @{ $bstats->{feerate_percentiles} };
foreach $fr (@fps) {
print $fr;
print "\n";
}
# 1
view all matches for this distribution
view release on metacpan or search on metacpan
t/sysinfos/ProxySG-4006060000--20090307-165730UTC.sysinfo view on Meta::CPAN
Stat: CPU Utilization
Current State : OK
Last Transition : Fri, 06 Mar 2009 19:23:14 UTC
Current Value : 1
Unit of Measurement : percent
Warning Threshold : 80
Warning Interval : 120
Critical Threshold : 95
Critical Interval : 120
Notification Method : log
Stat: Memory Utilization
Current State : OK
Last Transition : Fri, 06 Mar 2009 19:23:14 UTC
Current Value : 31
Unit of Measurement : percent
Warning Threshold : 90
Warning Interval : 120
Critical Threshold : 95
Critical Interval : 120
Notification Method : log
Stat: Interface 0:0 Utilization
Current State : OK
Last Transition : Fri, 06 Mar 2009 19:23:14 UTC
Current Value : 0
Unit of Measurement : percent
Warning Threshold : 60
Warning Interval : 120
Critical Threshold : 90
Critical Interval : 120
Notification Method : log
Stat: Interface 0:1 Utilization
Current State : OK
Last Transition : Fri, 06 Mar 2009 19:23:14 UTC
Current Value : 0
Unit of Measurement : percent
Warning Threshold : 60
Warning Interval : 120
Critical Threshold : 90
Critical Interval : 120
Notification Method : log
t/sysinfos/ProxySG-4006060000--20090307-165730UTC.sysinfo view on Meta::CPAN
syslogMask: 243
nextClientId: 1
activeStreams: 0
logIp: 0.0.0.0
cache blocks: 45001
memory usage: 0 percent
cpu 0 usage: 82 percent
Worker counts:
MMS client: 0
MMS server: 0
HTTP client: 0
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Book/Collate/Report.pm view on Meta::CPAN
}
=head2 _generate_fry_stats
Gives a percentage of Fry list words used against the total unique words used.
=cut
sub _generate_fry_stats {
my $self = shift;
view all matches for this distribution
view release on metacpan or search on metacpan
src/boost/test/floating_point_comparison.hpp view on Meta::CPAN
// ************************************************************************** //
// ************** tolerance presentation types ************** //
// ************************************************************************** //
template<typename FPT>
struct percent_tolerance_t {
explicit percent_tolerance_t( FPT v ) : m_value( v ) {}
FPT m_value;
};
//____________________________________________________________________________//
template<typename Out,typename FPT>
Out& operator<<( Out& out, percent_tolerance_t<FPT> t )
{
return out << t.m_value;
}
//____________________________________________________________________________//
template<typename FPT>
inline percent_tolerance_t<FPT>
percent_tolerance( FPT v )
{
return percent_tolerance_t<FPT>( v );
}
//____________________________________________________________________________//
template<typename FPT>
src/boost/test/floating_point_comparison.hpp view on Meta::CPAN
// Public typedefs
typedef bool result_type;
// Constructor
template<typename ToleranceBaseType>
explicit close_at_tolerance( percent_tolerance_t<ToleranceBaseType> tolerance,
floating_point_comparison_type fpc_type = FPC_STRONG )
: p_fraction_tolerance( tt_detail::fpt_abs( static_cast<FPT>(0.01)*tolerance.m_value ) )
, p_strong_or_weak( fpc_type == FPC_STRONG )
, m_report_modifier( 100. )
{}
src/boost/test/floating_point_comparison.hpp view on Meta::CPAN
// Public typedefs
typedef bool result_type;
template<typename FPT1, typename FPT2, typename ToleranceBaseType>
predicate_result
operator()( FPT1 left, FPT2 right, percent_tolerance_t<ToleranceBaseType> tolerance,
floating_point_comparison_type fpc_type = FPC_STRONG ) const
{
// deduce "better" type from types of arguments being compared
// if one type is floating and the second integral we use floating type and
// value of integral type is promoted to the floating. The same for float and double
view all matches for this distribution
view release on metacpan or search on metacpan
include/boost/test/floating_point_comparison.hpp view on Meta::CPAN
public:
// Public typedefs
typedef bool result_type;
// Constructor
explicit close_at_tolerance( PersentType percentage_tolerance, floating_point_comparison_type fpc_type = FPC_STRONG )
: p_fraction_tolerance( static_cast<FPT>(0.01)*percentage_tolerance ), p_strong_or_weak( fpc_type == FPC_STRONG ) {}
bool operator()( FPT left, FPT right ) const
{
FPT diff = tt_detail::fpt_abs( left - right );
FPT d1 = tt_detail::safe_fpt_division( diff, tt_detail::fpt_abs( right ) );
include/boost/test/floating_point_comparison.hpp view on Meta::CPAN
// Public typedefs
typedef bool result_type;
template<typename FPT, typename PersentType>
bool
operator()( FPT left, FPT right, PersentType percentage_tolerance, floating_point_comparison_type fpc_type = FPC_STRONG )
{
close_at_tolerance<FPT,PersentType> pred( percentage_tolerance, fpc_type );
return pred( left, right );
}
};
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Bot/Backbone/Service/Fact/Keyword.pm view on Meta::CPAN
alice> !forget_keyword bot
=head1 DESCRIPTION
Allows members of the chat to establish a set of keywords that the bot can
respond to a configurable percentage of the time. Each keyword can have more
than one response associated with it, in which case, a response is chosen at random.
=head1 DISPATCHER
=head2 !keyword
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Bot/BasicBot/Pluggable/Module/Nickometer.pm view on Meta::CPAN
return unless $body =~ /^\s*(?:lame|nick)-?o-?meter(?: for)? (\S+)/i;
my $term = $1; $term = $who if (lc($term) eq 'me');
my $percentage = percentage($term);
if ($percentage =~ /NaN/) {
$percentage = "off the scale";
} else {
# $percentage = sprintf("%0.4f", $percentage);
$percentage =~ s/\.0+$//;
$percentage .= '%';
}
return "'$term' is $percentage lame, $who";
}
sub help {
return "Commands: 'nickometer <nick>'";
}
sub percentage {
local $_ = shift;
my $score = 0;
# Deal with special cases (precede with \ to prevent de-k3wlt0k)
lib/Bot/BasicBot/Pluggable/Module/Nickometer.pm view on Meta::CPAN
my $remains_length = length($remains);
$score += (50 * $remains_length + slow_pow(9, $remains_length)) if $remains;
# Use an appropriate function to map [0, +inf) to [0, 100)
my $percentage = 100 *
(1 + tanh(($score-400)/400)) *
(1 - 1/(1+$score/5)) / 2;
my $digits = 2 * (2 - &round_up(log(100 - $percentage) / log(10)));
return sprintf "%.${digits}f", $percentage;
}
sub case_shifts ($) {
# This is a neat trick suggested by freeside. Thanks freeside!
view all matches for this distribution
view release on metacpan or search on metacpan
root/js/jquery-ui-1.7.2.custom.min.js view on Meta::CPAN
* http://docs.jquery.com/UI/Effects/Scale
*
* Depends:
* effects.core.js
*/
(function(a){a.effects.puff=function(b){return this.queue(function(){var f=a(this);var c=a.extend(true,{},b.options);var h=a.effects.setMode(f,b.options.mode||"hide");var g=parseInt(b.options.percent,10)||150;c.fade=true;var e={height:f.height(),widt...
* jQuery UI Effects Slide 1.7.2
*
* Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about)
* Dual licensed under the MIT (MIT-LICENSE.txt)
* and GPL (GPL-LICENSE.txt) licenses.
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Bot/BasicBot/Pluggable/Module/ReviewBoard.pm view on Meta::CPAN
* user_rb_url - Review Board URL
* user_field_not_set - This will replace the value when a field doesn't have a value in RB
* user_input_regexp - The regexp that messages will be tested against, must include at least one named closure called "rb" that match the RB number.
%RB_URL% will be replaced by the value from user_rb_url.
Default: rb (?:\#|\s)? (?<rb>\d+) | %RB_URL%/r/(?<rb>\d+)
* user_output_message - The formatted output message. Words between two percent signs (e.g. %BRANCH%) will replaced with the data from RB. The following fields are available:
RB_URL ID SUBMITTER GROUPS BRANCH BUGS_CLOSED SUMMARY TIME_ADDED LAST_UPDATED REPOSITORY DESCRIPTION PUBLIC PEOPLE TESTING_DONE.};
}
sub _get_rb_data {
my ($self, $rb) = @_;
lib/Bot/BasicBot/Pluggable/Module/ReviewBoard.pm view on Meta::CPAN
This will replace the value when a field doesn't have a value in RB.
=item user_output_message
The formatted output message.
Tags between two percent signs (e.g. %BRANCH%) will replaced with
the data from RB. The following tags are available:
=over
=item RB_URL
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Bot/BasicBot/Pluggable/Module/Maths.pm view on Meta::CPAN
$loc =~ s/\bdiv(ided by)? /\/ /g;
$loc =~ s/\bover /\/ /g;
$loc =~ s/\bsquared/\*\*2 /g;
$loc =~ s/\bcubed/\*\*3 /g;
$loc =~ s/\bto\s+(\d+)(r?st|nd|rd|th)?( power)?/\*\*$1 /ig;
$loc =~ s/\bpercent of/*0.01*/ig;
$loc =~ s/\bpercent/*0.01/ig;
$loc =~ s/\% of\b/*0.01*/g;
$loc =~ s/\%/*0.01/g;
$loc =~ s/\bsquare root of (\d+)/$1 ** 0.5 /ig;
$loc =~ s/\bcubed? root of (\d+)/$1 **(1.0\/3.0) /ig;
$loc =~ s/ of / * /;
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Bot/BasicBot/Pluggable/Module/WoWPVP.pm view on Meta::CPAN
$text = "HK/DK " . $hash{lhk} . "/" . $hash{ldk};
$text .= " rating "
. $hash{rating}
. " (Progression"
. chr(3) . "9 "
. $hash{percent} . "%"
. chr(3) . "0) ";
$self->tell( $channel, $text );
}
view all matches for this distribution
view release on metacpan or search on metacpan
Boulder/Blast.pm view on Meta::CPAN
The significance of the hit. If there are multiple HSPs in the hit,
this will be the most significant (smallest) value.
=item Identity
The percent identity of the hit. If there are multiple HSPs, this
will be the one with the highest percent identity.
=item Expect
The expectation value for the hit. If there are multiple HSPs, this
will be the lowest expectation value in the set.
Boulder/Blast.pm view on Meta::CPAN
This output was generated by the I<quickblast.pl> program, which is
located in the F<eg/> subdirectory of the I<Boulder> distribution
directory. It is a typical I<blastn> (nucleotide->nucleotide) run;
however long lines (usually DNA sequences) have been truncated. Also
note that per the Boulder protocol, the percent sign (%) is escaped in
the usual way. It will be unescaped when reading the stream
back in.
Blast_run_date=Fri Nov 6 14:40:41 1998
Blast_db_date=2:40 PM EST Nov 6, 1998
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Box/Calc.pm view on Meta::CPAN
return \@boxes;
}
=head1 TODO
There are some additional optimizations that could be done to speed things up a bit. We might also be able to get a better fill percentage (less void space), although that's not really the intent of Box::Calc.
=head1 PREREQS
L<Moose>
L<Ouch>
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Brackup/Backup.pm view on Meta::CPAN
$cur_file = undef;
};
my $show_status = sub {
# use either size of files in normal case, or if we pre-calculated
# the size-to-upload (by looking in inventory, then we'll show the
# more accurate percentage)
my $percdone = 100 * ($n_kb_up_need ?
($n_kb_up / $n_kb_up_need) :
($n_kb_done / $n_kb));
my $mb_remain = ($n_kb_up_need ?
($n_kb_up_need - $n_kb_up) :
lib/Brackup/Backup.pm view on Meta::CPAN
chomp $line;
print $line, "\n";
}
sub report_progress {
my ($self, $percent, $message) = @_;
if ($self->{zenityprogress}) {
if (defined($message) && length($message) > 100) {
$message = substr($message, 0, 100)."...";
}
print STDOUT "#", $message, "\n" if defined $message;
print STDOUT $percent, "\n" if defined $percent;
}
}
1;
view all matches for this distribution
view release on metacpan or search on metacpan
"Legal Entity" shall mean the union of the acting entity and all
other entities that control, are controlled by, or are under common
control with that entity. For the purposes of this definition,
"control" means (i) the power, direct or indirect, to cause the
direction or management of such entity, whether by contract or
otherwise, or (ii) ownership of fifty percent (50%) or more of the
outstanding shares, or (iii) beneficial ownership of such entity.
"You" (or "Your") shall mean an individual or Legal Entity
exercising permissions granted by this License.
view all matches for this distribution
view release on metacpan or search on metacpan
ocip_html/OCISchemaGroup.xsd.html view on Meta::CPAN
User: "User Id"
"Is Local" is set to "yes" if the event is processed on the server
who received the request, "no" otherwise meaning that the event is
processed on another server.
"Completion %" provides an estimate of the completion of the event.
A percentage is given, the current number of completed expanded event,
and the total number of expanded event.
"Pushed/ Same Hash/ Not Pushed" gives the total number of files that
were pushed, not pushed because of same hash, and not pushed when
processing the event.
"LoginId" is the user or admin id who triggered the event.
view all matches for this distribution
view release on metacpan or search on metacpan
c-lib/s-bsdiff.c view on Meta::CPAN
s_bsdipa_off_t st, s_bsdipa_off_t en, s_bsdipa_off_t *posp);
static inline void a_bsdiff_xout(s_bsdipa_off_t x, uint8_t *bp);
/* Later imported original BSDiff suffix sort by Colin Percival; at EOF.
* (It was replaced with libdivsufsort in the FreeBSD codebase to which he pointed me due to "existing fixes",
* because of performance improvements: 10-15 percent for large binaries (megabytes); for smaller files his is better.)
* Except for types and names i did not adapt syntax to my style for those. */
static void a_bsdiff_split(s_bsdipa_off_t *I, s_bsdipa_off_t *V, s_bsdipa_off_t start, s_bsdipa_off_t len,
s_bsdipa_off_t h);
static int a_bsdiff_qsufsort(s_bsdipa_off_t *I, uint8_t const *aftdat, s_bsdipa_off_t aftlen,
struct s_bsdipa_diff_ctx *dcp);
view all matches for this distribution
view release on metacpan or search on metacpan
"Legal Entity" shall mean the union of the acting entity and all
other entities that control, are controlled by, or are under common
control with that entity. For the purposes of this definition,
"control" means (i) the power, direct or indirect, to cause the
direction or management of such entity, whether by contract or
otherwise, or (ii) ownership of fifty percent (50%) or more of the
outstanding shares, or (iii) beneficial ownership of such entity.
"You" (or "Your") shall mean an individual or Legal Entity
exercising permissions granted by this License.
view all matches for this distribution
view release on metacpan or search on metacpan
"Legal Entity" shall mean the union of the acting entity and all
other entities that control, are controlled by, or are under common
control with that entity. For the purposes of this definition,
"control" means (i) the power, direct or indirect, to cause the
direction or management of such entity, whether by contract or
otherwise, or (ii) ownership of fifty percent (50%) or more of the
outstanding shares, or (iii) beneficial ownership of such entity.
"You" (or "Your") shall mean an individual or Legal Entity
exercising permissions granted by this License.
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Business/AU/Ledger/Database/Payment.pm view on Meta::CPAN
sub save_payment_record
{
my($self, $context, $payment) = @_;
my($table_name) = 'payments';
my(@field) = (qw/category_code gst_code month payment_method tx_detail amount comment gst_amount petty_cash_in petty_cash_out private_use_amount private_use_percent reference timestamp/);
my($data) = {};
my(%id) =
(
category_code => 1,
gst_code => 1,
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Business/CPI/Cart/Moip.pm view on Meta::CPAN
valor_fixo => 5.50,
},
{
razao => 'Motivo da divisao',
login_moip => 'loginmoip2',
valor_percentual => 10,
}
]);
=cut
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Business/CPI/Gateway/Test.pm view on Meta::CPAN
foreach my $receiver (@{ $cart->_receivers }) {
push @hidden_inputs,
(
"receiver${i}_id" => $receiver->account->gateway_id,
"receiver${i}_percent" => sprintf("%.2f", 0+$receiver->percent_amount),
);
$i++;
}
return @hidden_inputs;
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Business/CyberSource/Response/Role/DCC.pm view on Meta::CPAN
required => 1,
is => 'ro',
isa => 'Int',
);
has margin_rate_percentage => (
required => 1,
is => 'ro',
isa => 'Num',
);
lib/Business/CyberSource/Response/Role/DCC.pm view on Meta::CPAN
=head2 dcc_supported
=head2 valid_hours
=head2 margin_rate_percentage
=head1 BUGS
Please report any bugs or feature requests on the bugtracker website
https://github.com/hostgator/business-cybersource/issues
view all matches for this distribution
view release on metacpan or search on metacpan
examples/mojo-webapp/public/css/bootstrap-theme.css.map view on Meta::CPAN
{"version":3,"file":"bootstrap-theme.css","sources":["less/theme.less","less/mixins/vendor-prefixes.less","bootstrap-theme.css","less/mixins/gradients.less","less/mixins/reset-filter.less"],"names":[],"mappings":"AAeA;;;;;;EAME,0CAAA;EC+CA,6FAAA;EACQ...
view all matches for this distribution