torchcell.datamodels.schema.EngineeredCopyNumberPerturbation

class EngineeredCopyNumberPerturbation(*, systematic_gene_name: str, perturbed_gene_name: str, gene_namespace: Literal['scerevisiae_s288c_sgd_systematic', 'scerevisiae_cenpk113_7d_locus_tag', 'scerevisiae_peter2018_pangenome_orf', 'ecoli_k12_mg1655_bnumber', 'ecoli_k12_bw25113_locus_tag', 'pputida_kt2440_locus_tag', 'ecoli_b_rel606_locus_tag', 'ecoli_k12_w3110_refseq_locus_tag'] = 'scerevisiae_s288c_sgd_systematic', identifier_mapping: DerivedIdentifierMapping | None = None, provenance: str = 'engineered', description: str = 'Engineered copy-number/dosage change of a present native gene', perturbation_type: Literal['engineered_copy_number'] = 'engineered_copy_number', state: str = 'present', mechanism_so_id: str = 'SO:0001019', mechanism_so_name: str = 'copy_number_variation', copy_number: float, reference_copy_number: float, marker: str | None = None)[source]

Bases: GenePerturbation, ModelStrict

An ENGINEERED copy-number/dosage change of a PRESENT native gene.

The engineered counterpart of the natural CopyNumberVariantPerturbation: same dosage axis and SO copy_number_variation mechanism, but provenance="engineered" and referring to a REAL S288C reference gene (the base systematic-name validator applies – NOT relaxed, these are not pangenome ORFs). It hangs directly off GenePerturbation in parallel with the natural CNV leaf (the dosage axis has no intermediate ABC; mirroring the existing pattern keeps the hierarchy symmetric and reparents nothing).

Motivating case – HIP/HOP chemogenomics (Hoepfner/FitDb/Lee) in a DIPLOID: a HIP HETEROZYGOUS deletion drops one autosomal gene from 2 -> 1 copies, i.e. EngineeredCopyNumberPerturbation(copy_number=1, reference_copy_number=2, marker="KanMX"). (A HOP HOMOZYGOUS deletion is total absence and stays a DeletionPerturbation.) reference_copy_number is the copies in the reference (= ReferenceGenome.ploidy for an autosomal gene); marker is the optional selection cassette on the affected allele. The gene remains PRESENT, so state="present".

classmethod validate_mechanism_so_id(v: str) → str[source]

Mechanism SO id is well-formed.

classmethod validate_copy_number_positive(v: float) → float[source]

M2: dosage of a PRESENT gene – copy_number > 0 (0 copies is a total knockout, i.e. a DeletionPerturbation absence, not a CNV).

model_config: ClassVar[ConfigDict] = {'extra': 'forbid', 'frozen': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].