PyPop.Meta#

Module for collecting multiple population outputs.

Classes#

Meta

Aggregates output from multiple population runs.

Functions#

translate_string_to_stdout(xslFilename, inString[, ...])

Transform XML string using XSLT and save to stdout.

translate_string_to_file(xslFilename, inString, outFile)

Transform XML string using XSLT and save to file.

translate_file_to_stdout(xslFilename, inFile[, ...])

Transform XML file using XSLT and save to stdout.

translate_file_to_file(xslFilename, inFile, outFile[, ...])

Transform XML file using XSLT and save to a file.

Module Contents#

class Meta(popmetabinpath=None, datapath=None, metaXSLTDirectory=None, dump_meta=False, TSV_output=True, prefixTSV=None, PHYLIP_output=False, ihwg_output=False, batchsize=0, outputDir=None, xml_files=None)#

Aggregates output from multiple population runs.

Transform a specified list of .xml output files to .tsv tab-separated values (TSV) form.

Parameters:
  • popmetabinpath (str) – the directory for where meta sources are kept

  • datapath (str) – data where XSLT and other meta sources may be kept

  • metaXSLTDirectory (str) – fallback XSLT directory

  • dump_meta (bool) – create the meta.xml file (default to False,)

  • TSV_output (bool) – output .tsv tables by default (enabled by default). (such tables can be used by R)

  • prefixTSV (str) – prefix to use for all .tsv files

  • PHYLIP_output (bool) – create PHYLIP output (disabled by default)

  • ihwg_output (bool) – by default, don’t enable the 13th IHWG format headers

  • batchsize (int) – size of batches to process separately (default batchsize=0, a separate batch for each file)

  • outputDir (str) – output directory to write XML files to

  • xml_files (list) – list of generate XML files

translate_string_to_stdout(xslFilename, inString, outputDir=None, params=None)#

Transform XML string using XSLT and save to stdout.

Parameters:
  • xslFilename (str) – name of XSLT file

  • inString (str) – XML string

  • outputDir (str, optional) – name of output directory

  • params (list, optional) – list of XSLT parameters

translate_string_to_file(xslFilename, inString, outFile, outputDir=None, params=None)#

Transform XML string using XSLT and save to file.

Parameters:
  • xslFilename (str) – name of XSLT file

  • inString (str) – XML string

  • outFile (str) – name of output file

  • outputDir (str) – name of output directory

  • params (list) – list of XSLT parameters

translate_file_to_stdout(xslFilename, inFile, inputDir=None, params=None)#

Transform XML file using XSLT and save to stdout.

Parameters:
  • xslFilename (str) – name of XSLT file

  • inFile (str) – name of input XML file

  • inputDir (str, optional) – name of input directory

  • params (list, optional) – list of XSLT parameters

Returns:

consisting of a bool (transformation successful) and str (output)

Return type:

tuple

translate_file_to_file(xslFilename, inFile, outFile, inputDir=None, outputDir=None, params=None)#

Transform XML file using XSLT and save to a file.

Parameters:
  • xslFilename (str) – name of XSLT file

  • inFile (str) – name of input XML file

  • outFile (str) – name of output file

  • inputDir (str, optional) – name of input directory

  • outputDir (str, optional) – name of output directory

  • params (list, optional) – list of XSLT parameters

Returns:

transformation successful

Return type:

bool