[Bioperl-l] chance database from swissprot to fasta

hafiz hafiz khufaz83 at yahoo.com
Thu May 13 03:46:51 EDT 2004


Please some one can help me, i want to chance my
database from swissprot to fasta but it can’t write to
output file and i don’t know the bioperl modul can
read my database file,

This my code  

#! usr\bin\perl

use Bio::Root::IO;
use Bio::SeqIO;
use Bio::Seq;
use Bio::Seq::RichSeq;
use Location;  


$format = swiss;
$format1 = fasta;
#Load  module Location.pm into an array
@filelocation = Location::filelocation ("sprot42.dat",
$database);

  
#Access directory path that resides in second element
of array @filelocation
 my $location = $filelocation[1];

 
chdir $location;
        print "$location\n";
  
#Open the directory that are returned by Location.pm
modul
 opendir (DIR, $location)|| die "\nCouldn't open
directory or directory not found\n";

   
#Read the drectory and store its content in an array
  @file = readdir (DIR);
   
 foreach $file(@file) {

 
  if ($file eq "sprot42.dat") {
  
print "\nEnter filename for output file:";
chomp ($outFile = <STDIN>);
        

  
my $seq_in = Bio::SeqIO->new(-file=>$file,'-format'=>
"$format");
   
my $seq_out = Bio::SeqIO->new(-file=>
"$outFile",'-format'=> "$format1");

my $inseq;
          while ( $inseq = $seq_in->next_seq) {
             $seq_out->write_seq($inseq);
          }
        
}
}
--------------------------------------------------------------------------------------------------------
my output

Enter filename for output
file:/home/database/Bioperl/outFILE.pl


________________________________________________________________________
Yahoo! Messenger - Communicate instantly..."Ping" 
your friends today! Download Messenger Now 
http://uk.messenger.yahoo.com/download/index.html


More information about the Bioperl-l mailing list