Skip to content

Commit

Permalink
feat(rule): add Split N CIGAR rule
Browse files Browse the repository at this point in the history
  • Loading branch information
fcaretti committed Jun 14, 2024
1 parent 8cf3c10 commit b2b38bb
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 4 deletions.
8 changes: 4 additions & 4 deletions workflow/Snakefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import glob
import os


configfile: ".test/config/config.yml"
configfile: "config/config.yml"


# Access the data folder from the config
Expand All @@ -16,17 +16,17 @@ reference_dict = f"{reference}.dict"
sample_files = glob.glob(os.path.join(data_folder, "*.bam"))
samples = [os.path.basename(f).replace(".bam", "") for f in sample_files]

read_groups = [f"results/grouped/{sample}.bam" for sample in samples]
deduped_files = [f"results/dedup/{sample}.bam" for sample in samples]
splitted_files = [f"results/split/{sample}.bam" for sample in samples]


rule all:
input:
deduped_files,
splitted_files,
reference_idx,
reference_dict,


include: "rules/add_or_replace_rg.smk"
include: "rules/mark_duplicates.smk"
include: "rules/index_genome.smk"
include: "rules/split_n_cigar_reads.smk"
17 changes: 17 additions & 0 deletions workflow/rules/split_n_cigar_reads.smk
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
rule splitncigarreads:
input:
bam="results/dedup/{sample}.bam",
ref=reference,
idx=reference_idx,
dict=reference_dict,
output:
temp("results/split/{sample}.bam"),
log:
"logs/splitNCIGARreads/{sample}.log",
params:
extra="", # optional
java_mem_overhead_mb=512, # Specify overhead for non-heap memory
resources:
mem_mb=4096, # Total memory available for the rule
wrapper:
"v3.12.1/bio/gatk/splitncigarreads"

0 comments on commit b2b38bb

Please sign in to comment.