Commit 4d011079 authored by Blaise Li's avatar Blaise Li
Browse files

Packaging snakemake wrappers.

parent be88479c
......@@ -32,6 +32,7 @@ from libworkflows import last_lines, ensure_relative, SHELL_FUNCTIONS, warn_cont
from libworkflows import feature_orientation2stranded
from libworkflows import sum_by_family, read_feature_counts, sum_feature_counts
from smincludes import rules as irules
from smwrappers import wrappers_dir
# Define functions to be used in shell portions
shell.prefix(SHELL_FUNCTIONS)
......@@ -426,7 +427,7 @@ rule map_on_genome:
err = OPJ(log_dir, "{trimmer}", aligner, "map_{read_type}_on_genome", "{lib}_{rep}.err"),
threads: 12
wrapper:
"file:///pasteur/homes/bli/src/bioinfo_utils/snakemake_wrappers/map_on_genome"
f"file://{wrappers_dir}/map_on_genome"
rule remap_on_genome:
......@@ -454,7 +455,7 @@ rule remap_on_genome:
err = OPJ(log_dir, "{trimmer}", aligner, "remap_{read_type}_unmapped_on_genome", "{lib}_{rep}.err"),
threads: 12
wrapper:
"file:///pasteur/homes/bli/src/bioinfo_utils/snakemake_wrappers/map_on_genome"
f"file://{wrappers_dir}/map_on_genome"
rule sam2indexedbam:
......@@ -473,7 +474,7 @@ rule sam2indexedbam:
resources:
mem_mb=4100
wrapper:
"file:///pasteur/homes/bli/src/bioinfo_utils/snakemake_wrappers/sam2indexedbam"
f"file://{wrappers_dir}/sam2indexedbam"
rule compute_mapping_stats:
......
......@@ -20,6 +20,7 @@ from functools import reduce
from operator import or_ as union
from smincludes import rules as irules
from smwrappers import wrappers_dir
from libworkflows import (
cleanup_and_backup,
column_converter,
......@@ -169,7 +170,7 @@ rule map_on_genome:
threads:
4
wrapper:
"file:///pasteur/homes/bli/src/bioinfo_utils/snakemake_wrappers/map_on_genome"
f"file://{wrappers_dir}/map_on_genome"
rule sam2indexedbam:
......@@ -188,7 +189,7 @@ rule sam2indexedbam:
resources:
mem_mb=4100
wrapper:
"file:///pasteur/homes/bli/src/bioinfo_utils/snakemake_wrappers/sam2indexedbam"
f"file://{wrappers_dir}/sam2indexedbam"
def biotype2annot(wildcards):
......@@ -395,7 +396,7 @@ rule compute_RPK:
# rpk = 1000 * counts_data.loc[common].div(feature_lengths.loc[common]["union_exon_len"], axis="index")
# rpk.to_csv(output.rpk_file, sep="\t")
wrapper:
"file:///pasteur/homes/bli/src/bioinfo_utils/snakemake_wrappers/compute_RPK"
f"file://{wrappers_dir}/compute_RPK"
# Compute TPM using total number of mappers divided by genome length
......@@ -417,7 +418,7 @@ rule compute_TPM:
# tpm = 1000000 * rpk / rpk.sum()
# tpm.to_csv(output.tpm_file, sep="\t")
wrapper:
"file:///pasteur/homes/bli/src/bioinfo_utils/snakemake_wrappers/compute_TPM"
f"file://{wrappers_dir}/compute_TPM"
# TODO: Is it better to compute the mean and then the fold of the means?
......
......@@ -70,6 +70,7 @@ from libworkflows import sum_by_family
from libworkflows import read_htseq_counts, sum_htseq_counts
from libworkflows import read_feature_counts, sum_feature_counts
from smincludes import rules as irules
from smwrappers import wrappers_dir
alignment_settings = {"bowtie2": ""}
......@@ -490,7 +491,7 @@ rule map_on_genome:
# eval ${{cmd}} 1>> {log.log} 2>> {log.err}
# """
wrapper:
"file:///pasteur/homes/bli/src/bioinfo_utils/snakemake_wrappers/map_on_genome"
f"file://{wrappers_dir}/map_on_genome"
rule sam2indexedbam:
......@@ -509,7 +510,7 @@ rule sam2indexedbam:
resources:
mem_mb=4100
wrapper:
"file:///pasteur/homes/bli/src/bioinfo_utils/snakemake_wrappers/sam2indexedbam"
f"file://{wrappers_dir}/sam2indexedbam"
rule fuse_bams:
......@@ -654,7 +655,7 @@ rule htseq_count_reads:
log = OPJ(log_dir, "{trimmer}", "htseq_count_reads", "{lib}_{rep}_{biotype}_{orientation}.log"),
err = OPJ(log_dir, "{trimmer}", "htseq_count_reads", "{lib}_{rep}_{biotype}_{orientation}.err")
wrapper:
"file:///pasteur/homes/bli/src/bioinfo_utils/snakemake_wrappers/htseq_count_reads"
f"file://{wrappers_dir}/htseq_count_reads"
def parse_htseq_counts(counts_filename):
......@@ -963,7 +964,7 @@ rule compute_RPK:
# rpk = 1000 * counts_data.loc[common].div(feature_lengths.loc[common]["union_exon_len"], axis="index")
# rpk.to_csv(output.rpk_file, sep="\t")
wrapper:
"file:///pasteur/homes/bli/src/bioinfo_utils/snakemake_wrappers/compute_RPK"
f"file://{wrappers_dir}/compute_RPK"
rule compute_sum_million_RPK:
......@@ -994,7 +995,7 @@ rule compute_TPM:
# tpm = 1000000 * rpk / rpk.sum()
# tpm.to_csv(output.tpm_file, sep="\t")
wrapper:
"file:///pasteur/homes/bli/src/bioinfo_utils/snakemake_wrappers/compute_TPM"
f"file://{wrappers_dir}/compute_TPM"
@wc_applied
......
......@@ -107,6 +107,7 @@ from libworkflows import read_htseq_counts, sum_htseq_counts
from libworkflows import read_intersect_counts, sum_intersect_counts
from libworkflows import read_feature_counts, sum_feature_counts
from smincludes import rules as irules
from smwrappers import wrappers_dir
alignment_settings = {"bowtie2": "", "hisat2": "", "crac": "-k 20 --stranded --use-x-in-cigar"}
......@@ -565,7 +566,7 @@ rule map_on_genome:
#shell:
# mapping_command(aligner)
wrapper:
"file:///pasteur/homes/bli/src/bioinfo_utils/snakemake_wrappers/map_on_genome"
f"file://{wrappers_dir}/map_on_genome"
rule extract_nomap_polyU:
......@@ -618,7 +619,7 @@ rule remap_on_genome:
#shell:
# mapping_command(aligner)
wrapper:
"file:///pasteur/homes/bli/src/bioinfo_utils/snakemake_wrappers/map_on_genome"
f"file://{wrappers_dir}/map_on_genome"
def source_sam(wildcards):
......@@ -658,7 +659,7 @@ rule sam2indexedbam:
threads:
8
wrapper:
"file:///pasteur/homes/bli/src/bioinfo_utils/snakemake_wrappers/sam2indexedbam"
f"file://{wrappers_dir}/sam2indexedbam"
rule compute_mapping_stats:
......@@ -837,7 +838,7 @@ def biotype2annot(wildcards):
# log = OPJ(log_dir, "htseq_count_reads", "{lib}_{rep}_{biotype}_{orientation}.log"),
# err = OPJ(log_dir, "htseq_count_reads", "{lib}_{rep}_{biotype}_{orientation}.err"),
# wrapper:
# "file:///pasteur/homes/bli/src/bioinfo_utils/snakemake_wrappers/htseq_count_reads"
# f"file://{wrappers_dir}/htseq_count_reads"
def source_sorted_bam(wildcards):
......@@ -983,7 +984,7 @@ rule feature_count_reads:
# err = OPJ(log_dir, "intersect_count_reads", "{lib}_{rep}_{biotype}_{orientation}.err"),
# threads: 4 # to limit memory usage, actually
# wrapper:
# "file:///pasteur/homes/bli/src/bioinfo_utils/snakemake_wrappers/intersect_count_reads"
# f"file://{wrappers_dir}/intersect_count_reads"
rule summarize_counts:
......@@ -1107,7 +1108,7 @@ rule compute_RPK:
# rpk = 1000 * counts_data.loc[common].div(feature_lengths.loc[common]["union_exon_len"], axis="index")
# rpk.to_csv(output.rpk_file, sep="\t")
wrapper:
"file:///pasteur/homes/bli/src/bioinfo_utils/snakemake_wrappers/compute_RPK"
f"file://{wrappers_dir}/compute_RPK"
rule compute_sum_million_RPK:
......@@ -1142,7 +1143,7 @@ rule compute_TPM:
# tpm = 1000000 * rpk / rpk.sum()
# tpm.to_csv(output.tpm_file, sep="\t")
wrapper:
"file:///pasteur/homes/bli/src/bioinfo_utils/snakemake_wrappers/compute_TPM"
f"file://{wrappers_dir}/compute_TPM"
# Useful to compute translation efficiency in the Ribo-seq pipeline
......
......@@ -139,6 +139,7 @@ from libworkflows import get_chrom_sizes, column_converter, make_id_list_getter
from libworkflows import read_int_from_file, strip_split, file_len, last_lines, save_plot, SHELL_FUNCTIONS
from libworkflows import sum_by_family, read_feature_counts, sum_feature_counts, sum_htseq_counts, warn_context
from smincludes import rules as irules
from smwrappers import wrappers_dir
strip = str.strip
alignment_settings = {"bowtie2": "-L 6 -i S,1,0.8 -N 0"}
......@@ -751,7 +752,7 @@ rule map_on_genome:
threads:
4
wrapper:
"file:///pasteur/homes/bli/src/bioinfo_utils/snakemake_wrappers/map_on_genome"
f"file://{wrappers_dir}/map_on_genome"
def source_sam(wildcards):
......@@ -785,7 +786,7 @@ rule sam2indexedbam:
resources:
mem_mb=4100
wrapper:
"file:///pasteur/homes/bli/src/bioinfo_utils/snakemake_wrappers/sam2indexedbam"
f"file://{wrappers_dir}/sam2indexedbam"
rule compute_mapping_stats:
......
snakemake_wrappers @ 6bbed10e
Subproject commit e8105a64fe84747d407b19ca8db69bd54b66cb2e
Subproject commit 6bbed10e5ab6f8b195a0a562376fbc5bc487cb06
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment