[Bioperl-l] XML::DOM?

hafiz hafiz khufaz83 at yahoo.com
Wed Jun 9 23:07:07 EDT 2004


Thank you to Brian Osborne. , I have install my
bioperl against , therefore my output have change .
after i do it this >perl -e 'use XML::DOM' nothing
happen and i have got same output, so i have reinstall
my bioperl and install against, please help me . why? 

this is my code ;

#! usr\bin\perl

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


$format = swiss;

#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;
# chdir $location1;
        print " location directory database
swissprot:$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"\n CHANCE FORMAT FUNCTION\n";

print "\nEnter filename for output file:";
chomp ($outFile = <STDIN>);

print "\nEnter format for output file:";
chomp ($format1 = <STDIN>);

print"\n........Chance funtion.......\n";

#chance format function

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);
          }

        #Method from Bioperl module-Bio::SeqIO
        #Create a sequence object and store it in
scalar variable
        $in = Bio::SeqIO->new(-file
=>$file,'-format'=>"$format");


    }#End first if loop

}#End foreach loop

my output;
CHANCE FORMAT FUNCTION

Enter filename for output
file:/home/database/Bioperl/sprot42.bsml

Enter format for output file:bsml

........Chance funtion.......
Can't call method "text" without a package or object
reference at
/usr/lib/perl5/site_perl/5.8.0/Bio/SeqIO/bsml.pm line
1133, <GEN0> line 53.








This is bsml.pm some of souce code ; 
/usr/lib/perl5/site_perl/5.8.0/Bio/SeqIO/bsml.pm> line
1158 

foreach my $key ($ann->get_all_annotation_keys()) {
        foreach my $thing
($ann->get_Annotations($key)) {
            if ($key eq 'description') {
                push @{$descRef}, ["description" ,
$thing->value];
            } elsif ($key eq 'comment') {  
                push @{$descRef}, ["comment" ,
$thing->text];
            } elsif ($key eq 'dblink') {
                # DBLinks get dumped to attributes,
too  
                push @{$descRef}, ["db_xref" , 
$thing->database . ":"
                                   .
$thing->primary_id ];
                if (my $com = $thing->comment) {
                    push @{$descRef}, ["link" ,
$com->text ]; #line 1158 error
                }
      
            } elsif ($key eq 'reference') {
                $self->_parse_reference( @_, -refobj
=> $thing );
            } elsif (ref($thing) =~ /SimpleValue/) {
                push @{$descRef}, [$key ,
$thing->value];
            } else {
                # What is this??   
                push @{$descRef}, ["error", "bsml.pm
did not understand ".
                                   "'$key' = '$thing'"
];
            }



________________________________________________________________________
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