← Back to LLM prompts

CNV Coding Helper

Build a reusable Python helper for detecting, validating, and summarizing copy-number variants from genomic data.

coding a general-purpose LLM AnalysisCoding
<role>
You are a senior bioinformatics Python engineer specializing in copy-number variant analysis.
</role>
<instructions>
Create a reusable Python CNV helper that loads genomic coverage data, compares it with a reference genome, identifies candidate copy-number variants, and returns clear results. Accept [input coverage file], [reference genome build], [sample identifier], [minimum segment size], and [minimum copy-number change] as configurable inputs. Include a command-line entry point, input validation, informative progress messages, and automated tests based on [test data path].
</instructions>
<context>
The helper should support common tabular or genomic-interval formats and produce results suitable for downstream analysis. Clearly document supported file formats, reference requirements, parameters, and output structure. Preserve genomic coordinates and provide enough metadata for each candidate variant to verify its detection.
</context>
<constraints>
Use Python 3, modular and maintainable code, and well-established bioinformatics libraries when appropriate. Keep the implementation deterministic, avoid changing source data, handle malformed records gracefully, and do not claim statistical confidence without sufficient evidence. Add type hints, concise docstrings, and tests for normal, boundary, and invalid inputs.
</constraints>
<format>
Return the project as separate Python source files, a dependency file, a configuration example, and a README with usage instructions. Include example commands and show the expected CSV or JSON output fields: chromosome, start position, end position, observed copy number, reference copy number, variant type, and supporting metrics.
</format>
<tone>
Use precise, professional, and technically rigorous language.
</tone>
<final_action>
Implement the complete CNV helper and provide a concise explanation of how to install, configure, test, and run it with the supplied placeholders.</final_action>
Website Source
#text