Elementolab/Perl Tips
From Icbwiki
(Difference between revisions)
| Revision as of 03:49, 2 January 2012 Ole2001 (Talk | contribs) ← Previous diff |
Revision as of 05:32, 16 April 2012 Ole2001 (Talk | contribs) Next diff → |
||
| Line 1: | Line 1: | ||
| + | * A little known Perl package useful to calculate Poisson or binomial p-values http://search.cpan.org/~callahan/Math-CDF-0.1/CDF.pm | ||
| + | perl -e 'use Math::CDF; print 1-Math::CDF::ppois(2,1314/16418) . "\n"' | ||
| + | |||
| * A package to change colors in terminal output | * A package to change colors in terminal output | ||
| http://perl.active-venture.com/lib/Term/ANSIColor.html | http://perl.active-venture.com/lib/Term/ANSIColor.html | ||
Revision as of 05:32, 16 April 2012
- A little known Perl package useful to calculate Poisson or binomial p-values http://search.cpan.org/~callahan/Math-CDF-0.1/CDF.pm
perl -e 'use Math::CDF; print 1-Math::CDF::ppois(2,1314/16418) . "\n"'
- A package to change colors in terminal output
http://perl.active-venture.com/lib/Term/ANSIColor.html
- Some packages we are using to do stats in Perl
http://search.cpan.org/~iawelch/Statistics-Regression-0.53/Regression.pm http://search.cpan.org/~mikek/Statistics-Distributions-1.02/Distributions.pm
- A nice Perl module to create Excel spreadsheets in Perl: Spreadsheet::WriteExcel
http://homepage.eircom.net/~jmcnamara/perl/WriteExcel.html http://search.cpan.org/dist/Spreadsheet-WriteExcel/ http://search.cpan.org/~jmcnamara/Spreadsheet-WriteExcel-2.37/lib/Spreadsheet/WriteExcel.pm
- Connected components (using Olivier's Sets.pm multipurpose module)
use Sets;
my %H = ( "A" => [ "B", "C"],
"D" => ["E"] );
my $a_ref = Sets::get_connected_components(\%H);
# should print
# A B C
# D E
foreach my $r (@$a_ref) {
print join("\t", @$r) . "\n";
}
