You are provided some code that is delimited by #Code# and #EndCode#. You must perform the task denoted by #Task#.
Your output must follow the template below. All items in the list must be present in the Output.
#Output#
Programming Language: Write the name of the programming language used in #Code#
Task Name: Write a short, descriptive name for the #Task# as applied to given #Code#
Instruction: Write detailed instruction for the #Task# as applied to given #Code#
Information: Write information that is relevant to the #Task# as applied to given #Code#
Solution: \nWrite the solution to the instruction as applied to given #Code#
#Requirements#
You must adhere to the following requirements when performing the task:
- The Instruction must be at least 1 to 3 sentences long. Either imperative sentences or questions are permitted.
- The Instruction must have all the required information to perform #Task#.
- The Instruction must not mention the #Task#.
- The Solution must be relevant to both Instruction and Input.
- The Solution must contain only correct code unless instructed. There should be no explanations or output provided other than the code.
- The Solution must include any relevant imports of standard libraries that are needed to run the code.
- The Instruction and Solution must be written in paragraphs and not list format.
#Task#
- Create an Instruction that implements functions that perform specific operations.
- The Instruction should provide context such as function names, input and output argument types and standard libraries that should be used in the code.
- The Instruction will not be given the raw code or task name or information. Therefore, the Instruction must be self-contained. It cannot ask to be given the raw code.
#Code#
def check_paired_problems(items):
"""Check for incorrectly paired tumor/normal samples in a batch.
"""
# ensure we're in a paired batch
if not get_paired(items):
return
num_tumor = len([x for x in items if dd.get_phenotype(x).lower() == "tumor"])
if num_tumor > 1:
raise ValueError("Unsupported configuration: found multiple tumor samples in batch %s: %s" %
(tz.get_in(["metadata", "batch"], items[0]),
[dd.get_sample_name(data) for data in items]))
elif num_tumor == 0 and any(dd.get_phenotype(data).lower() == "normal" for data in items):
raise ValueError("Found normal sample without tumor in batch %s: %s" %
(tz.get_in(["metadata", "batch"], items[0]),
[dd.get_sample_name(data) for data in items]))
else:
vcs = get_somatic_variantcallers(items)
if "mutect" in vcs or "mutect2" in vcs or "strelka2" in vcs:
paired = get_paired(items)
if not (paired.normal_data or paired.normal_panel):
raise ValueError("MuTect, MuTect2 and Strelka2 somatic calling requires normal sample or panel: %s" %
[dd.get_sample_name(data) for data in items])
#EndCode#
#Output#
Programming Language: