view release on metacpan or search on metacpan
lib/Audio/NoiseGen.pm view on Meta::CPAN
split
sequence
note
rest
segment
formula
hardlimit
amp
oneshot
lowpass
highpass
lib/Audio/NoiseGen.pm view on Meta::CPAN
$last_sample = $cur_gen->();
return $last_sample || 0;
}
}
=head2 formula( formula => sub { $_*(42&$_>>10) } )
Plays a formula. Takes 'formula', 'bits', and 'sample_rate'. 'bits' defaults to 8, 'sample_rate' defaults to 8000.
Formula uses C<< $_ >> instead of 't', but is otherwise similar to what is described at L<http://countercomplex.blogspot.com/2011/10/algorithmic-symphonies-from-one-line-of.html>.
=cut
sub formula {
my %params = generalize(
bits => 8,
sample_rate => 8000,
@_
);
my $formula = $params{formula};
my $formula_increment = $params{sample_rate}->() / $sample_rate;
my $max = 2 ** $params{bits}->();
my $t = 0;
return sub {
$t += $formula_increment;
local $_ = int $t;
return (((
$formula->(int $t)
) % $max - ($max/2))/($max/2))
}
}
# Return RC low-pass filter output samples, given input samples,
lib/Audio/NoiseGen.pm view on Meta::CPAN
my $gen = shift;
if(!ref $gen) {
print STDERR "segement '$gen'\n";
$gen = segment($gen);
# } elsif(ref $gen eq 'CODE') {
# $gen = formula($gen);
}
my $self = {
gen => $gen,
};
bless $self, $class;
view all matches for this distribution
view release on metacpan or search on metacpan
mpg123/mpg123.c view on Meta::CPAN
if(param.verbose)
print_stat(rd,fr,frameNum,xfermem_get_usedspace(buffermem),&ai);
if (!param.quiet) {
/*
* This formula seems to work at least for
* MPEG 1.0/2.0 layer 3 streams.
*/
int secs = get_songlen(rd,fr,frameNum);
fprintf(stderr,"\n[%d:%02d] Decoding of %s finished.\n", secs / 60,
secs % 60, filename);
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Authen/PluggableCaptcha/Tutorial.pm view on Meta::CPAN
For example:
key= md5( $site_secret , $time , $page_name , $session_id ) + ':' + $session
key= 'xxxxxxxxxxxxxxxxxx:10000001'
If we know the site_secret under that formula, we always have every components of the item at our disposal -- and can validate the key for integrity
The default KeyManager class uses a site_secret to create the key.
=head3 Also, from the example in the Tutorial, it isn't quite clear if you first have to generate a new CAPTCHA, just to get its key, and then use that key to construct an existing CAPTCHA to create the JPEG. This isn't the case, is it? I could call ...
view all matches for this distribution
view release on metacpan or search on metacpan
ramblings/remark.js view on Meta::CPAN
require=function(e,t,n){function i(n,s){if(!t[n]){if(!e[n]){var o=typeof require=="function"&&require;if(!s&&o)return o(n,!0);if(r)return r(n,!0);throw new Error("Cannot find module '"+n+"'")}var u=t[n]={exports:{}};e[n][0].call(u.exports,function(t)...
this.QUOTE_STRING_MODE={className:"string",begin:'"',end:'"',illegal:"\\n",contains:[this.BACKSLASH_ESCAPE]};this.PHRASAL_WORDS_MODE={begin:/\b(a|an|the|are|I|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such)...
SUBST.contains=EXPRESSIONS;return{aliases:["coffee","cson","iced"],keywords:KEYWORDS,contains:EXPRESSIONS.concat([{className:"comment",begin:"###",end:"###"},hljs.HASH_COMMENT_MODE,{className:"function",begin:"("+JS_IDENT_RE+"\\s*=\\s*)?(\\(.*\\))?\\...
}()},{}],8:[function(require,module,exports){exports.addClass=function(element,className){element.className=exports.getClasses(element).concat([className]).join(" ")};exports.removeClass=function(element,className){element.className=exports.getClasse...
events.on("slideChanged",updateHash);navigateByHash()}function navigateByHash(){var slideNoOrName=(dom.getLocationHash()||"").substr(1);events.emit("gotoSlide",slideNoOrName)}function updateHash(slideNoOrName){dom.setLocationHash("#"+slideNoOrName)}}...
view all matches for this distribution
view release on metacpan or search on metacpan
zlib/adler32.c view on Meta::CPAN
{
unsigned long sum1;
unsigned long sum2;
unsigned rem;
/* the derivation of this formula is left as an exercise for the reader */
rem = (unsigned)(len2 % BASE);
sum1 = adler1 & 0xffff;
sum2 = rem * sum1;
MOD(sum2);
sum1 += (adler2 & 0xffff) + BASE - 1;
view all matches for this distribution
view release on metacpan or search on metacpan
lib/BalanceOfPower/Role/Shopper.pm view on Meta::CPAN
my $self = shift;
my $y = shift;
my $type = shift;
my $nation = shift;
#Price formula is MaxPrice - (( MaxPrice - MinPrice) / MaxValue) * Value
#MaxPrice and MinPrice are constant
my $min_price = PRICE_RANGES->{$type}->[0];
my $max_price = PRICE_RANGES->{$type}->[1];
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Baseball/Sabermetrics.pm view on Meta::CPAN
$league->define(
rc => 'ab * obp',
babip => '(h_allowed - hr_allowed) / (p_pa - h_allowed - p_so - p_bb - hr_allowed',
# what started with '$' will be reserved.
# Players have team and league predefined, and team has league.
formula1 => 'hr / $_->team->hr';
formula2 => 'hr / $_->league->hr';
complex => sub {
print "You can write a sub directly\n";
$_->slg - $_->ba;
},
...
);
# Some formulas can be applied to players, teams, and league, depend on what
# columns are used in the formula. For example, ab and obp are defined for
# players, teams, and league, so that rc is available for all of them.
# top 5 obp of teams
$_->print qw/ team name ba obp slg isop / for $league->top('teams', 5, 'obp');
lib/Baseball/Sabermetrics.pm view on Meta::CPAN
$league->{Yankees}->report_pitchers qw/ name ip p_so p_bb whip go_ab /;
$league->{Yankees}->report_batters qw/ name ba obp slg isop /;
$league->report_teams qw/ name win lose era obp /;
# show all available formula
print join ' ', $league->formula_list;
=head1 Data Structure
Baseball::Sabermetrics is aimed for providing a base class of your interested teams (a league, for example). You'll need to provide a data retriever to pull data out. The following example shows how you have to fill data into this structure.
view all matches for this distribution
view release on metacpan or search on metacpan
share/SpamAssassin/easy_ham/00271.b67b5b37ce874d5ccea3391922f14506 view on Meta::CPAN
to another. This is why, under international
contracts, it is necessary to specify to which
laws one is referring (French law, American &c.).
The authors only found three public licences
which were correctly formulated on this point:
QPL, IBM Public Licence and the Mozilla Public
Licence).
view all matches for this distribution
view release on metacpan or search on metacpan
lib/BigIP/iControl.pm view on Meta::CPAN
=head3 get_pool_statistics_stringified ($pool)
my %stats = $ic->get_pool_statistics_stringified($pool);
print "Pool $pool bytes in: $stats{stat}{STATISTIC_SERVER_SIDE_BYTES_OUT}";
Returns a hash containing all pool statistics for the specified pool in a delicious, easily digestable and improved formula.
=cut
sub get_pool_statistics_stringified {
my ($self, $pool)= @_;
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Bio/DB/BigBed.pm view on Meta::CPAN
In addition, the bin objects add the following convenience methods:
$bin->count() Same as $bin->score->{validCount}
$bin->minVal() Same as $bin->score->{minVal}
$bin->maxVal() Same as $bin->score->{maxVal}
$bin->mean() The mean of values in the bin (from the formula above)
$bin->variance() The variance of values in the bin (ditto)
$bin->stdev() The standard deviation of values in the bin (ditto)
From these values one can determine the mean, variance and standard
deviation across one or more genomic intervals. The formulas are as
follows:
sub mean {
my ($sumData,$validCount) = @_;
return $sumData/$validCount;
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Bio/CUA/CUB/Calculator.pm view on Meta::CPAN
{
my ($self, $seq) = @_;
$self->_xai($seq, 'CAI');
}
# the real calculator of tAI or CAI as both have the same formula
sub _xai
{
my ($self, $seq, $type) = @_;
my $name;
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Bio/Cellucidate.pm view on Meta::CPAN
A Model has one or many simulation runs and a simulation run belongs to
a model.
=item L<Bio::Cellucidate::OdeResult>
Represents the set of ODE formulas generated when running a simulation in ODE-mode.
The results can be used directly in MATLAB.
=item L<Bio::Cellucidate::Plot>
A plot contains a single time series and a number of data series representing the
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Bio/GeneDesign.pm view on Meta::CPAN
arguments; they are 50mm (.05) and 100 pm (.0000001) respectively.
You can pass either a string variable, a Bio::Seq object, or a Bio::SeqFeatureI
object to be analyzed with the -sequence flag.
There are four different formulae to choose from. If you wish to use the nearest
neighbor method, use the -nearest_neighbor flag. Otherwise the appropriate
formula will be determined by the length of your -sequence argument.
For sequences under 14 base pairs:
Tm = (4 * #GC) + (2 * #AT).
For sequences between 14 and 50 base pairs:
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Bio/Graphics/Panel.pm view on Meta::CPAN
responsible for allocating sufficient -pad_left or -pad_right room for
the labels to appear. The necessary width is the number of characters
in the longest key times the font width (gdMediumBoldFont by default)
plus 3 pixels of internal padding. The simplest way to calculate this
is to iterate over the possible track labels, find the largest one,
and then to compute its width using the formula:
$width = gdMediumBoldFont->width * length($longest_key) +3;
In order to obtain scalable vector graphics (SVG) output, you should
pass new() the -image_class=E<gt>'GD::SVG' parameter. This will cause
view all matches for this distribution
view release on metacpan or search on metacpan
scripts/Data/psi-mi.obo view on Meta::CPAN
subset: Drugable
is_a: MI:0300 ! alias type
[Term]
id: MI:2008
name: chemical formula
def: "Chemical formula describing atomic or elemental composition" [PMID:14755292]
subset: Drugable
is_a: MI:2086 ! physicochemical attribute name
[Term]
id: MI:2009
scripts/Data/psi-mi.obo view on Meta::CPAN
is_a: MI:0353 ! cross-reference type
[Term]
id: MI:2025
name: molecular weight
def: "Molecular weight in g/mol, determined from molecular formula or sequence." [PMID:14755292]
subset: Drugable
is_a: MI:0640 ! parameter type
[Term]
id: MI:2026
scripts/Data/psi-mi.obo view on Meta::CPAN
is_a: MI:2054 ! bioactive entity reference
[Term]
id: MI:2155
name: average molecular weight
def: "Molecular weight in g/mol, determined from molecular formula or sequence." [PMID:14755292]
subset: Drugable
synonym: "avrg mol weight" EXACT PSI-MI-short []
is_a: MI:2025 ! molecular weight
[Term]
id: MI:2156
name: monoisotopic molecular weight
def: "Molecular weight in g/mol, determined from molecular formula or sequence." [PMID:14755292]
subset: Drugable
synonym: "monoisotopic mol wgt" EXACT PSI-MI-short []
is_a: MI:2025 ! molecular weight
[Term]
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Bio/KBase/CDMI/CDMI_APIImpl.pm view on Meta::CPAN
=item Description
Since we accumulate data relating to the co-occurrence (i.e., chromosomal
clustering) of genes in prokaryotic genomes, we can note which pairs of genes tend to co-occur.
From this data, one can compute the protein families that tend to co-occur (i.e., tend to
cluster on the chromosome). This allows one to formulate conjectures for unclustered pairs, based
on clustered pairs from the same protein_families.
=back
=cut
lib/Bio/KBase/CDMI/CDMI_APIImpl.pm view on Meta::CPAN
=item Description
A substem is composed of two components: a set of roles that are gathered to be annotated
simultaneously and a spreadsheet depicting the proteins within each genome that implement
the roles. The set of roles may correspond to a pathway, a complex, an inventory (say, "transporters")
or whatever other principle an annotator used to formulate the subsystem.
The subsystem spreadsheet is a list of "rows", each representing the subsytem in a specific genome.
Each row includes a variant code (indicating what version of the molecular machine exists in the
genome) and cells. Each cell is a 2-tuple:
view all matches for this distribution
view release on metacpan or search on metacpan
https://github.com/weizhongli/cdhit
If you --force installation, I will eventually try to install CD-HIT with brew:
https://brew.sh/
EOT
}
# TODO: fix this as CD-HIT formula currently fails on OS X Mojave
# This can be done with a --build-from-source option of brew
# expected members for
my $exp_clstr_file = file('test', 'cdHit.out.groups');
open my $in, '<', $exp_clstr_file;
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Bio/Phylo/EvolutionaryModels.pm view on Meta::CPAN
#Loop for sampling each tree
while ( scalar @sample < $options{sample_size} ) {
my @nodes;
#Compute the random tree age from the inverse CDF (different formulas for
#birth rate == death rate and otherwise)
my $tree_age;
#The uniform random variable
my $r = rand;
view all matches for this distribution
view release on metacpan or search on metacpan
CHANGELOG.md view on Meta::CPAN
## [v3.6.9](https://github.com/sanger-pathogens/Roary/tree/v3.6.9) (2016-09-22)
[Full Changelog](https://github.com/sanger-pathogens/Roary/compare/v3.6.8...v3.6.9)
**Implemented enhancements:**
- I have published a Roary homebrew formula [\#208](https://github.com/sanger-pathogens/Roary/issues/208)
- Getting Roary into Homebrew [\#152](https://github.com/sanger-pathogens/Roary/issues/152)
**Closed issues:**
- roary\_plots.py missing [\#277](https://github.com/sanger-pathogens/Roary/issues/277)
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Bio/Tools/CodonOptTable.pm view on Meta::CPAN
return 1;
}
# Function : Calculate the RSCU(Relative Synonymous Codons Uses).
# Note : The formula is used in the following references.
# http://www.pubmedcentral.nih.gov/articlerender.fcgi?tool=pubmed&pubmedid=3547335
sub _calculate_rscu {
my $self = shift;
lib/Bio/Tools/CodonOptTable.pm view on Meta::CPAN
}
return ( \@myCodons, \%rscu_max_table );
}
# Function : Calculate the RAC (Relative Adaptiveness of a Codon).
# Note : The formula is used in the following references.
# http://www.pubmedcentral.nih.gov/articlerender.fcgi?tool=pubmed&pubmedid=3547335
sub _calculate_rac {
my ( $self, $codons, $max_rscu ) = @_;
my ( $rac, @myCodons );
view all matches for this distribution
view release on metacpan or search on metacpan
Default is 'undef', which means gc-ratio is not related to sequence selection.
=head2 set_mt
Setting for the melting temperature. For now, Wallace formula is adopted for calculation.
You can give it a specific value, like
$gen->set_mt(30);
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Bio/Tools/ProteinogenicAA.pm view on Meta::CPAN
$info[7] eq 'X' ? $aa->is_hydrophobic(1) : $aa->is_hydrophobic(0);
$info[8] eq 'X' ? $aa->is_polar(1) : $aa->is_polar(0);
$aa->pH($info[9]);
$aa->van_der_waals_volume($info[10]);
$aa->codons($info[11]);
$aa->formula($info[12]);
$aa->monoisotopic_mass($info[13]);
$aa->avg_mass($info[14]);
push(@list, $aa);
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Bio/ViennaNGS/Expression.pm view on Meta::CPAN
my ($self,$sample,$rl) = @_;
my ($TPM,$T,$totalTPM) = (0)x3;
my ($i,$meanTPM);
# iterate through $self->data[$i] twice:
# 1. for computing T (denominator in TPM formula)
foreach $i (keys %{${$self->data}[$sample]}){
my $count = ${${$self->data}[$sample]}{$i}{count};
my $length = ${${$self->data}[$sample]}{$i}{length};
#print "count: $count\nlength: $length\n";
$T += $count * $rl / $length;
lib/Bio/ViennaNGS/Expression.pm view on Meta::CPAN
my ($self,$sample,$rl) = @_;
my ($R,$T,$length,$count,$totalRPKM) = (0)x5;
my ($i,$meanRPKM);
# iterate through $self->data[$i] twice:
# 1. compute T (denominator in TPM formula) and total number of reads
foreach $i (keys %{${$self->data}[$sample]}){
$count = ${${$self->data}[$sample]}{$i}{count};
$length = ${${$self->data}[$sample]}{$i}{length};
#print "count: $count\nlength: $length\n";
$T += $count * $rl / $length;
view all matches for this distribution
view release on metacpan or search on metacpan
- round-tripping fuzzy locations (they will be stored according
to their Bio::Location::CoordinatePolicyI interpretation)
- Bio::Annotation::DBLink::optional_id
To understand the layout of the API and how you can interact with the
adaptors to formulate your own queries, here is what you should know
and read (i.e., read the PODs of all interfaces and modules named
below).
1) Bio::DB::BioDB acts as a factory of database adaptors, where a
database adaptor encapsulates an entire database, not a specific
4) A persistence adaptor will implement Bio::DB::PersistenceAdaptorI.
Apart from actually implementing all the persistence methods for
persistent objects, a persistence adaptor allows you to locate
objects in the database by key and by query. You can
find_by_primary_key(), find_by_unique_key(), find_by_association(),
and find_by_query(). The latter allows you to formulate object queries
as Bio::DB::Query::BioQuery objects and retrieve the matching objects.
5) The guiding principle for the redesign of the adaptors was to
separate business logic from schema logic. While business logic is
largely driven by the object model (hence, by the bioperl object
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Bio/Tools/Run/StandAloneBlast.pm view on Meta::CPAN
Blastpgp (including Psiblast)
-j is the maximum number of rounds (default 1; i.e., regular BLAST)
-h is the e-value threshold for including sequences in the
score matrix model (default 0.001)
-c is the "constant" used in the pseudocount formula specified in the paper (default 10)
-B Multiple alignment file for PSI-BLAST "jump start mode" Optional
-Q Output File for PSI-BLAST Matrix in ASCII [File Out] Optional
rpsblast
view all matches for this distribution
view release on metacpan or search on metacpan
Bio/SeqFeature/Primer.pm view on Meta::CPAN
: -oligo : set the oligo concentration on which to base the
calculation (default=0.00000025 molar).
Notes : Calculation of Tm as per Allawi et. al Biochemistry 1997
36:10581-10594. Also see documentation at
http://www.idtdna.com/Scitools/Scitools.aspx as they use this
formula and have a couple nice help pages. These Tm values will be
about are about 0.5-3 degrees off from those of the idtdna web tool.
I don't know why.
This was suggested by Barry Moore (thanks!). See the discussion on
the bioperl-l with the subject "Bio::SeqFeature::Primer Calculating
view all matches for this distribution
view release on metacpan or search on metacpan
and stores the result in "C<$set3>".
This can be written as "C<$set3 = ($set1 u $set2) \ ($set1 n $set2)>" in set
theory (the union of the two sets less their intersection).
When sets are implemented as bit vectors then the above formula is
equivalent to the exclusive-or between corresponding bits of the two
bit vectors (hence the name of this method).
Note that this method is also much more efficient than evaluating the
above formula explicitly since it uses a built-in machine language
instruction internally.
In-place calculation is also possible, i.e., "C<$set3>" may be identical
with "C<$set1>" or "C<$set2>" or both.
view all matches for this distribution
view release on metacpan or search on metacpan
src/boost/config/auto_link.hpp view on Meta::CPAN
Algorithm:
~~~~~~~~~~
Libraries for Borland and Microsoft compilers are automatically
selected here, the name of the lib is selected according to the following
formula:
BOOST_LIB_PREFIX
+ BOOST_LIB_NAME
+ "_"
+ BOOST_LIB_TOOLSET
view all matches for this distribution
view release on metacpan or search on metacpan
include/boost/config/auto_link.hpp view on Meta::CPAN
Algorithm:
~~~~~~~~~~
Libraries for Borland and Microsoft compilers are automatically
selected here, the name of the lib is selected according to the following
formula:
BOOST_LIB_PREFIX
+ BOOST_LIB_NAME
+ "_"
+ BOOST_LIB_TOOLSET
view all matches for this distribution