view release on metacpan or search on metacpan
share/PerlCritic/Critic/Document.pm view on Meta::CPAN
## Then use the instance just like a PPI::Document
=head1 DESCRIPTION
Perl::Critic does a lot of iterations over the PPI document tree via
the C<PPI::Document::find()> method. To save some time, this class
pre-caches a lot of the common C<find()> calls in a single traversal.
Then, on subsequent requests we return the cached data.
This is implemented as a facade, where method calls are handed to the
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Benchmark/Perl/Formance/Plugin/PerlStone2015/binarytrees.pm view on Meta::CPAN
my $long_lived_tree = bottom_up_tree($max_depth);
my $depth = $min_depth;
while ( $depth <= $max_depth ) {
my $iterations = 2 ** ($max_depth - $depth + $min_depth);
my $check = 0;
foreach my $i (1..$iterations) {
my $temp_tree = bottom_up_tree($depth);
$check += item_check($temp_tree);
$temp_tree = bottom_up_tree($depth);
$check += item_check($temp_tree);
}
#print $iterations * 2, "\t trees of depth $depth\t check: ", $check, "\n";
$depth += 2;
}
# print "long lived tree of depth $max_depth\t check: ",
# item_check($long_lived_tree), "\n";
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Benchmark/Perl/Formance/Plugin/Shootout/binarytrees.pm view on Meta::CPAN
my $long_lived_tree = bottom_up_tree($max_depth);
my $depth = $min_depth;
while ( $depth <= $max_depth ) {
my $iterations = 2 ** ($max_depth - $depth + $min_depth);
my $check = 0;
foreach my $i (1..$iterations) {
my $temp_tree = bottom_up_tree($depth);
$check += item_check($temp_tree);
$temp_tree = bottom_up_tree($depth);
$check += item_check($temp_tree);
}
#print $iterations * 2, "\t trees of depth $depth\t check: ", $check, "\n";
$depth += 2;
}
# print "long lived tree of depth $max_depth\t check: ",
# item_check($long_lived_tree), "\n";
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Benchmark/ProgressBar.pm view on Meta::CPAN
$n = $forn if defined $forn;
# A conservative warning to spot very silly tests.
# Don't assume that your benchmark is ok simply because
# you don't get this warning!
print " (warning: too few iterations for a reliable count)\n"
if $n < $Benchmark::Min_Count
|| ($t->real < 1 && $n < 1000)
|| $t->cpu_a < $Benchmark::Min_CPU;
$t;
}
view all matches for this distribution
view release on metacpan or search on metacpan
examples/serialize.pl view on Meta::CPAN
use Benchmark::Serialize::Library::ProtocolBuffers;
use Benchmark::Serialize::Library::ProtocolBuffers::XS;
use Benchmark::Serialize::Library::Data::Serializer;
my @benchmark = (); # package names of benchmarks to run
my $iterations = -1; # integer
my $structure = {
array => [ 'a' .. 'j' ],
hash => { 'a' .. 'z' },
string => 'x' x 200
};
examples/serialize.pl view on Meta::CPAN
Getopt::Long::GetOptions(
'b|benchmark=s@' => \@benchmark,
'deflate!' => \$Benchmark::Serialize::benchmark_deflate,
'inflate!' => \$Benchmark::Serialize::benchmark_inflate,
'roundtrip!' => \$Benchmark::Serialize::benchmark_roundtrip,
'i|iterations=i' => \$iterations,
'o|output=s' => \$Benchmark::Serialize::output,
'v|verbose!' => \$Benchmark::Serialize::verbose,
's|structure=s' => sub {
die "Structure option requires YAML.\n"
unless YAML->require;
examples/serialize.pl view on Meta::CPAN
Benchmark::Serialize::Library::ProtocolBuffers->register( ProtocolBuffers => ($protocolbuffers ? $protocolbuffers : $structure) );
}
@benchmark = ("all") unless @benchmark;
cmpthese($iterations, $structure, @benchmark);
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Bigtop/Docs/TentTut.pod view on Meta::CPAN
If you need more details consult C<Bigtop::Docs::TentRef> or
C<Bigtop::Docs::Syntax> (or even C<Bigtop::Keywords>).
Here, I will walk you through using tentmaker to generate a bigtop file.
Then, I will show how to use bigtop to turn that into a web app. Finally,
I will return to expand the example in addtional iterations of feature
additions. There are a couple of screen shots here. If you don't see the
pictures in line, look for them in the docs directory of the Bigtop
distribution and/or on the web at http://www.usegantry.org/images/tenttut.
The example app I will build here is a contact database. It will initially
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Bijection/XS.pm view on Meta::CPAN
Bijection::XS::inverse(Bijection::XS::biject($int));
}
});
Benchmark: timing 10000000 iterations of Bijection, XS...
Bijection: 8 wallclock secs ( 8.74 usr + 0.05 sys = 8.79 CPU) @ 1137656.43/s (n=10000000)
XS: 2 wallclock secs ( 2.48 usr + 0.01 sys = 2.49 CPU) @ 4016064.26/s (n=10000000)
=head1 AUTHOR
view all matches for this distribution
view release on metacpan or search on metacpan
lib/BingoX/Carbon.pm view on Meta::CPAN
return $self->error_handler("no bindings passed to format_conditions for type ($type)")
unless (@values);
$sql .= "$field " . uc($type) . ' ? AND ?';
push(@bindings, @values[0,1]);
} else { # LIST of conditions
splice (@valuelist, $x+1, 0, @$value); # appending will push to next iterations
}
} elsif ($value =~ /^\/(.+?)\/$/) { # regex
$sql .= "$field ~ ?";
push(@bindings, $1);
} elsif ($value =~ /^(\d+?)-(\d+?)$/) { # date or numeric range
view all matches for this distribution
view release on metacpan or search on metacpan
examples/full_example.pl view on Meta::CPAN
# There shouldn't be any simulation runs yet, but let's check
my $simulation_runs = Bio::Cellucidate::Model->simulation_runs($model->{id});
print "\nSimulation Runs for model:\n";
print Dumper $simulation_runs;
# Let's create a simulation run (2 iterations)!
my $simulation_run = Bio::Cellucidate::SimulationRun->create({ model_id => $model->{id}, num_iterations => 2 }); #, simulation_method => 'ODE' });
print "\nNewly created Simulation Run:\n";
print Dumper $simulation_run;
# Same pattern as import, poll and see when my run is complete...
while ($simulation_run->{state} ne 'succeeded') {
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Bio/Community/Tools/Rarefier.pm view on Meta::CPAN
# Normalize communities in a metacommunity by repeatedly taking 1,000 random members
my $rarefier = Bio::Community::Tools::Rarefier->new(
-metacommunity => $meta,
-sample_size => 1000,
-threshold => 0.001, # stop bootstrap iterations when threshold is reached
);
# Rarefied results, with decimal counts
my $average_community = $rarefier->get_avg_meta->next_community;
lib/Bio/Community/Tools/Rarefier.pm view on Meta::CPAN
# Alternatively, specify a number of repetitions
my $rarefier = Bio::Community::Tools::Rarefier->new(
-metacommunity => $meta,
-sample_size => 1000,
-num_repetitions => 0.001, # stop after this number of bootstrap iterations
);
# ... or assume an infinite number of repetitions
my $rarefier = Bio::Community::Tools::Rarefier->new(
-metacommunity => $meta,
lib/Bio/Community/Tools/Rarefier.pm view on Meta::CPAN
=head2 verbose
Function: Get or set verbose mode. In verbose mode, the current number of
iterations (and beta diversity if a threshold is used) is displayed.
Usage : $rarefier->verbose(1);
Args : 0 (default) or 1
Returns : 0 or 1
=cut
view all matches for this distribution
view release on metacpan or search on metacpan
}
# The callback routine used below for authentication must accept three arguments:
# the fetcher object, the realm for authentication, and the iteration
# we are on. A return of undef means that we should stop trying this connection (e.g. cancel button
# pressed, or x number of iterations tried), otherwise a two element array (not a reference to an array)
# should be returned with the username and password in that order.
# I assume if you've called autheniticate, it's because you've gotten a 401 error.
# Otherwise this does not make sense.
# There is also no caching of authentication done. I suggest the callback do this, so
# the user isn't asked 20 times for the same name and password.
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Bio/FastParsers/Blast/Xml.pm view on Meta::CPAN
extends 'Bio::FastParsers::Base';
use aliased 'Bio::FastParsers::Blast::Xml::BlastOutput';
# TODO: check behavior with single iterations, hits or hsps
# public attributes (some inherited)
lib/Bio/FastParsers/Blast/Xml.pm view on Meta::CPAN
# ...or equivalently
my $param = $bo->parameters;
say $param->expect; # 10
say $param->matrix; # BLOSUM62
# get the number of iterations (= queries)
say $bo->count_iterations; # 3
# loop through iterations (or queries), hits and hsps
# this is extremely fast because no data is moved around
for my $iter ($bo->all_iterations) {
say $iter->count_hits; # always available!
for my $hit ($iter->all_hits) {
for my $hsp ($hit->all_hsps) {
# ...
}
view all matches for this distribution
view release on metacpan or search on metacpan
examples/benchmark.pl view on Meta::CPAN
$query =~ tr{u}{t};
my $time;
my $VERBOSE=0;
my $filenameCDNA = 'TAIR8_cdna_20080412';
my $iterations = $DEBUG ? 1 : 20;
my $iterationsdb = $DEBUG ? 1: 2;
my $maxmm = $DEBUG ? 1 : 5;
#goto CREATETMP;
DB:
for $b (sort keys %be) {
my $sbe = $be{$b};
$time = [gettimeofday];
for my $i (1..$iterationsdb) {
system("rm -rf data$b/");
mkdir 'data' . $b;
$sbe->generate_database({
datapath => 'data' . $b,
file => "examples/$filenameCDNA",
prefix_length => 3,
});
}
$results{"${b}_dbgen"} = sprintf("%.2f",
(tv_interval($time)/$iterationsdb));
warn "$b took " . $results{"${b}_dbgen"} . " seconds\n";
}
MM:
for $b (sort keys %be) {
examples/benchmark.pl view on Meta::CPAN
$loop_counter = 1 if $b eq 'vmatch';
for my $online ( 0 .. $loop_counter) {
for my $mm (0..$maxmm) {
next MM if !defined $sbe->features->{MISMATCHES} && $mm > 0;
$time = [gettimeofday];
for my $i (1..$iterations) {
print "." if ($i % 5 == 0);
my %showdesc;
%showdesc = ( showdesc => 100) if $b eq 'vmatch';
my $gu = 1;
$gu = 0 if $b eq 'guugle';
examples/benchmark.pl view on Meta::CPAN
warn scalar(@ids). " results.\n" if $VERBOSE;
}
warn 'Is TRE? ' . $sbe->is_tre_agrep() if $b =~/agrep/;
$results{"${b}_mm_${mm}_$online"} = sprintf("%.2f",
tv_interval($time)/$iterations);
warn "$b (mm $mm) took " . $results{"${b}_mm_${mm}_$online"} . " seconds\n";
}
}
}
examples/benchmark.pl view on Meta::CPAN
$results{cpuinfo} = scalar $info->device('CPU')->identify;
$results{perl} = $info->perl_long();
$results{osname} = $info->os->name( long => 1 );
$results{filenameCDNA} = $filenameCDNA;
$results{biogrepv} = $Bio::Grep::VERSION;
$results{iterations} = $iterations;
$results{iterationsdb} = $iterationsdb;
$template->process('examples/Benchmarks.tt', \%results, 'lib/Bio/Grep/Benchmarks.pod') || die
$template->error(), "\n";
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Bio/MUST/Apps/FortyTwo/OrgProcessor.pm view on Meta::CPAN
return unless $bo;
my %tol_score_for;
ORTHOLOGUE:
for my $orthologue ($bo->all_iterations) {
next ORTHOLOGUE unless $orthologue->count_hits;
# Note: this should never happen...
my $query_def = $orthologue->query_def;
my $transcript_acc = $orthologous_seqs->long_id_for($query_def);
lib/Bio/MUST/Apps/FortyTwo/OrgProcessor.pm view on Meta::CPAN
# abort if no hit
my $bo = $parser->blast_output;
return $aligned_seqs unless $bo;
ORTHOLOGUE:
for my $orthologue ($bo->all_iterations) {
unless ($orthologue->count_hits) {
###### [ORG] skipped orthologue due to lack of significant template
next ORTHOLOGUE;
} # TODO: investigate why this should happen at all...
view all matches for this distribution
view release on metacpan or search on metacpan
test/blastp.out view on Meta::CPAN
<Parameters_gap-open>11</Parameters_gap-open>
<Parameters_gap-extend>1</Parameters_gap-extend>
<Parameters_filter>F</Parameters_filter>
</Parameters>
</BlastOutput_param>
<BlastOutput_iterations>
<Iteration>
<Iteration_iter-num>1</Iteration_iter-num>
<Iteration_query-ID>Query_1</Iteration_query-ID>
<Iteration_query-def>Sulfurimonas_autotrophica_563040@ADN08900</Iteration_query-def>
<Iteration_query-len>675</Iteration_query-len>
test/blastp.out view on Meta::CPAN
<Statistics_lambda>0.267</Statistics_lambda>
<Statistics_entropy>0.14</Statistics_entropy>
</Statistics>
</Iteration_stat>
</Iteration>
</BlastOutput_iterations>
</BlastOutput>
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Bio/MUST/Apps/TwoScalp/Seq2Seq.pm view on Meta::CPAN
return unless $bo;
my $sort_method = $self->single_hsp ? 'score' : 'hit_start';
QUERY:
for my $query ( $bo->all_iterations ) {
my $query_id = $query_seqs->long_id_for( $query->query_def );
##### [S2S] Aligning: $query_id
my @templates;
view all matches for this distribution
view release on metacpan or search on metacpan
-evalue => 1e-10,
-outfmt => 5,
} );
isa_ok($xml_parser, 'Bio::FastParsers::Blast::Xml');
cmp_ok $xml_parser->blast_output->count_iterations, '==', 7,
'got expected number of iterations';
$report_xml = $xml_parser->filename;
explain $report_xml;
compare_filter_ok $report_xml, file('test', 'report.blastp.xml'),
\&filter, 'wrote expected XML BLASTP report';
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Bio/RNA/Treekin/Record.pm view on Meta::CPAN
info
init_population
rates_file
file_index
cmd
of_iterations
);
# Get number of population data rows stored.
sub population_data_count {
my ($self) = @_;
lib/Bio/RNA/Treekin/Record.pm view on Meta::CPAN
# Population data
my $population_str
= join "\n", map { "$_" } @{ $self->_population_data };
# Footer (new Treekin versions only).
my $footer_str = $self->has_of_iterations
? '# of iterations: ' . $self->of_iterations
: q{};
my $self_as_str = $header_str . "\n" . $population_str;
$self_as_str .= "\n" . $footer_str if $footer_str;
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Bio/Roary/Output/NumberOfGroups.pm view on Meta::CPAN
use List::Util qw(shuffle);
use Bio::Roary::AnnotateGroups;
use Bio::Roary::GroupStatistics;
has 'group_statistics_obj' => ( is => 'ro', isa => 'Bio::Roary::GroupStatistics', required => 1 );
has 'number_of_iterations' => ( is => 'ro', isa => 'Int', default => 10);
has 'groups_to_contigs' => ( is => 'ro', isa => 'Maybe[HashRef]' );
has 'annotate_groups_obj' => ( is => 'ro', isa => 'Bio::Roary::AnnotateGroups', required => 1 );
has 'core_definition' => ( is => 'ro', isa => 'Num', default => 1.0 );
has 'output_raw_filename_conserved_genes' => ( is => 'ro', isa => 'Str', default => 'number_of_conserved_genes.Rtab' );
lib/Bio/Roary/Output/NumberOfGroups.pm view on Meta::CPAN
has '_new_genes' => ( is => 'ro', isa => 'ArrayRef', default => sub { [] } );
sub create_output_files {
my ($self) = @_;
for ( my $i = 0 ; $i < $self->number_of_iterations ; $i++ ) {
$self->_single_iteration_gene_expansion;
}
$self->_create_raw_output_file( $self->output_raw_filename_conserved_genes, $self->_conserved_genes );
$self->_create_raw_output_file( $self->output_raw_filename_unique_genes, $self->_unique_genes );
lib/Bio/Roary/Output/NumberOfGroups.pm view on Meta::CPAN
}
sub _create_raw_output_file {
my ( $self, $filename, $output_data ) = @_;
open( my $fh, '>', $filename );
for my $iterations ( @{$output_data} ) {
print {$fh} join( "\t", @{$iterations} );
print {$fh} "\n";
}
close($fh);
}
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Bio/SearchIO/XML/BlastHandler.pm view on Meta::CPAN
'BlastOutput_param' => 1,
'Iteration_hits' => 1,
'Statistics' => 1,
'Parameters' => 1,
'BlastOutput' => 1,
'BlastOutput_iterations' => 1,
);
sub start_document{
view all matches for this distribution
view release on metacpan or search on metacpan
scripts/testRNG_performance.pl view on Meta::CPAN
);
}
);
$benchmark->run_iterations($benchmark_reps);
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Bio/Tools/Run/Alignment/MSAProbs.pm view on Meta::CPAN
Args : integer 0..5, [default 2] (optional)
=cut
=head2 iterations
Title : iterations
Usage : $prog->iterations($passes)
Function: get/set the number of iterative-refinement passes
Returns : integer
Args : integer 0..1000, [default 10] (optional)
view all matches for this distribution
view release on metacpan or search on metacpan
Bio/Align/DNAStatistics.pm view on Meta::CPAN
Title : calc_average_KaKs.
Useage : my $res= $stats->calc_average_KaKs($alnobj, 1000).
Function : calculates Nei_Gojobori stats for average of all
sequences in the alignment.
Args : A Bio::Align::AlignI compliant object such as a
Bio::SimpleAlign object, number of bootstrap iterations
(default 1000).
Returns : A reference to a hash of statistics as listed in Description.
=cut
view all matches for this distribution
view release on metacpan or search on metacpan
lib/Bio/AssemblyImprovement/Circlator/Main.pm view on Meta::CPAN
my @iterative_merge_files = sort {$self->_get_number_in_filename($a) <=> $self->_get_number_in_filename($b)} glob("$temp_dir/04.merge.merge.iter.*.reads.log"); #cannot rely on glob's lexical sorting
my @log_files = ("$temp_dir/02.bam2reads.log",
@iterative_merge_files,
"$temp_dir/04.merge.merge.iterations.log",
"$temp_dir/04.merge.merge.log",
"$temp_dir/04.merge.circularise_details.log",
"$temp_dir/04.merge.circularise.log",
"$temp_dir/05.clean.log",
"$temp_dir/06.fixstart.log",
view all matches for this distribution
view release on metacpan or search on metacpan
# Title : bla_to_msf (this is not used. Use convert_bla_to_msf)
# Usage : @msf_file_made=@{&bla_to_msf(\@bla_file)};
# Function : matched each query seq name and if the E value is lower than
# my arbitrary threshold, I put the subject and target pair
# alignment into a hash.
# In later iterations, the latest is replaced
# Example :
# Keywords : convert_bla_to_msf
# Options :
# Author :
# Category :
# Title : convert_bla_to_msf
# Usage : @msf_file_made=@{&convert_bla_to_msf(\@bla_file)};
# Function : matched each query seq name and if the E value is lower than
# my arbitrary threshold, I put the subject and target pair
# alignment into a hash.
# In later iterations, the latest is replaced
# Example :
# Keywords : convert_bla_to_msf
# Options :
# Author :
# Category :
# Title : convert_bla_multaln_to_msf
# Usage : @msf_file_made=@{&convert_bla_multaln_to_msf(\@bla_file, [i=2])};
# Function : matched each query seq name and if the E value is lower than
# my arbitrary threshold, I put the subject and target pair
# alignment into a hash.
# In later iterations, the latest is replaced,
# when you use m6 option for PSI blast
# this adds '00x' extensions to the repeatedly occurring seq names
#
# Example : @msf_file_made=@{&convert_bla_multaln_to_msf(\@bla_file,
# $verbose, "i=$iteration")};
view all matches for this distribution
view release on metacpan or search on metacpan
FlipFlop.pm view on Meta::CPAN
integer zero (0).
$r = set_test() ... reset_test();
# this same $r is present in the examples below
print 'the flip flop has been true for ', +$r, " iterations.\n";
=item lead_edge
The leading edge, when a flip flop changes from the false state to true
can be detected by testing the series for number 1.
view all matches for this distribution
view release on metacpan or search on metacpan
examples/xs_vs_pp.pl view on Meta::CPAN
Bit::Manip::PP::bit_set(65535, 0, 8, 0xFF);
}
__END__
Benchmark: timing 1000000 iterations of c, p...
c: 3 wallclock secs ( 3.35 usr + 0.00 sys = 3.35 CPU) @ 298507.46/s (n=1000000)
p: 17 wallclock secs (16.58 usr + 0.00 sys = 16.58 CPU) @ 60313.63/s (n=1000000)
Rate p c
p 60606/s -- -80%
view all matches for this distribution
view release on metacpan or search on metacpan
examples/xs_vs_pp.pl view on Meta::CPAN
Bit::Manip::PP::bit_set(65535, 0, 8, 0xFF);
}
__END__
Benchmark: timing 1000000 iterations of c, p...
c: 3 wallclock secs ( 3.35 usr + 0.00 sys = 3.35 CPU) @ 298507.46/s (n=1000000)
p: 17 wallclock secs (16.58 usr + 0.00 sys = 16.58 CPU) @ 60313.63/s (n=1000000)
Rate p c
p 60606/s -- -80%
c 299401/s 394% --
view all matches for this distribution