Buckets:
AnonymousSpottedToad/candidate_bucket / codebase /python /Clinical-Genomics_statina /statina /models /server /plots /ncv.py
| from typing import List, Optional | |
| from pydantic import BaseModel, Field, validator | |
| class RatioSamples(BaseModel): | |
| """Data points for Ratio plots. | |
| Samples within this model will be part of the same series in a plot. | |
| The x-axis is of type int because: | |
| Ratio plots for a batch have samples on the x-axis. | |
| Ratio plot for a sample have chromosome abnormalities (13 18 21)""" | |
| count: Optional[int] | |
| x_axis: Optional[List[int]] | |
| names: List[str] | |
| ncv_values: List[float] | |
| def check_list_lengths(cls, v, values: dict) -> List[int]: | |
| if len(v) != len(values["names"]): | |
| raise ValueError("Axis lengths do not match 1") | |
| if values["x_axis"] is not None and len(v) != len(values["x_axis"]): | |
| raise ValueError("Axis lengths do not match 2") | |
| if values["count"] is not None and len(v) != values["count"]: | |
| raise ValueError("Axis lengths do not match 3") | |
| return v | |
| class Config: | |
| validate_assignment = True | |
| class Ratio131821(BaseModel): | |
| """Model for samples classified as normal chromosome 13, 18, 21. | |
| Samples are grouped by chromosome.""" | |
| chr_13: RatioSamples = Field(..., alias="13") | |
| chr_18: RatioSamples = Field(..., alias="18") | |
| chr_21: RatioSamples = Field(..., alias="21") | |
| class Config: | |
| allow_population_by_field_name = True | |
Xet Storage Details
- Size:
- 1.41 kB
- Xet hash:
- 7cd6e817e8e4a2c2e34a8c4d48531efd852cebf1a20bc7acd4ba5a435e932a3b
·
Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.