本文整理汇总了Python中htsworkflow.pipelines.ElementTree.parse方法的典型用法代码示例。如果您正苦于以下问题:Python ElementTree.parse方法的具体用法?Python ElementTree.parse怎么用?Python ElementTree.parse使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类htsworkflow.pipelines.ElementTree
的用法示例。
在下文中一共展示了ElementTree.parse方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: gerald
# 需要导入模块: from htsworkflow.pipelines import ElementTree [as 别名]
# 或者: from htsworkflow.pipelines.ElementTree import parse [as 别名]
def gerald(pathname):
LOGGER.info("Parsing gerald config.xml")
pathname = os.path.expanduser(pathname)
config_pathname = os.path.join(pathname, 'config.xml')
config_tree = ElementTree.parse(config_pathname).getroot()
# parse Summary.htm file
summary_xml = os.path.join(pathname, 'Summary.xml')
summary_htm = os.path.join(pathname, 'Summary.htm')
report_summary = os.path.join(pathname, '..', 'Data',
'reports', 'Summary', )
if os.path.exists(summary_xml):
g = Gerald(pathname = pathname, tree=config_tree)
LOGGER.info("Parsing Summary.xml")
g.summary = SummaryGA(summary_xml)
g.eland_results = eland(g.pathname, g)
elif os.path.exists(summary_htm):
g = Gerald(pathname=pathname, tree=config_tree)
LOGGER.info("Parsing Summary.htm")
g.summary = SummaryGA(summary_htm)
g.eland_results = eland(g.pathname, g)
elif os.path.isdir(report_summary):
g = CASAVA(pathname=pathname, tree=config_tree)
LOGGER.info("Parsing %s" % (report_summary,))
g.summary = SummaryHiSeq(report_summary)
g.eland_results = eland(g.pathname, g)
# parse eland files
return g
示例2: bustard_from_hiseq
# 需要导入模块: from htsworkflow.pipelines import ElementTree [as 别名]
# 或者: from htsworkflow.pipelines.ElementTree import parse [as 别名]
def bustard_from_hiseq(pathname, config_filename):
b = Bustard()
b.pathname = pathname
bustard_config_root = ElementTree.parse(config_filename)
b.bustard_config = bustard_config_root.getroot()
add_phasing(b)
return b
示例3: _initialize_from_file
# 需要导入模块: from htsworkflow.pipelines import ElementTree [as 别名]
# 或者: from htsworkflow.pipelines.ElementTree import parse [as 别名]
def _initialize_from_file(self, pathname):
path, name = os.path.split(pathname)
basename, ext = os.path.splitext(name)
# the last character of the param base filename should be the
# lane number
tree = ElementTree.parse(pathname).getroot()
self.set_elements(tree)
self.lane = int(basename[-1])
示例4: _get_flowcell_id_from_flowcellid
# 需要导入模块: from htsworkflow.pipelines import ElementTree [as 别名]
# 或者: from htsworkflow.pipelines.ElementTree import parse [as 别名]
def _get_flowcell_id_from_flowcellid(self):
"""Extract flowcell id from a Config/FlowcellId.xml file
:return: flowcell_id or None if not found
"""
config_dir = os.path.join(self.pathname, 'Config')
flowcell_id_path = os.path.join(config_dir, 'FlowcellId.xml')
if os.path.exists(flowcell_id_path):
flowcell_id_tree = ElementTree.parse(flowcell_id_path)
return flowcell_id_tree.findtext('Text')
示例5: load_pipeline_run_xml
# 需要导入模块: from htsworkflow.pipelines import ElementTree [as 别名]
# 或者: from htsworkflow.pipelines.ElementTree import parse [as 别名]
def load_pipeline_run_xml(pathname):
"""
Load and instantiate a Pipeline run from a run xml file
:Parameters:
- `pathname` location of an run xml file
:Returns: initialized PipelineRun object
"""
tree = ElementTree.parse(pathname).getroot()
run = PipelineRun(xml=tree)
return run
示例6: load
# 需要导入模块: from htsworkflow.pipelines import ElementTree [as 别名]
# 或者: from htsworkflow.pipelines.ElementTree import parse [as 别名]
def load(self, filename):
"""Load a run xml into this object.
:Parameters:
- `filename` location of a run xml file
:Types:
- `filename` str
"""
LOGGER.info("Loading run report from " + filename)
tree = ElementTree.parse(filename).getroot()
self.set_elements(tree)
示例7: _get_flowcell_id_from_runinfo
# 需要导入模块: from htsworkflow.pipelines import ElementTree [as 别名]
# 或者: from htsworkflow.pipelines.ElementTree import parse [as 别名]
def _get_flowcell_id_from_runinfo(self):
"""Read RunInfo file for flowcell id
:return: flowcell_id or None if not found
"""
runinfo = os.path.join(self.pathname, 'RunInfo.xml')
if os.path.exists(runinfo):
tree = ElementTree.parse(runinfo)
root = tree.getroot()
fc_nodes = root.xpath('/RunInfo/Run/Flowcell')
if len(fc_nodes) == 1:
return fc_nodes[0].text
示例8: load_ipar_param_tree
# 需要导入模块: from htsworkflow.pipelines import ElementTree [as 别名]
# 或者: from htsworkflow.pipelines.ElementTree import parse [as 别名]
def load_ipar_param_tree(paramfile):
"""
look for a .param file and load it if it is an IPAR tree
"""
tree = ElementTree.parse(paramfile).getroot()
run = tree.find('Run')
if run.attrib.get('Name', None) in SOFTWARE_NAMES:
return run
else:
LOGGER.info("No run found")
return None
示例9: bustard_from_ga2
# 需要导入模块: from htsworkflow.pipelines import ElementTree [as 别名]
# 或者: from htsworkflow.pipelines.ElementTree import parse [as 别名]
def bustard_from_ga2(pathname, config_filename):
"""Initialize bustard class from ga2-era runfolder
Actually I don't quite remember if it is exactly the GA2s, but
its after the original runfolder style and before the HiSeq.
"""
# for version 1.3.2 of the pipeline the bustard version number went down
# to match the rest of the pipeline. However there's now a nifty
# new (useful) bustard config file.
# stub values
b = Bustard()
b.pathname = pathname
b.update_attributes_from_pathname()
bustard_config_root = ElementTree.parse(config_filename)
b.bustard_config = bustard_config_root.getroot()
b.crosstalk = crosstalk_matrix_from_bustard_config(b.pathname,
b.bustard_config)
add_phasing(b)
return b
示例10: parse_genomesize
# 需要导入模块: from htsworkflow.pipelines import ElementTree [as 别名]
# 或者: from htsworkflow.pipelines.ElementTree import parse [as 别名]
def parse_genomesize(self, pathname):
"""Parse genomesize.xml file
"""
tree = ElementTree.parse(pathname)
self.build_map_from_element(tree.getroot())