[Bio] / FigKernelScripts / parse_genbank.pl Repository:
ViewVC logotype

Diff of /FigKernelScripts/parse_genbank.pl

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

revision 1.7, Sat Jun 5 19:55:34 2004 UTC revision 1.8, Sat Jun 12 11:15:56 2004 UTC
# Line 34  Line 34 
34      if ($contig =~ /\nACCESSION\s+(\S+)/s)      if ($contig =~ /\nACCESSION\s+(\S+)/s)
35      {      {
36          $id = $1;          $id = $1;
37          if ($contig =~ /\nORIGIN([acgtumrwsykbdhvnxACGTUMRWSYKBDHVNX0-9\s\n]*)(\n\/\/\n|LOCUS)/s)          if ($contig =~ /ORIGIN(.*?)(\/\/|LOCUS)/s)
38          {          {
39              $seq = $1;              $seq = $1;
40              $seq =~ s/\s//gs;              $seq =~ s/\s//gs;
# Line 49  Line 49 
49              next;              next;
50          }          }
51    
52          if ($contig =~ /\nSOURCE\s{4,8}(\S[^\n]+\S)\n\s+ORGANISM\s+(\S[^\n]+\S)((\n\s{10,14}\S[^\n]+\S)+)/s)          if ($contig =~ /\n {0,4}ORGANISM\s+(\S[^\n]+\S)((\n\s{10,14}\S[^\n]+\S)+)/s)
53          {          {
54              $genome = $2;              $genome = $1;
55              $tax = $3;              $tax = $2;
56              $tax =~ s/\n\s+//g;              $tax =~ s/\n\s+//g;
57                $tax =~ s/ {2,}/ /g;
58              if (! $written_genome)              if (! $written_genome)
59              {              {
60                  print GENOME "$genome\n";                  print GENOME "$genome\n";
# Line 72  Line 73 
73          while ($contig =~ /\n\s{4,6}CDS\s+([^\n]+(\n {20,}[^\n]*)+)/gs)          while ($contig =~ /\n\s{4,6}CDS\s+([^\n]+(\n {20,}[^\n]*)+)/gs)
74          {          {
75              $cds = $1;              $cds = $1;
76              if ($cds !~ /\/pseudo/)              if (($cds !~ /\/pseudo/) && (($cds !~ /\/exception/) || ($cds =~ /\/translation/)))
77              {              {
78                  &process_cds($id,\$cds,$prefixP,\$idNp,$contigs,\*TBLPEG,\*FASTAPEG,\*ASSIGNMENTS);                  &process_cds($id,\$cds,$prefixP,\$idNp,$contigs,\*TBLPEG,\*FASTAPEG,\*ASSIGNMENTS);
79              }              }
# Line 96  Line 97 
97  if (! -s "$dir/assigned_functions") { unlink("$dir/assigned_functions"); print STDERR "no assigned_functions in $dir\n"; }  if (! -s "$dir/assigned_functions") { unlink("$dir/assigned_functions"); print STDERR "no assigned_functions in $dir\n"; }
98  if (! -s "$dir/Features/peg/tbl")   { system "rm -rf $dir/Features/peg"; print STDERR "no PEGs in $dir\n"; }  if (! -s "$dir/Features/peg/tbl")   { system "rm -rf $dir/Features/peg"; print STDERR "no PEGs in $dir\n"; }
99  if (! -s "$dir/Features/rna/tbl")   { system "rm -rf $dir/Features/rna"; print STDERR "no RNAs in $dir\n"; }  if (! -s "$dir/Features/rna/tbl")   { system "rm -rf $dir/Features/rna"; print STDERR "no RNAs in $dir\n"; }
100    if ((! -s "$dir/contigs") && (! -s "$dir/Features/peg/tbl")) { system "rm -rf $dir" }
101    
102    
103  sub process_cds {  sub process_cds {
# Line 298  Line 300 
300          $tran = $1;          $tran = $1;
301          $tran =~ s/\s//gs;          $tran =~ s/\s//gs;
302      }      }
303        elsif ($$cdsP =~ /\/protein_id=\"([^"]+)\"/)
304        {
305            $tran = $1;
306            $tran =~ s/\s//gs;
307        }
308      return $tran;      return $tran;
309  }  }
310    

Legend:
Removed from v.1.7  
changed lines
  Added in v.1.8

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3