[Bio] / FigKernelPackages / raelib.pm Repository:
ViewVC logotype

View of /FigKernelPackages/raelib.pm

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.2 - (download) (as text) (annotate)
Mon Jan 31 16:58:38 2005 UTC (14 years, 10 months ago) by redwards
Branch: MAIN
Changes since 1.1: +1 -1 lines
Minor change to raelib to correctly get the correspondance between uniprot/pir and seed/sprout

# -*- perl -*-

=pod

=head1

 Some routines and things that Rob uses. Please feel free to use at will and incorporate into
 your own code or move them into FIG.pm or elsewhere.

=cut

package raelib;
use strict;
use FIG;
my $fig=new FIG;

=head2 pirsfcorrespondance

 Generate the pirsf->fig id correspondance. This is only done once and the correspondance file is written.
 This is so that we can easily go back and forth.

 The correspondance has PIR ID \t FIG ID\n, and is probably based on ftp://ftp.pir.georgetown.edu/pir_databases/pirsf/data/pirsfinfo.dat

=cut

sub pirsfcorrespondance { 
 my ($self, $from, $to)=@_;
 die "File $from does not exist as called in $0" unless (-e $from);
 open (IN, $from) || die "Can't open $from";
 open (OUT, ">$to") || die "Can't write tot $to";
 while (<IN>) {
  if (/^>/) {print OUT; next}
  chomp;
  my $done;
  foreach my $peg ($fig->by_alias("uni|$_")) {
   print OUT $_, "\t", $peg, "\n";
   $done=1;
  }
  unless ($done) {print OUT $_, "\t\n"}
 }
 close IN;
 close OUT;
}


=head2 ss_by_id

 Generate a list of subsystems that a peg occurs in. This is a ; separated list.
 This is a wrapper that removes roles and ignores essential things

=cut

sub ss_by_id { 
 my ($self, $peg)=@_;
 my $ssout;
 print STDERR "RAELIB Looking for ss from $peg\n";
 foreach my $ss (sort $fig->subsystems_for_peg($peg)) 
 {
  next if ($$ss[0] =~ /essential/i); # Ignore the Essential B-subtilis subsystems
  $ssout.=$$ss[0]."; ";
 }
 $ssout =~ s/; $//;
 return $ssout;
}





1;

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3