Seqanswers Leaderboard Ad

Collapse

Announcement

Collapse
No announcement yet.
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • 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

  • #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


    • #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


      • #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


        • #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


          • #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


            • #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


              • #8
                What version of python do you have?

                Comment


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

                  Comment


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

                    Comment


                    • #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


                      • #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


                        • #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


                          • #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


                            • #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

                              • seqadmin
                                Recent Advances in Sequencing Analysis Tools
                                by seqadmin


                                The sequencing world is rapidly changing due to declining costs, enhanced accuracies, and the advent of newer, cutting-edge instruments. Equally important to these developments are improvements in sequencing analysis, a process that converts vast amounts of raw data into a comprehensible and meaningful form. This complex task requires expertise and the right analysis tools. In this article, we highlight the progress and innovation in sequencing analysis by reviewing several of the...
                                Yesterday, 07:48 AM
                              • seqadmin
                                Essential Discoveries and Tools in Epitranscriptomics
                                by seqadmin




                                The field of epigenetics has traditionally concentrated more on DNA and how changes like methylation and phosphorylation of histones impact gene expression and regulation. However, our increased understanding of RNA modifications and their importance in cellular processes has led to a rise in epitranscriptomics research. “Epitranscriptomics brings together the concepts of epigenetics and gene expression,” explained Adrien Leger, PhD, Principal Research Scientist...
                                04-22-2024, 07:01 AM

                              ad_right_rmr

                              Collapse

                              News

                              Collapse

                              Topics Statistics Last Post
                              Started by seqadmin, Today, 06:57 AM
                              0 responses
                              9 views
                              0 likes
                              Last Post seqadmin  
                              Started by seqadmin, Yesterday, 07:17 AM
                              0 responses
                              13 views
                              0 likes
                              Last Post seqadmin  
                              Started by seqadmin, 05-02-2024, 08:06 AM
                              0 responses
                              19 views
                              0 likes
                              Last Post seqadmin  
                              Started by seqadmin, 04-30-2024, 12:17 PM
                              0 responses
                              22 views
                              0 likes
                              Last Post seqadmin  
                              Working...
                              X