Unconfigured Ad

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • simpson
    Member
    • Dec 2012
    • 11

    #1

    parse xml to tabular format

    Hi, I've done blastx with -m 7 option. The output file is .xml.
    But i'd like to do a data analysis to know the percentage of my unigene set has a blast hit. So i want to cover the .xml to another format.
    Does anyone know any script that can do this?
    Thanks,
    Vivi
  • GenoMax
    Senior Member
    • Feb 2008
    • 7142

    #2
    See this thread on Biostar: http://www.biostars.org/p/7290/

    Stand-alone parser: https://github.com/pjotrp/blastxmlparser
    Last edited by GenoMax; 04-30-2013, 09:35 AM.

    Comment

    • simpson
      Member
      • Dec 2012
      • 11

      #3
      Originally posted by GenoMax View Post
      See this thread on Biostar: http://www.biostars.org/p/7290/

      Stand-alone parser: https://github.com/pjotrp/blastxmlparser
      I had already seen that website. But that seems not work. Do you have more specific script and command that i can use directly?

      Comment

      • maubp
        Peter (Biopython etc)
        • Jul 2009
        • 1544

        #4
        If you specifically want to regenerate the BLAST+ tabular output, try this (standalone) Python script of mine:
        https://bitbucket.org/peterjc/galaxy...ar.py?at=tools *DEAD LINK*
        https://github.com/peterjc/galaxy_bl..._to_tabular.py *NEW LINK*

        This is available with a Galaxy wrapper on the Galaxy Tool Shed as part of the BLAST+ suite:
        Last edited by maubp; 04-17-2014, 03:41 AM. Reason: Updating link; I moved this code from BitBucket to GitHub

        Comment

        • simpson
          Member
          • Dec 2012
          • 11

          #5
          Originally posted by maubp View Post
          If you specifically want to regenerate the BLAST+ tabular output, try this (standalone) Python script of mine:


          This is available with a Galaxy wrapper on the Galaxy Tool Shed as part of the BLAST+ suite:
          http://toolshed.g2.bx.psu.edu/view/d...cbi_blast_plus
          Thanks. another question: how could i execute the python script? Can you give me the command please?

          Comment

          • maubp
            Peter (Biopython etc)
            • Jul 2009
            • 1544

            #6
            Originally posted by simpson View Post
            Thanks. another question: how could i execute the python script? Can you give me the command please?
            Download the 'raw' python script and save it in your folder as blastxml_to_tabular.py then:

            Code:
            $ python blastxml_to_tabular.py
            Expect 3 arguments: input BLAST XML file, output tabular file, out format (std or ext)
            For example, if you want the standard 12 column tab separated variables,

            Code:
            $ python blastxml_to_tabular.py example.xml example.tsv std
            If you want more details, it does an extended 24 column output mode too:

            Code:
            $ python blastxml_to_tabular.py example.xml example.tsv ext
            The command line interface was deliberately minimal as this was intended primarily for use via the Galaxy interface.

            Comment

            • simpson
              Member
              • Dec 2012
              • 11

              #7
              Originally posted by maubp View Post
              Download the 'raw' python script and save it in your folder as blastxml_to_tabular.py then:

              Code:
              $ python blastxml_to_tabular.py
              Expect 3 arguments: input BLAST XML file, output tabular file, out format (std or ext)
              For example, if you want the standard 12 column tab separated variables,

              Code:
              $ python blastxml_to_tabular.py example.xml example.tsv std
              If you want more details, it does an extended 24 column output mode too:

              Code:
              $ python blastxml_to_tabular.py example.xml example.tsv ext
              The command line interface was deliberately minimal as this was intended primarily for use via the Galaxy interface.
              Traceback (most recent call last):
              File "xml.py", line 70, in <module>
              import xml.etree.cElementTree as ElementTree
              File "/scratch/hpc/tianwenl/blastall/xml.py", line 70, in <module>
              import xml.etree.cElementTree as ElementTree
              ImportError: No module named etree.cElementTree
              [tianwenl@submit1 blastall]$ module load python
              [tianwenl@submit1 blastall]$ python xml.py jatropha.unigene20.nr.xml jatropha.tabular.tsv ext
              Traceback (most recent call last):
              File "xml.py", line 70, in <module>
              import xml.etree.cElementTree as ElementTree
              File "/scratch/hpc/tianwenl/blastall/xml.py", line 70, in <module>
              import xml.etree.cElementTree as ElementTree
              ImportError: No module named etree.cElementTree
              [tianwenl@submit1 blastall]$ python xml.py jatropha.unigene20.nr.xml jatropha.tabular.tsv std
              Traceback (most recent call last):
              File "xml.py", line 70, in <module>
              import xml.etree.cElementTree as ElementTree
              File "/scratch/hpc/tianwenl/blastall/xml.py", line 70, in <module>
              import xml.etree.cElementTree as ElementTree
              ImportError: No module named etree.cElementTree

              Comment

              • maubp
                Peter (Biopython etc)
                • Jul 2009
                • 1544

                #8
                What version of python do you have?

                Comment

                • simpson
                  Member
                  • Dec 2012
                  • 11

                  #9
                  Originally posted by maubp View Post
                  What version of python do you have?
                  it is biopython 1.59

                  Comment

                  • maubp
                    Peter (Biopython etc)
                    • Jul 2009
                    • 1544

                    #10
                    This script doesn't use Biopython - I meant which version of Python do you have? e.g. python 2.5?

                    Comment

                    • simpson
                      Member
                      • Dec 2012
                      • 11

                      #11
                      Originally posted by maubp View Post
                      This script doesn't use Biopython - I meant which version of Python do you have? e.g. python 2.5?
                      sorry - -

                      Python 2.6.6 (r266:84292, Oct 12 2012, 14:23:48)

                      Comment

                      • maubp
                        Peter (Biopython etc)
                        • Jul 2009
                        • 1544

                        #12
                        Strange. The cElementTree library would normally be included with Python, however I've updated the script to fall back on the pure Python ElementTree library instead. Could you try that please (same link - that points at the latest version)? Thanks.

                        Comment

                        • simpson
                          Member
                          • Dec 2012
                          • 11

                          #13
                          it's working now!!!
                          Thank you very much!!


                          Originally posted by maubp View Post
                          Strange. The cElementTree library would normally be included with Python, however I've updated the script to fall back on the pure Python ElementTree library instead. Could you try that please (same link - that points at the latest version)? Thanks.

                          Comment

                          • amitbik
                            Member
                            • May 2013
                            • 53

                            #14
                            Hi.. maubp

                            I want to convert blast xml output to tabular form. I followed your link but it is not opening.
                            Can you send the again?

                            Thank you......

                            Comment

                            • maubp
                              Peter (Biopython etc)
                              • Jul 2009
                              • 1544

                              #15
                              Originally posted by amitbik View Post
                              Hi.. maubp

                              I want to convert blast xml output to tabular form. I followed your link but it is not opening.
                              Can you send the again?

                              Thank you......
                              Sorry - the old BitBucket link is dead now, that code moved to GitHub:

                              Comment

                              Latest Articles

                              Collapse

                              • SEQadmin2
                                Beyond CRISPR/Cas9: Understand, Choose, and Use the Right Genome Editing Tool
                                by SEQadmin2



                                CRISPR/Cas9 sparked the gene editing revolution for both research and therapeutics.1 But this system still showed severe issues that limited its applications. The most prominent were the heavy reliance on PAM sequences, delivery limitations, double-stranded breaks that prompt unintended edits and cell death, and editing inefficiency (both in targeting and in knock-in reliability).

                                Despite this, “CRISPR helped turn genome editing from a specialized technique into
                                ...
                                07-31-2026, 11:01 AM
                              • SEQadmin2
                                Proteomic Platforms: How to Choose the Right Analytical Strategy to Improve Detection and Clinical Applications
                                by SEQadmin2


                                Proteomics platforms are evolving rapidly, with advances in mass spectrometry and affinity-based approaches expanding what researchers can detect and at what scale. As the field moves toward deeper proteome coverage and clinical applications, scientists face an increasingly complex landscape of tools. This article will explore how researchers are navigating these choices to find the right platform for their work.

                                The systematic characterization of the human proteome has
                                ...
                                07-20-2026, 11:48 AM
                              • SEQadmin2
                                Advanced Sequencing Platforms Tackle Neuroscience’s Toughest Genomics Problems
                                by SEQadmin2



                                Genomics studies in neuroscience face a special challenge due to the brain’s complexity and scarcity of samples. Mapping changes in cell type and state using conventional next-generation sequencing methods remains challenging. Advances in technologies like single-cell sequencing, spatial transcriptomics, and long-read sequencing have opened the door to deeper studies of the brain and diseases like Alzheimer’s, amyotrophic lateral sclerosis (ALS), and schizophrenia.
                                ...
                                07-09-2026, 11:10 AM

                              ad_right_rmr

                              Collapse

                              News

                              Collapse

                              Topics Statistics Last Post
                              Started by SEQadmin2, Yesterday, 07:41 AM
                              0 responses
                              12 views
                              0 reactions
                              Last Post SEQadmin2  
                              Started by SEQadmin2, 08-03-2026, 10:13 AM
                              0 responses
                              25 views
                              0 reactions
                              Last Post SEQadmin2  
                              Started by SEQadmin2, 07-31-2026, 02:55 AM
                              0 responses
                              38 views
                              0 reactions
                              Last Post SEQadmin2  
                              Started by SEQadmin2, 07-24-2026, 12:17 PM
                              0 responses
                              25 views
                              0 reactions
                              Last Post SEQadmin2  
                              Working...