G::Tools PEC
SummaryIncluded librariesPackage variablesSynopsisDescriptionGeneral documentationMethods
Summary
G::Tools::PEC - Perl extension for blah blah blah
Package variables
No package variables defined.
Included modules
G::Messenger
LWP::Simple
SelfLoader
SubOpt
Inherit
Exporter
Synopsis
  use G::Tools::PEC;
  blah blah blah
Description
Stub documentation for G::Seq::PEC was created by h2xs. It looks like the
author of the extension was negligent enough to leave the stub
unedited.
Blah blah blah.
Methods
set_essentiality
No description
Code
Methods description
None available.
Methods code
set_essentialitydescriptionprevnextTop
sub set_essentiality {
    my @args = opt_get(@_);
    my $gb = shift @args;

    if ($gb->{LOCUS}->{id} eq 'U00096' || $gb->{LOCUS}->{id} eq 'NC_000913'){

	my $url = "http://shigen.lab.nig.ac.jp/ecoli/pec/download/files/PECData.dat";
	my $dir = $ENV{HOME} . '/.glang/data/Essentiality.txt';
	mirror($url, $dir);
	die("set_essentiality: cannot retrieve data from PEC.") unless(-e $dir);

	my $i = 1;
	open(FILE, $dir) || die($!);

	while(<FILE>){
	    chomp;
	    my $line = $_;

	    my (@hoge) = split(/\t/);

	    my @list = ($hoge[0], split(/,/, $hoge[1]));

	    my $id;
	    foreach my $gene (@list){
		my $tmp = $gb->gene2id($gene);
		$id = $tmp;
		last if(length $id);
	    }
	    
	    if($hoge[7] == 1){
		$gb->{$id}->{essentiality} = 1;		
	    }elsif($hoge[7] == 2){
		$gb->{$id}->{essentiality} = -1;
	    }
	}
	close(FILE);

   }else{
       msg_error("No essentiality data for this species.\n\n");
   }

    return 1;
}
General documentation
AUTHORTop
A. U. Thor, a.u.thor@a.galaxy.far.far.away
SEE ALSOTop
perl(1).