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

Diff of /FigKernelPackages/FigGFF.pm

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

revision 1.16, Wed Sep 28 17:02:34 2005 UTC revision 1.21, Sun Feb 5 00:45:19 2006 UTC
# Line 1  Line 1 
1  #  #
2    # Copyright (c) 2003-2006 University of Chicago and Fellowship
3    # for Interpretations of Genomes. All Rights Reserved.
4    #
5    # This file is part of the SEED Toolkit.
6    #
7    # The SEED Toolkit is free software. You can redistribute
8    # it and/or modify it under the terms of the SEED Toolkit
9    # Public License.
10    #
11    # You should have received a copy of the SEED Toolkit Public License
12    # along with this program; if not write to the University of Chicago
13    # at info@ci.uchicago.edu or the Fellowship for Interpretation of
14    # Genomes at veronika@thefig.info or download a copy from
15    # http://www.theseed.org/LICENSE.TXT.
16    #
17    
18    #
19  # FIG GFF utilities.  # FIG GFF utilities.
20  #  #
21    
# Line 57  Line 74 
74      {      {
75          return "NCBI_NP:$1";          return "NCBI_NP:$1";
76      }      }
77        elsif (/^NM_(\d+.*)/)
78        {
79            return "NCBI_NM:$1";
80        }
81      elsif (/^gi\|(\d+)/)      elsif (/^gi\|(\d+)/)
82      {      {
83          return "NCBI_gi:$1";          return "NCBI_gi:$1";
# Line 92  Line 113 
113    
114      if (lc($type) eq "ncbi_np")      if (lc($type) eq "ncbi_np")
115      {      {
116          return "NP_$ref";          return "$ref";
117        }
118        elsif (lc($type) eq "ncbi_nm")
119        {
120            return "$ref";
121      }      }
122      elsif (lc($type) eq "ncbi_pid")      elsif (lc($type) eq "ncbi_pid")
123      {      {
# Line 102  Line 127 
127      {      {
128          return "gi|$ref";          return "gi|$ref";
129      }      }
130      elsif ($type eq "KEGG")      elsif (lc($type) eq "kegg")
131      {      {
132          $ref =~ s/ /:/;          $ref =~ s/ /:/;
133          return "kegg|$ref";          return "kegg|$ref";
134      }      }
135      elsif ($type eq "UniProt")      elsif (lc($type) eq "uniprot")
136      {      {
137          return "uni|$ref";          return "uni|$ref";
138      }      }
139      elsif ($type eq "Swiss-Prot")      elsif (lc($type) eq "swiss-prot")
140      {      {
141          return "sp|$ref";          return "sp|$ref";
142      }      }
# Line 385  Line 410 
410                  chomp($addseq);                  chomp($addseq);
411                  $fastasequences .= ">$protein_id\n$addseq\n";                  $fastasequences .= ">$protein_id\n$addseq\n";
412    
413                  my $addseq = uc($fig->dna_seq($genome, @location));                  $addseq = uc($fig->dna_seq($genome, @location));
414                  $addseq =~ s/(.{$linelength})/$1\n/g; chomp($addseq);                  $addseq =~ s/(.{$linelength})/$1\n/g; chomp($addseq);
415    
416                  $fastasequences .= ">$cds_id\n$addseq\n";                  $fastasequences .= ">$cds_id\n$addseq\n";
# Line 615  Line 640 
640          # separately.          # separately.
641          #          #
642    
643    
644          if (/^>/)          if (/^>/)
645          {          {
646              $self->parse_fasta($fh, $_);              $self->parse_fasta($fh, $_);
# Line 635  Line 661 
661              #              #
662              next;              next;
663          }          }
664            elsif (/^\#$/)
665            {
666                #
667                # blank line starting with #
668                #
669                next;
670            }
671          elsif (/^\#\#(\S+)(?:\t(.*))?/)          elsif (/^\#\#(\S+)(?:\t(.*))?/)
672          {          {
673              #              #
# Line 870  Line 903 
903      my($self, $fh, $first_line) = @_;      my($self, $fh, $first_line) = @_;
904      my($cur, $cur_id);      my($cur, $cur_id);
905    
906      for ($_ = $first_line; $_;  $_ = <$fh>, chomp)      for ($_ = $first_line; defined($_);  $_ = <$fh>, chomp)
907      {      {
908          if (/^>\s*(\S+)/)          if (/^>\s*(\S+)/)
909          {          {

Legend:
Removed from v.1.16  
changed lines
  Added in v.1.21

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3