snakemake.utils.
R
(code)[source]¶Execute R code
This function executes the R code given as a string. The function requires rpy2 to be installed.
Parameters: | code (str) – R code to be executed |
---|
snakemake.utils.
format
(_pattern, *args, stepout=1, **kwargs)[source]¶Format a pattern in Snakemake style.
This means that keywords embedded in braces are replaced by any variable values that are available in the current namespace.
snakemake.utils.
linecount
(filename)[source]¶Return the number of lines of given file.
Parameters: | filename (str) – the path to the file |
---|
snakemake.utils.
listfiles
(pattern, restriction=None, omit_value=None)[source]¶Yield a tuple of existing filepaths for the given pattern.
Wildcard values are yielded as the second tuple item.
Parameters: |
|
---|---|
Yields: | tuple – The next file matching the pattern, and the corresponding wildcards object |
snakemake.utils.
makedirs
(dirnames)[source]¶Recursively create the given directory or directories without reporting errors if they are present.
snakemake.utils.
min_version
(version)[source]¶Require minimum snakemake version, raise workflow error if not met.
snakemake.utils.
read_job_properties
(jobscript, prefix='# properties', pattern=re.compile('# properties = (.*)'))[source]¶Read the job properties defined in a snakemake jobscript.
This function is a helper for writing custom wrappers for the snakemake –cluster functionality. Applying this function to a jobscript will return a dict containing information about the job.
snakemake.utils.
report
(text, path, stylesheet='/mount/gensoft2/src/snakemake/snakemake-snakemake-16c8b17007f8/snakemake/report.css', defaultenc='utf8', template=None, metadata=None, **files)[source]¶Create an HTML report using python docutils.
Attention: This function needs Python docutils to be installed for the python installation you use with Snakemake.
All keywords not listed below are intepreted as paths to files that shall be embedded into the document. They keywords will be available as link targets in the text. E.g. append a file as keyword arg via F1=input[0] and put a download link in the text like this:
report('''
==============
Report for ...
==============
Some text. A link to an embedded file: F1_.
Further text.
''', outputpath, F1=input[0])
Instead of specifying each file as a keyword arg, you can also expand
the input of your rule if it is completely named, e.g.:
report('''
Some text...
''', outputpath, **input)
Parameters: |
|
---|
snakemake.utils.
update_config
(config, overwrite_config)[source]¶Recursively update dictionary config with overwrite_config.
See http://stackoverflow.com/questions/3232943/update-value-of-a-nested-dictionary-of-varying-depth for details.
Parameters: |
|
---|