[Bioperl-l] chance database from swissprot to fasta

James Wasmuth james.wasmuth at ed.ac.uk
Thu May 13 04:08:53 EDT 2004


Hi Hafiz,

it's a mistake I still make ;o)

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


Note the '>' before $outfile

-james


hafiz hafiz wrote:

>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
>_______________________________________________
>Bioperl-l mailing list
>Bioperl-l at portal.open-bio.org
>http://portal.open-bio.org/mailman/listinfo/bioperl-l
>  
>

-- 
"There are some days when I think I'm going to die from 
an overdose of satisfaction."
	     --- Salvador Dali

Nematode Bioinformatics          |
Blaxter Nematode Genomics Group  |
School of Biological Sciences    |
Ashworth Laboratories            | tel: +44 131 650 7403
University of Edinburgh          | web: www.nematodes.org
Edinburgh                        |
EH9 3JT                          |
UK                               |	



More information about the Bioperl-l mailing list