Thursday, June 30, 2011

Bioperl Install Problems

After ActivePerl 5.12 or  5.14 was installed, CPAN cannot find C compiler, also fail to install any. 
ActivePerl 5.10 have no such problem.


ActivePerl 5.10 1008 (Windows XP, or Vista or Seven)
CPAN v1.9600

Since I have updated the CPAN I am not able to install any module. I
have always the error message.

←[32mError reading 'C:\Perl\cpan\FTPstats.yml': Alert: While trying to
'parse' YAML file
'C:\Perl\cpan\FTPstats.yml'
with 'YAML::XS' the following error was encountered:
 Usage: YAML::XS::LibYAML::Load(yaml_sv) at C:\Perl\site\lib/YAML/
XS.pm line 48.

Stashing away as 'C:\Perl\cpan\FTPstats.yml.1305305098' to prevent
further interruptions. You may want to remove that file later.←[0m
←[31mCould not rename: Permission denied←[0m←[32m←[0m


ANSWER:
Delete manually the YAML module from your PERL lib :
C:\Perl\site\lib\YAML
Then it will stop using the FTPstats.yml file to log statistics and the
problem is overcome.
Ofc, this way you skip the statistics, but CPAN will work fine afterwards

Wednesday, June 29, 2011

Installation using CPAN or manual installation

204  232  207

Installation using CPAN or manual installation

   Installation using PPM is preferred since it is easier, but if you run
   into problems, or a ppm isn't available for the version/package of bioperl
   you want, or you want to choose which optional dependencies to install,
   you can install manually by downloading the appropriate package or by
   using CPAN. In fact both methods ultimately need nmake to be
   installed, CPAN to be upgraded to >= v1.81, Module::Build to be installed
   (>= v0.2805) and Test::Harness to be upgraded to >= v2.62:

           1) Download nmake

           2) Double-click to run it, which extracts 3 files. Move both
           NMAKE.EXE and the NMAKE.ERR files to a place in your PATH; if set
           up properly, you can move these to your Perl bin directory,
           normally C:\Perl\bin.

           1) Open a cmd window by going to Start >> Run and typing 'cmd'
           into the box and pressing return.

           2) Type 'cpan' to enter the CPAN shell.

           3) At the cpan> prompt, type 'install CPAN' to upgrade to the
           latest version.

           4) Quit (by typing 'q') and reload cpan. You may be asked some
           configuration questions; accepting defaults is fine.

           5) At the cpan> prompt, type 'o conf prefer_installer MB' to tell
           CPAN to prefer to use Build.PL scripts for installation. Type 'o
           conf commit' to save that choice.

           6) At the cpan> prompt, type 'install Module::Build'.

           7) At the cpan> prompt, type 'install Test::Harness'.

   You can now follow the unix instructions for installing using CPAN, or
   install manually:

           8) Download the .zip version of the package you want.

           9) Extract the archive in the normal way.

           10) In a cmd window 'cd' to the directory you extracted to. Eg. if
           you extracted to directory 'Temp', 'cd Temp\bioperl-1.5.2_100'

           11) Type 'perl Build.PL' and answer the questions appropriately.

           12) Type 'perl Build test'. All the tests should pass, but if they
           don't, let us know. Your usage of Bioperl may not be affected
           by the failure, so you can choose to continue anyway.
          
           12.5) Run 'Build installdeps' to install missing prerequisites.

           13) Type 'perl Build install' to install Bioperl.

Friday, June 24, 2011

Websites

Perl
Perl CGI SYNOPSIS
Samples - CGI.pm - a Perl5 CGI Library
Perl中文手册
CGI - perldoc


R
STAT - Power Test

Simple Perl CGI to generat HTML

open (IN,"table.txt") or die "Cant Open $!";
print start_html('HTMLIZE');

# get the caption
chomp($caption = <IN>);

# get the column headers
chomp($colhead = <IN>);
@col_head = split("\t",$colhead);

# Get the data into an array. 
# The first item in each array is the header, the rest is
# the data cells
while (<IN>) {
     chomp;
     ($rowhead,@data) = split("\t");
     push(@rows,th($rowhead).td(\@data));
}

# Print out the table
print img{src=>'ENSG00000189366.png',align=>'center'};

print hr;

print table({-border=>''},
          caption($caption),
          TR([th(\@col_head),@rows])
      );
close IN;
print end_html;

Power Test by R

power.t.test(delta=0.5, sd=2, sig.level = 0.01, power=.9)

OR

power.t.test(delta=0.5, sd=2, sig.level = 0.01, n = 450)

delta = "True Difference"
n = sample size
sd = standard deviation