Skip to content

Commit

Permalink
removed bam coverage for ef bams, fixed logs
Browse files Browse the repository at this point in the history
  • Loading branch information
farchaab committed Nov 1, 2024
1 parent db88db9 commit 9c9f417
Showing 1 changed file with 7 additions and 23 deletions.
30 changes: 7 additions & 23 deletions mess/workflow/rules/processing/reads.smk
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,10 @@ if PASSES > 1:
contig + ".ccs.bam",
)
),
log:
os.path.join(
dir.out.logs, "sam2bam", "{sample}", "{fasta}", contig + ".ccs.log"
),
resources:
mem_mb=config.resources.sml.mem,
mem=str(config.resources.sml.mem) + "MB",
Expand All @@ -46,7 +50,7 @@ if PASSES > 1:
shell:
"""
samtools view -@ {threads} -Sb {input} | \\
samtools sort -@ {threads} -o {output}
samtools sort -@ {threads} -o {output} 2> {log}
"""

rule ccs_bam_to_fastq:
Expand Down Expand Up @@ -121,7 +125,7 @@ if BAM:
log:
os.path.join(
dir.out.logs,
"maf2paf",
"maf2sam",
"{sample}",
"{fasta}" + "_" + contig + ".log",
),
Expand Down Expand Up @@ -171,7 +175,6 @@ rule merge_bams:
log:
os.path.join(
dir.out.logs,
"samtools",
"merge",
"{sample}.log",
),
Expand Down Expand Up @@ -444,7 +447,7 @@ if ERRFREE:
temp(os.path.join(dir.out.ef, "{sample}", "{fasta}", contig + ".bam")),
log:
os.path.join(
dir.out.logs, "sam2bam", "{sample}", "{fasta}", contig + ".log"
dir.out.logs, "sam2bam", "{sample}", "{fasta}", contig + "_ef.log"
),
resources:
mem_mb=config.resources.sml.mem,
Expand Down Expand Up @@ -508,25 +511,6 @@ if ERRFREE:
samtools index -@ {threads} {input}
"""

rule get_bam_coverage_ef:
input:
os.path.join(dir.out.ef, "{sample}.bam"),
output:
temp(os.path.join(dir.out.ef, "{sample}.txt")),
resources:
mem_mb=config.resources.sml.mem,
mem=str(config.resources.sml.mem) + "MB",
time=config.resources.sml.time,
threads: config.resources.sml.cpu
conda:
os.path.join(dir.conda, "samtools.yml")
container:
containers.samtools
shell:
"""
samtools coverage {input} > {output}
"""


rule cleanup_files:
input:
Expand Down

0 comments on commit 9c9f417

Please sign in to comment.