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
                                Multiomic Liquid Biopsy: What DNA/RNA Panels Reveal That DNA Alone Can’t
                                by SEQadmin2



                                Tumors contain complex mixtures of cell populations that evolve in response to treatment and host-specific factors. Tissue biopsies provide only static snapshots of a tumor’s state. But what if we could follow that evolution over time using a minimally invasive technique?

                                Liquid biopsies can detect tumor-derived material circulating in the bloodstream, providing a way to study treatment response, detect emerging resistance, and discover new biomarkers. Circulating
                                ...
                                Today, 09:55 AM
                              • SEQadmin2
                                New Genomics Technologies Take Aim at Long-Standing Limits
                                by SEQadmin2


                                Researchers using sequencing and genomics tools often have to make trade-offs. They can choose between speed or scale, short reads or long-range information, or targeted panels or a view of the whole transcriptome. New technologies that have been released this year are built to address those tough choices.

                                We asked six companies the same four questions to learn about their latest products. The new technologies bring a lot to the table, including rethinking sequencing
                                ...
                                09-28-2026, 10:25 AM

                              ad_right_rmr

                              Collapse

                              News

                              Collapse

                              Topics Statistics Last Post
                              Started by SEQadmin2, Today, 05:39 AM
                              0 responses
                              9 views
                              0 reactions
                              Last Post SEQadmin2  
                              Started by SEQadmin2, Yesterday, 09:56 AM
                              0 responses
                              11 views
                              0 reactions
                              Last Post SEQadmin2  
                              Started by SEQadmin2, 10-09-2026, 11:14 AM
                              0 responses
                              25 views
                              0 reactions
                              Last Post SEQadmin2  
                              Started by SEQadmin2, 09-29-2026, 09:51 AM
                              0 responses
                              76 views
                              0 reactions
                              Last Post SEQadmin2  
                              Working...