Skip to main content

Snakemake utils

A set of utility function for use in snakemake. Currently, for line-based transformations.

Functions:

  • map_chars(cmap) - will translate characters using the given dictionary cmap.

  • del_char_idx(idx) - will delete the char at the given index.

  • del_char(char) - will delete all characters matching char param.

  • del_line(regex) - will delete line if it matches the given regex.

  • apply(trans, encoding, in_files, out_files) - will apply all transformations given in trans list to all lines in the in_files list producing output files from the out_files list.

Example

rule fixchars:
    input:
        "{natfile}.nat"
    output:
        "{natfile}-ch.nat"
    message:
        "Fixing/deleting chars/lines..."

    run:
        from snakemakeutils import del_char_val, del_char_idx, apply
        trans = [del_char_val('\x00'), del_char_idx(0)]
        apply(trans, "latin1", input, output)

Metadata

Release files for snakemakeutils 0.1.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for snakemakeutils 0.1.2
File Size Uploaded Provenance Actions
snakemakeutils-0.1.2.tar.gz 3.0 kB Without provenance Details for snakemakeutils-0.1.2.tar.gz

Release files / snakemakeutils-0.1.2.tar.gz

Download URL snakemakeutils-0.1.2.tar.gz
Size 3.0 kB
Tags Source
SHA-256 checksum
How to use checksums
254650a4b32629b4b5957e37e72b879453d4b5b09a66fb45ee0395cfaa6c00b4
BLAKE2b-256 checksum
How to use checksums
3d922332045acc02f37f913b7db27ae9c7fbcf0b01a8969ebc515aa9022995d4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Security for snakemakeutils 0.1.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.2 This release

1 release file No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page