[Bio] / FortyEight / SeedExport.pm Repository:
ViewVC logotype

Diff of /FortyEight/SeedExport.pm

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

revision 1.4, Fri Feb 2 20:58:00 2007 UTC revision 1.5, Thu Feb 8 21:11:01 2007 UTC
# Line 79  Line 79 
79      # create the variable for the bio object      # create the variable for the bio object
80      my $bio;      my $bio;
81      my $bio2;      my $bio2;
82        my $gff_export;
83    
84      # get the contigs      # get the contigs
85      foreach my $contig ($fig->contigs_of($genome)) {      foreach my $contig ($fig->contigs_of($genome)) {
# Line 243  Line 244 
244    
245                  push(@$bio2, $feature2);                  push(@$bio2, $feature2);
246    
247                    # work around to get annotations into gff
248                    push @$gff_export, "$contig\t$source\tCDS\t$start\t$stop\t.\t$strand\t$frame\t$func\n"
249    
250    
251              } elsif ($type eq "rna") {              } elsif ($type eq "rna") {
252                  $feature = Bio::SeqFeature::Generic->new(                  $feature = Bio::SeqFeature::Generic->new(
253                      -start    => $start,                      -start    => $start,
# Line 267  Line 272 
272    
273      # check for FeatureIO or SeqIO      # check for FeatureIO or SeqIO
274      if ($format eq "GTF") {      if ($format eq "GTF") {
275        my $fio = Bio::FeatureIO->new(-file => ">$filename", -format => "GTF");        #my $fio = Bio::FeatureIO->new(-file => ">$filename", -format => "GTF");
276        foreach my $feature (@$bio2) {        #foreach my $feature (@$bio2) {
277          $fio->write_feature($feature);        #$fio->write_feature($feature);
278          #}
279          open (GTF, ">$filename") or die "Cannot open file $filename.";
280          print GTF "##gff-version 3\n";
281          foreach (@$gff_export) {
282            print GTF $_;
283        }        }
284          close(GTF);
285    
286      } else {      } else {
287        my $sio = Bio::SeqIO->new(-file => ">$filename", -format => $format);        my $sio = Bio::SeqIO->new(-file => ">$filename", -format => $format);
288        foreach my $seq (keys %$bio) {        foreach my $seq (keys %$bio) {

Legend:
Removed from v.1.4  
changed lines
  Added in v.1.5

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3