Snakemake utils
Project description
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 thein_files
list producing output files from theout_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)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
snakemakeutils-0.1.1.tar.gz
(2.9 kB
view details)
File details
Details for the file snakemakeutils-0.1.1.tar.gz
.
File metadata
- Download URL: snakemakeutils-0.1.1.tar.gz
- Upload date:
- Size: 2.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2f43b65a4880c792d65d17febc76f334f1fc63668ed6fe89c668e1d7d7e1613d |
|
MD5 | b66aac5338bc7e9fea5fdacd5777b1eb |
|
BLAKE2b-256 | 3b86cf787d098f4ec88543f98291a573d81ad41dfe42f850d868a04859c075ed |