1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/changeset/5adbc8515631/ changeset: 5adbc8515631 user: jgoecks date: 2012-08-28 15:05:31 summary: Fixes for phyloviz parser and a4c7aeb61c7b. affected #: 2 files
diff -r a4c7aeb61c7b8e76fcf3fd96d0d351be88d1c1d1 -r 5adbc8515631847cb66378ea28e644344d890265 lib/galaxy/visualization/phyloviz/phyloviz_dataprovider.py --- a/lib/galaxy/visualization/phyloviz/phyloviz_dataprovider.py +++ b/lib/galaxy/visualization/phyloviz/phyloviz_dataprovider.py @@ -1,6 +1,6 @@ from newickparser import Newick_Parser from nexusparser import Nexus_Parser -#from phyloxmlparser import Phyloxml_Parser +from phyloxmlparser import Phyloxml_Parser
class Phyloviz_DataProvider(object):
@@ -16,9 +16,9 @@ if fileExt == "nhx": # parses newick files newickParser = Newick_Parser() jsonDicts, parseMsg = newickParser.parseFile(filepath) - #elif fileExt == "phyloxml": # parses phyloXML files - # phyloxmlParser = Phyloxml_Parser() - # jsonDicts, parseMsg = phyloxmlParser.parseFile(filepath) + elif fileExt == "phyloxml": # parses phyloXML files + phyloxmlParser = Phyloxml_Parser() + jsonDicts, parseMsg = phyloxmlParser.parseFile(filepath) elif fileExt == "nex": # parses nexus files nexusParser = Nexus_Parser() jsonDicts, parseMsg = nexusParser.parseFile(filepath)
diff -r a4c7aeb61c7b8e76fcf3fd96d0d351be88d1c1d1 -r 5adbc8515631847cb66378ea28e644344d890265 lib/galaxy/visualization/phyloviz/phyloxmlparser.py --- a/lib/galaxy/visualization/phyloviz/phyloxmlparser.py +++ b/lib/galaxy/visualization/phyloviz/phyloxmlparser.py @@ -1,8 +1,5 @@ from baseparser import Base_Parser, PhyloTree, Node - -''' -TOD0: use native Python XML parser. -from lxml import etree +from xml.etree import ElementTree
class Phyloxml_Parser(Base_Parser): """Parses a phyloxml file into a json file that will be passed to PhyloViz for display""" @@ -22,7 +19,7 @@ """passes a file and extracts its Phylogeny Tree content.""" phyloXmlFile = open(filePath, "r")
- xmlTree = etree.parse(phyloXmlFile) + xmlTree = ElementTree.parse(phyloXmlFile) xmlRoot = xmlTree.getroot()[0] self.nameSpaceIndex = xmlRoot.tag.rfind("}") + 1 # used later by the clean tag method to remove the name space in every element.tag
@@ -134,16 +131,4 @@
def cleanTag(self, tagString): return tagString[self.nameSpaceIndex:] - - -if __name__=="__main__": - - # Files tested against - parser = Phyloxml_Parser() - filepath = "../data/" +"apaf.xml" - # filepath = "../data/" +"12_multiple_supports.xml" - - # filepath = "../data/" +"bcl_2.xml" - # filepath = "../data/" +"reducedXml.xml" - parser.parseFile(filepath) -''' \ No newline at end of file + \ No newline at end of file
Repository URL: https://bitbucket.org/galaxy/galaxy-central/
--
This is a commit notification from bitbucket.org. You are receiving this because you have the service enabled, addressing the recipient of this email.
galaxy-commits@lists.galaxyproject.org