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

feat: add msisensorpro TN #1454

Merged
merged 10 commits into from
Jun 26, 2024
Merged
Show file tree
Hide file tree
Changes from 2 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
8 changes: 8 additions & 0 deletions BALSAMIC/constants/cluster_analysis.json
Original file line number Diff line number Diff line change
Expand Up @@ -415,5 +415,13 @@
"igh_dux4_detection": {
"time": "02:00:00",
"n": 1
},
"msisensorpro_scan_reference": {
"time": "04:00:00",
"n": 1
},
"msisensorpro_msi_tumor_normal": {
"time": "08:00:00",
"n": 24
}
}
51 changes: 51 additions & 0 deletions BALSAMIC/snakemake_rules/annotation/somatic_computations.rule
khurrammaqbool marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
Expand Up @@ -59,3 +59,54 @@ bcftools view --types snps,indels --apply-filters PASS {params.tmpdir}/temp.vcf.
rm -r {params.tmpdir};
"""

if config["analysis"]["analysis_type"] == "paired":
khurrammaqbool marked this conversation as resolved.
Show resolved Hide resolved
rule msisensorpro_scan_reference:
khurrammaqbool marked this conversation as resolved.
Show resolved Hide resolved
input:
fa = config["reference"]["reference_genome"],
output:
msi_scan = f"{vcf_dir}CNV.somatic.{config['analysis']['case_id']}.msisensorpro.list"
benchmark:
Path(f"{benchmark_dir}msisensorpro_scan_reference_{config['analysis']['case_id']}.tsv").as_posix()
singularity:
Path(singularity_image, config["bioinfo_tools"].get("msisensorpro") + ".sif").as_posix()
threads:
get_threads(cluster_config, "msisensorpro_scan_reference")
params:
tmpdir = tempfile.mkdtemp(prefix=tmp_dir),
case_name = config["analysis"]["case_id"],
khurrammaqbool marked this conversation as resolved.
Show resolved Hide resolved
message:
"Scanning microsatellite sites msisensor-pro for {params.case_name}"
khurrammaqbool marked this conversation as resolved.
Show resolved Hide resolved
shell:
"""
msisensor-pro scan -d {input.fa} -o {output.msi_scan};

rm -rf {params.tmpdir};
"""


rule msisensorpro_msi_tumor_normal:
khurrammaqbool marked this conversation as resolved.
Show resolved Hide resolved
input:
msi_list=f"{vcf_dir}CNV.somatic.{config['analysis']['case_id']}.msisensorpro.list",
bamN= config_model.get_final_bam_name(bam_dir = bam_dir,sample_name=normal_sample),
bamT= config_model.get_final_bam_name(bam_dir = bam_dir,sample_name=tumor_sample),
output:
msi_result = f"{vcf_dir}CNV.somatic.{config['analysis']['case_id']}.msisensorpro.msi"
benchmark:
Path(f"{benchmark_dir}/msisensorpro_msi_tumor_normal_{config['analysis']['case_id']}.tsv").as_posix()
singularity:
Path(singularity_image,config["bioinfo_tools"].get("msisensorpro") + ".sif").as_posix()
threads:
get_threads(cluster_config,"msisensorpro_msi_tumor_normal")
params:
tmpdir=tempfile.mkdtemp(prefix=tmp_dir),
case_name=config["analysis"]["case_id"],
khurrammaqbool marked this conversation as resolved.
Show resolved Hide resolved
message:
"Analysing MSI for {params.case_name}"
shell:
"""
msisensor-pro msi -b {threads} -z 1 -d {input.msi_list} -t {input.bamT} -n {input.bamN} -o {params.tmpdir}/msi_{params.case_name};

cp {params.tmpdir}/msi_{params.case_name} {output.msi_result};

rm -rf {params.tmpdir};
"""
3 changes: 3 additions & 0 deletions BALSAMIC/workflows/balsamic.smk
Original file line number Diff line number Diff line change
Expand Up @@ -287,6 +287,7 @@ os.environ['TMPDIR'] = get_result_dir(config)
cnv_report_paths = []
if config["analysis"]["sequencing_type"] == "wgs":
if config['analysis']['analysis_type'] == "paired":
cnv_report_paths.append(f"{vcf_dir}CNV.somatic.{config['analysis']['case_id']}.msisensorpro.msi")
khurrammaqbool marked this conversation as resolved.
Show resolved Hide resolved
cnv_report_paths.append(f"{vcf_dir}CNV.somatic.{config['analysis']['case_id']}.ascat.samplestatistics.txt.pdf")
cnv_report_paths.extend(expand(
f"{vcf_dir}CNV.somatic.{config['analysis']['case_id']}.ascat.{{output_suffix}}.png.pdf",
Expand All @@ -298,6 +299,8 @@ if config["analysis"]["sequencing_type"] == "wgs":
output_suffix=["circular", "scatter"]
))
else:
if config["analysis"]["analysis_type"] == "paired":
cnv_report_paths.append(f"{vcf_dir}CNV.somatic.{config['analysis']['case_id']}.msisensorpro.msi")
khurrammaqbool marked this conversation as resolved.
Show resolved Hide resolved
cnv_report_paths.extend(expand(f"{cnv_dir}tumor.merged-{{plot}}.pdf",plot=["diagram", "scatter"]))
cnv_report_paths.append(f"{cnv_dir}CNV.somatic.{config['analysis']['case_id']}.purecn.purity.csv.pdf")

Expand Down
2 changes: 2 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
Added:
^^^^^^
* MSIsensor-pro container https://github.com/Clinical-Genomics/BALSAMIC/pull/1444
* MSI anslysis to the tumor-normal workflow https://github.com/Clinical-Genomics/BALSAMIC/pull/1454
khurrammaqbool marked this conversation as resolved.
Show resolved Hide resolved


Changed:
^^^^^^^^
Expand Down
Loading