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

Diff of /FigKernelScripts/gff2ncbitab.pl

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

revision 1.1, Thu May 22 16:55:03 2008 UTC revision 1.2, Fri May 23 20:53:03 2008 UTC
# Line 7  Line 7 
7  my $usage = "$0 gff-file > tab-sep-data";  my $usage = "$0 gff-file > tab-sep-data";
8  @ARGV == 1 or die $usage;  @ARGV == 1 or die $usage;
9    
10    my $ffs = new FFs("$FIG_Config::data/FigfamsData");
11    $ffs or die "bad ffs\n";
12    
13    my @desired_dbxref = qw(RefSeq_Prot
14                            IMG
15                            TIGR
16                            SP
17                            UniProtKB
18                            KEGG
19                            InterPro
20                            PFAM
21                            SMART
22                            );
23    my %desired_dbxref = map { $_ => 1} @desired_dbxref;
24    
25  my $gff = shift;  my $gff = shift;
26    
27  open(GFF, "<", $gff) or die "cannot open gff file $gff: $!\n";  open(GFF, "<", $gff) or die "cannot open gff file $gff: $!\n";
# Line 50  Line 65 
65          my $fig_id = (map { $_->[1] } grep { $_->[0] eq 'FIG_ID' } @dbxref)[0];          my $fig_id = (map { $_->[1] } grep { $_->[0] eq 'FIG_ID' } @dbxref)[0];
66          my $coords = $strand eq '+' ? "${start}_$end"  : "${end}_$start";          my $coords = $strand eq '+' ? "${start}_$end"  : "${end}_$start";
67          my $refseq = (map { $_->[1] } grep { $_->[0] eq 'RefSeq_Prot' } @dbxref)[0];          my $refseq = (map { $_->[1] } grep { $_->[0] eq 'RefSeq_Prot' } @dbxref)[0];
68            my $figfam = $ffs->family_containing_peg($fig_id);
69    
70          my $evcode = join(",", @{$attr{evidence_code}}) if $attr{evidence_code};          my $evcode = join(",", @{$attr{evidence_code}}) if $attr{evidence_code};
71    
72          my $gene_sym = $attr{gene_symbol}->[0] if $attr{gene_symbol};          my $gene_sym = $attr{gene_symbol}->[0] if $attr{gene_symbol};
73          my $descr = $attr{description}->[0] if $attr{description};          my $descr = $attr{description}->[0] if $attr{description};
74          my $dbxref = join(",", map { join(":", @$_) } grep { $_->[0] !~ /^FIG_ID|RefSeq_Prot|KEGG/} @dbxref);          my $dbxref = join(",", map { join(":", @$_) } grep { $desired_dbxref{$_->[0]} } @dbxref);
75          my $kegg = join(",", map { join(":", @$_) } grep { $_->[0] =~ /^KEGG/} @dbxref);          my $kegg = join(",", map { join(":", @$_) } grep { $_->[0] =~ /^KEGG/} @dbxref);
76          my $weblink;          my $weblink;
77          if ($attr{web_id})          if ($attr{web_id})
78          {          {
79              $weblink = "http://www.nmpdr.org/linkin.cgi?id=$attr{web_id}->[0]";              $weblink = "http://www.nmpdr.org/linkin.cgi?id=$attr{web_id}->[0]";
80          }          }
81          $dat{$id} = [$fig_id, $contig, $coords, $refseq, $evcode, $gene_sym, $descr, $dbxref, $kegg, '', $weblink];          $dat{$id} = [$fig_id, $contig, $coords, $refseq, $evcode, $gene_sym, $descr, $dbxref, $kegg, '', $weblink, $figfam];
82      }      }
83  }  }
84    

Legend:
Removed from v.1.1  
changed lines
  Added in v.1.2

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3