[BioPython] said Your XML file was empty in parsing blast records but can see the results in the saved xml file

Hongwu Ma hma2 at staffmail.ed.ac.uk
Thu Nov 13 11:18:34 UTC 2008


  Sometimes when I parse the blast records in biopython using the 
following program I get the error "Your XML file was empty" but there 
are actually some results in the saved xml files. Anyone know what is 
the problem?
Thanks in advance.
Hongwu

  myfolder='c:/mgenome/'
  mydatafolder=myfolder+'alphao/'
  my_blast_db = myfolder+'orfsre.txt'
  my_blast_exe =myfolder+'blastall.exe'
  evalue=0.0001
  my_blast_file = mydatafolder+file
  result_handle, error_handle = 
NCBIStandalone.blastall(blastcmd=my_blast_exe,
                                                      program="tblastn",
                                                      database=my_blast_db,
                                                      infile=my_blast_file,
                                                      expectation=evalue)
  bres=result_handle.read()
  save_file = open(myfolder+file[:3]+'orfre.xml', "w")
  save_file.write(bres)
  save_file.close()
  blast_records = NCBIXML.parse(result_handle)
  for blast_record in blast_records:
        
>
>
>   


-- 
The University of Edinburgh is a charitable body, registered in
Scotland, with registration number SC005336.




More information about the Biopython mailing list