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

Diff of /FigKernelPackages/raelib.pm

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.6, Sun Mar 20 00:08:39 2005 UTC revision 1.11, Fri Apr 8 20:22:23 2005 UTC
# Line 68  Line 68 
68    
69    
70    
71  =head2 pirsfcorrespondance  =head2 pirsfcorrespondence
72    
73   Generate the pirsf->fig id correspondance. This is only done once and the correspondance file is written.   Generate the pirsf->fig id correspondence. This is only done once and the correspondence file is written.
74   This is so that we can easily go back and forth.   This is so that we can easily go back and forth.
75    
76   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   The correspondence has PIR ID \t FIG ID\n, and is probably based on ftp://ftp.pir.georgetown.edu/pir_databases/pirsf/data/pirsfinfo.dat
77    
78     This method takes three arguments:
79       from    : pirsfinfo.dat file
80       to      : file to write information to
81       verbose : report on progress
82    
83     Returns the number of lines in the pirsinfo file that were read.
84    
85  =cut  =cut
86    
87  sub pirsfcorrespondance {  sub pirsfcorrespondence {
88   my ($self, $from, $to)=@_;   my ($self, $from, $to, $verbose)=@_;
89   die "File $from does not exist as called in $0" unless (-e $from);   unless (-e $from) {
90      print STDERR "File $from does not exist as called in $0\n";
91      return 0;
92     }
93   open (IN, $from) || die "Can't open $from";   open (IN, $from) || die "Can't open $from";
94   open (OUT, ">$to") || die "Can't write tot $to";   open (OUT, ">$to") || die "Can't write to $to";
95     my $linecount;
96   while (<IN>) {   while (<IN>) {
97      $linecount++;
98      unless ($linecount % 10000) {print STDERR "Correspondence of $linecount lines calculated\n"}
99    if (/^>/) {print OUT; next}    if (/^>/) {print OUT; next}
100    chomp;    chomp;
101    my $done;    my $done;
# Line 94  Line 107 
107   }   }
108   close IN;   close IN;
109   close OUT;   close OUT;
110     return $linecount;
111  }  }
112    
113    
# Line 173  Line 187 
187   my @return;   my @return;
188   my @attr=$fig->feature_attributes($peg);   my @attr=$fig->feature_attributes($peg);
189   foreach my $attr (@attr) {   foreach my $attr (@attr) {
190    my ($gottag, $val, $link)=@$attr;    my ($gotpeg, $gottag, $val, $link)=@$attr;
191    push @return, $val if ($gottag eq $tag);    push @return, $val if ($gottag eq $tag);
192   }   }
193   return wantarray ? @return : join "; ", @return;   return wantarray ? @return : join "; ", @return;

Legend:
Removed from v.1.6  
changed lines
  Added in v.1.11

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3