MCPcopy
hub / github.com/openai/plugins / mutect2_plan

Function mutect2_plan

plugins/ngs-analysis/scripts/run_dna_somatic_variants.py:261–430  ·  view source on GitHub ↗
(args: argparse.Namespace, pairs: list[dict[str, str]])

Source from the content-addressed store, hash-verified

259
260
261def mutect2_plan(args: argparse.Namespace, pairs: list[dict[str, str]]) -> list[dict[str, Any]]:
262 reference = args.reference_fasta.expanduser().resolve()
263 commands: list[dict[str, Any]] = []
264 for pair in pairs:
265 pair_id = pair["pair_id"]
266 tumor_bam = Path(pair["tumor_alignment"])
267 unfiltered = f"variants/{pair_id}.unfiltered.vcf.gz"
268 filtered = f"variants/{pair_id}.filtered.vcf.gz"
269 cmd: list[str | Path] = [
270 "gatk",
271 "Mutect2",
272 "-R",
273 reference,
274 "-I",
275 tumor_bam,
276 "-tumor",
277 pair["tumor_sample"],
278 ]
279 if pair["normal_alignment"]:
280 cmd.extend(["-I", Path(pair["normal_alignment"]), "-normal", pair["normal_sample"]])
281 if args.germline_resource:
282 cmd.extend(["--germline-resource", args.germline_resource.expanduser().resolve()])
283 if args.panel_of_normals:
284 cmd.extend(["-pon", args.panel_of_normals.expanduser().resolve()])
285 if args.target_bed:
286 cmd.extend(["-L", args.target_bed.expanduser().resolve()])
287 if args.f1r2_orientation_model:
288 cmd.extend(["--f1r2-tar-gz", f"f1r2/{pair_id}.f1r2.tar.gz"])
289 cmd.extend(["-O", unfiltered])
290 commands.append(command_plan_entry(f"{pair_id}: mutect2", cmd, outputs=[unfiltered]))
291 if args.f1r2_orientation_model:
292 commands.append(
293 command_plan_entry(
294 f"{pair_id}: learn read orientation model",
295 [
296 "gatk",
297 "LearnReadOrientationModel",
298 "-I",
299 f"f1r2/{pair_id}.f1r2.tar.gz",
300 "-O",
301 f"f1r2/{pair_id}.read-orientation-model.tar.gz",
302 ],
303 outputs=[f"f1r2/{pair_id}.read-orientation-model.tar.gz"],
304 )
305 )
306 contamination_args: list[str | Path] = []
307 if args.germline_resource:
308 pileup_intervals = (
309 args.target_bed.expanduser().resolve()
310 if args.target_bed
311 else args.germline_resource.expanduser().resolve()
312 )
313 tumor_pileups = f"qc/{pair_id}.tumor.pileups.table"
314 commands.append(
315 command_plan_entry(
316 f"{pair_id}: tumor pileup summaries",
317 [
318 "gatk",

Callers 1

mainFunction · 0.85

Calls 3

command_plan_entryFunction · 0.90
shell_joinFunction · 0.90
extendMethod · 0.80

Tested by

no test coverage detected