Elementolab/Perl Tips

From Icbwiki

(Difference between revisions)
Jump to: navigation, search
Revision as of 05:32, 16 April 2012
Ole2001 (Talk | contribs)

← Previous diff
Current revision
Ole2001 (Talk | contribs)

Line 1: Line 1:
 +* A convenient regular expression generator http://txt2re.com/
 +
* A little known Perl package useful to calculate Poisson or binomial p-values http://search.cpan.org/~callahan/Math-CDF-0.1/CDF.pm * 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"' perl -e 'use Math::CDF; print 1-Math::CDF::ppois(2,1314/16418) . "\n"'

Current revision

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";
}
Personal tools