2
$\begingroup$

I got a blast xml file after a DNA sequence search. The XML file is not very readable. What is the way to make it more understandable? This blast contains about twenty matches. Here is the xml file

$\endgroup$
1
  • $\begingroup$ You can do this using the Bio Entrez parser in Biopython. Its quite easy to use, but its not clear whether your happy using Python. $\endgroup$
    – M__
    Commented Jul 5, 2020 at 21:26

2 Answers 2

2
$\begingroup$

The most human-readable blast output formats are 0-4, e.g. -outfmt 0 - which if I am not mistaken is the format used by web blast. However, these formats are a pain to automatically parse.

As Cowboy_Patrick pointed out, XML is more of a machine-readable format. The tabular output format ( -outfmt 6) is very commonly used, because it is easily parsed by unix command-line tools, and its structure also allows a somewhat easy human reading and understanding.

$\endgroup$
2
  • $\begingroup$ Many thanks, how to set the output format as -outfmt 6 in a line of python code as result = NCBIWWW.qblast('blastn','nt',ADN.format('fasta') ) ? $\endgroup$ Commented Jul 7, 2020 at 11:41
  • $\begingroup$ @serpipanton I am unfamiliar with BioPython, but a cursory look at the documentation suggests -outfmt 6 is unavailable for NCBIWWW.qblast. However, there is a module NCBIXML, which will allow you to easily parse the xml output. $\endgroup$
    – h.mon
    Commented Jul 7, 2020 at 14:46
1
$\begingroup$

Is this what you are looking for: https://codebeautify.org/xmlviewer ? XML is a format designed to be readable firstly by machines, not humans.

With xslt you can convert XML to various more readable formats see this blog for something that fits your XML: http://plindenbaum.blogspot.com/2008/05/ncbi-blast-xslt-xhtml-svg.html?m=1

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.