• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

Clinical-Genomics / statina / 6035193017

31 Aug 2023 08:55AM UTC coverage: 59.223%. Remained the same
6035193017

push

github-actions

web-flow
Update CODEOWNERS (#235)

* Update CODEOWNERS
---------

Co-authored-by: Vincent Janvid <69356202+Vince-janv@users.noreply.github.com>
Co-authored-by: Vincent Janvid <vincent.janvid@scilifelab.se>

1021 of 1724 relevant lines covered (59.22%)

0.59 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

19.35
/statina/crud/find/plots/coverage_plot_data.py
1
from typing import Dict, List
1✔
2

3
from statina.models.database import DataBaseSample
1✔
4
from statina.models.server.plots.coverage import CoveragePlotSampleData
1✔
5
from statina.models.server.sample import SampleValidator, SampleWarning
1✔
6

7

8
def get_scatter_data_for_coverage_plot(
1✔
9
    samples: List[SampleValidator],
10
) -> Dict["str", CoveragePlotSampleData]:
11
    """Coverage Ratio data for Coverage Plot.
12
    Only adding samples with a zscore war
13
    ning"""
14

15
    data = {}
×
16
    for sample in samples:
×
17
        sample_warnings: SampleWarning = sample.warnings
×
18
        zscore_warnings = [
×
19
            sample_warnings.z_score_13,
20
            sample_warnings.z_score_18,
21
            sample_warnings.z_score_21,
22
        ]
23
        if set(zscore_warnings) == {"default"}:
×
24
            continue
×
25

26
        x = []
×
27
        y = []
×
28
        for chromosome in range(1, 23):
×
29
            ratio = sample.dict().get(f"Chr{chromosome}_Ratio")
×
30
            if ratio is None:
×
31
                continue
×
32
            y.append(ratio)
×
33
            x.append(chromosome)
×
34
        data[sample.sample_id] = CoveragePlotSampleData(x_axis=x, y_axis=y)
×
35
    return data
×
36

37

38
def get_box_data_for_coverage_plot(
1✔
39
    validated_samples: List[DataBaseSample],
40
) -> Dict[int, List[float]]:
41
    """Coverage Ratio data for Coverage Plot."""
42

43
    box_data = {}
×
44
    for chromosome in range(1, 23):
×
45
        box_data[chromosome] = []
×
46
        for sample in validated_samples:
×
47
            ratio = sample.dict().get(f"Chr{chromosome}_Ratio")
×
48
            if ratio is None:
×
49
                continue
×
50
            box_data[chromosome].append(ratio)
×
51
    return box_data
×
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc