Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: cram file hk tags #1307

Merged
merged 4 commits into from
Nov 1, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions BALSAMIC/snakemake_rules/align/bam_compress.rule
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,18 @@ rule bam_compress_tumor:
bam = lambda wildcards: config_model.get_final_bam_name(bam_dir = bam_dir, sample_name = wildcards.sample),
fasta = config_model.reference["reference_genome"]
output:
cram = Path(bam_dir + "tumor.{sample}.{final_bam_suffix}.cram").as_posix()
cram = Path(bam_dir + "tumor.{sample}.cram").as_posix()
benchmark:
Path(benchmark_dir, "bam_compress_{final_bam_suffix}_{sample}.tsv").as_posix()
Path(benchmark_dir, "bam_compress_tumor_{sample}.tsv").as_posix()
singularity:
Path(singularity_image, config["bioinfo_tools"].get("compress") + ".sif").as_posix()
params:
sample_id = "{sample}",
housekeeper_id= {"id": case_id, "tags": "tumor"}
housekeeper_id= {"id": "{sample}", "tags": "tumor"}
threads:
get_threads(cluster_config, "bam_compress")
message:
"Compressing bam ({final_bam_suffix}) to cram for {params.sample_id}"
"Compressing bam to cram for {params.sample_id}"
shell:
"""
samtools view -h -T {input.fasta} --threads {threads} -C -o {output.cram} {input.bam};
Expand All @@ -29,18 +29,18 @@ rule bam_compress_normal:
bam = lambda wildcards: config_model.get_final_bam_name(bam_dir = bam_dir, sample_name = wildcards.sample),
fasta = config_model.reference["reference_genome"]
output:
cram = Path(bam_dir, "normal.{sample}.{final_bam_suffix}.cram").as_posix()
cram = Path(bam_dir, "normal.{sample}.cram").as_posix()
benchmark:
Path(benchmark_dir, "bam_compress_{final_bam_suffix}_{sample}.tsv").as_posix()
Path(benchmark_dir, "bam_compress_normal_{sample}.tsv").as_posix()
singularity:
Path(singularity_image, config["bioinfo_tools"].get("compress") + ".sif").as_posix()
params:
sample_id = "{sample}",
housekeeper_id= {"id": case_id, "tags": "normal"}
housekeeper_id= {"id": "{sample}", "tags": "normal"}
threads:
get_threads(cluster_config, "bam_compress")
message:
"Compressing bam ({final_bam_suffix}) to cram for {params.sample_id}"
"Compressing bam to cram for {params.sample_id}"
shell:
"""
samtools view -h -T {input.fasta} --threads {threads} -C -o {output.cram} {input.bam};
Expand Down
8 changes: 2 additions & 6 deletions BALSAMIC/snakemake_rules/quality_control/multiqc.rule
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,14 @@ multiqc_input.append(qc_dir + "tumor.{}.dedup.metrics".format(tumor_sample))
multiqc_input.extend(expand(bam_dir + "{sample}.samtools.{stats}.txt",
sample=sample_names, stats=['flagstats', 'idxstats', 'stats']))

if config["analysis"]["sequencing_type"] == 'wgs':
final_bam_suffix = "dedup.realign"
else:
final_bam_suffix = "dedup"

multiqc_input.extend(expand(bam_dir + "tumor.{sample}.{final_bam_suffix}.cram", sample=tumor_sample, final_bam_suffix=final_bam_suffix))
multiqc_input.extend(expand(bam_dir + "tumor.{sample}.cram", sample=tumor_sample))

# fastqc metrics
multiqc_input.extend(expand(fastqc_dir + "{fastq_file_names}_fastqc.zip", fastq_file_names=config_model.get_all_fastq_names(remove_suffix = True)))

if config['analysis']['analysis_type'] == "paired":
multiqc_input.extend(expand(bam_dir + "normal.{sample}.{final_bam_suffix}.cram", sample=normal_sample, final_bam_suffix=final_bam_suffix))
multiqc_input.extend(expand(bam_dir + "normal.{sample}.cram", sample=normal_sample))
multiqc_input.append(config_model.get_final_bam_name(bam_dir = bam_dir, sample_name = normal_sample))
multiqc_input.append(qc_dir + "somalier/somalier.pairs.tsv")
multiqc_input.append(qc_dir + "normal.{}.dedup.metrics".format(normal_sample))
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ Changed:
* Migrate Cache models to pydantic v2 https://github.com/Clinical-Genomics/BALSAMIC/pull/1274
* Made BALSAMIC compatible with multiple PON creation workflows https://github.com/Clinical-Genomics/BALSAMIC/pull/1279
* Use StrEnum from python enum https://github.com/Clinical-Genomics/BALSAMIC/pull/1303
* Renamed final cram bamfile to format [tumor/normal].LIMSID.cram https://github.com/Clinical-Genomics/BALSAMIC/pull/1307


Fixed:
Expand Down