emdbva 0.0.1.dev146__tar.gz → 0.0.1.dev147__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {emdbva-0.0.1.dev146/emdbva.egg-info → emdbva-0.0.1.dev147}/PKG-INFO +1 -1
- {emdbva-0.0.1.dev146 → emdbva-0.0.1.dev147/emdbva.egg-info}/PKG-INFO +1 -1
- {emdbva-0.0.1.dev146 → emdbva-0.0.1.dev147}/va/utils/stars.py +155 -68
- {emdbva-0.0.1.dev146 → emdbva-0.0.1.dev147}/va/version.py +1 -1
- {emdbva-0.0.1.dev146 → emdbva-0.0.1.dev147}/LICENSE +0 -0
- {emdbva-0.0.1.dev146 → emdbva-0.0.1.dev147}/MANIFEST.in +0 -0
- {emdbva-0.0.1.dev146 → emdbva-0.0.1.dev147}/README.rst +0 -0
- {emdbva-0.0.1.dev146 → emdbva-0.0.1.dev147}/emdbva.egg-info/SOURCES.txt +0 -0
- {emdbva-0.0.1.dev146 → emdbva-0.0.1.dev147}/emdbva.egg-info/dependency_links.txt +0 -0
- {emdbva-0.0.1.dev146 → emdbva-0.0.1.dev147}/emdbva.egg-info/entry_points.txt +0 -0
- {emdbva-0.0.1.dev146 → emdbva-0.0.1.dev147}/emdbva.egg-info/requires.txt +0 -0
- {emdbva-0.0.1.dev146 → emdbva-0.0.1.dev147}/emdbva.egg-info/top_level.txt +0 -0
- {emdbva-0.0.1.dev146 → emdbva-0.0.1.dev147}/setup.cfg +0 -0
- {emdbva-0.0.1.dev146 → emdbva-0.0.1.dev147}/setup.py +0 -0
- {emdbva-0.0.1.dev146 → emdbva-0.0.1.dev147}/va/PATHS_codon_airflow.py +0 -0
- {emdbva-0.0.1.dev146 → emdbva-0.0.1.dev147}/va/__init__.py +0 -0
- {emdbva-0.0.1.dev146 → emdbva-0.0.1.dev147}/va/audit/__init__.py +0 -0
- {emdbva-0.0.1.dev146 → emdbva-0.0.1.dev147}/va/audit/cif_revision.py +0 -0
- {emdbva-0.0.1.dev146 → emdbva-0.0.1.dev147}/va/mainva.py +0 -0
- {emdbva-0.0.1.dev146 → emdbva-0.0.1.dev147}/va/metrics/__init__.py +0 -0
- {emdbva-0.0.1.dev146 → emdbva-0.0.1.dev147}/va/metrics/bars.py +0 -0
- {emdbva-0.0.1.dev146 → emdbva-0.0.1.dev147}/va/metrics/connected_percentage.py +0 -0
- {emdbva-0.0.1.dev146 → emdbva-0.0.1.dev147}/va/metrics/contour_level_predicator.py +0 -0
- {emdbva-0.0.1.dev146 → emdbva-0.0.1.dev147}/va/metrics/emda_mmcc.py +0 -0
- {emdbva-0.0.1.dev146 → emdbva-0.0.1.dev147}/va/metrics/emringer.py +0 -0
- {emdbva-0.0.1.dev146 → emdbva-0.0.1.dev147}/va/metrics/inclusion.py +0 -0
- {emdbva-0.0.1.dev146 → emdbva-0.0.1.dev147}/va/metrics/map_data_validation.py +0 -0
- {emdbva-0.0.1.dev146 → emdbva-0.0.1.dev147}/va/metrics/overlap_percentage.py +0 -0
- {emdbva-0.0.1.dev146 → emdbva-0.0.1.dev147}/va/metrics/phaserandomization.py +0 -0
- {emdbva-0.0.1.dev146 → emdbva-0.0.1.dev147}/va/metrics/phenix_cc.py +0 -0
- {emdbva-0.0.1.dev146 → emdbva-0.0.1.dev147}/va/metrics/phenix_mm.py +0 -0
- {emdbva-0.0.1.dev146 → emdbva-0.0.1.dev147}/va/metrics/projections.py +0 -0
- {emdbva-0.0.1.dev146 → emdbva-0.0.1.dev147}/va/metrics/qscore.py +0 -0
- {emdbva-0.0.1.dev146 → emdbva-0.0.1.dev147}/va/metrics/residue_locres.py +0 -0
- {emdbva-0.0.1.dev146 → emdbva-0.0.1.dev147}/va/metrics/resmap.py +0 -0
- {emdbva-0.0.1.dev146 → emdbva-0.0.1.dev147}/va/metrics/smoc.py +0 -0
- {emdbva-0.0.1.dev146 → emdbva-0.0.1.dev147}/va/metrics/strudel.py +0 -0
- {emdbva-0.0.1.dev146 → emdbva-0.0.1.dev147}/va/metrics/surfaces.py +0 -0
- {emdbva-0.0.1.dev146 → emdbva-0.0.1.dev147}/va/metrics/threedfsc.py +0 -0
- {emdbva-0.0.1.dev146 → emdbva-0.0.1.dev147}/va/preparation.py +0 -0
- {emdbva-0.0.1.dev146 → emdbva-0.0.1.dev147}/va/prepareandrun_codon_airflow.py +0 -0
- {emdbva-0.0.1.dev146 → emdbva-0.0.1.dev147}/va/qscores.csv +0 -0
- {emdbva-0.0.1.dev146 → emdbva-0.0.1.dev147}/va/schemas/__init__.py +0 -0
- {emdbva-0.0.1.dev146 → emdbva-0.0.1.dev147}/va/schemas/emdb_entry_full.schema.json +0 -0
- {emdbva-0.0.1.dev146 → emdbva-0.0.1.dev147}/va/schemas/loader.py +0 -0
- {emdbva-0.0.1.dev146 → emdbva-0.0.1.dev147}/va/utils/Checker.py +0 -0
- {emdbva-0.0.1.dev146 → emdbva-0.0.1.dev147}/va/utils/ChimeraxViews.py +0 -0
- {emdbva-0.0.1.dev146 → emdbva-0.0.1.dev147}/va/utils/MapProcessor.py +0 -0
- {emdbva-0.0.1.dev146 → emdbva-0.0.1.dev147}/va/utils/Model.py +0 -0
- {emdbva-0.0.1.dev146 → emdbva-0.0.1.dev147}/va/utils/__init__.py +0 -0
- {emdbva-0.0.1.dev146 → emdbva-0.0.1.dev147}/va/utils/cl_weights.pth +0 -0
- {emdbva-0.0.1.dev146 → emdbva-0.0.1.dev147}/va/utils/log_utils.py +0 -0
- {emdbva-0.0.1.dev146 → emdbva-0.0.1.dev147}/va/utils/misc.py +0 -0
- {emdbva-0.0.1.dev146 → emdbva-0.0.1.dev147}/va/utils/rescolor.py +0 -0
- {emdbva-0.0.1.dev146 → emdbva-0.0.1.dev147}/va/validationanalysis.py +0 -0
|
@@ -479,87 +479,174 @@ class GetStars:
|
|
|
479
479
|
plt.plot(levels, corrected_curve, color='red', label='FSC corrected')
|
|
480
480
|
plt.plot(levels, phase_rand_curve, color='blue', label='Phase randomized')
|
|
481
481
|
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
if valid_intersections:
|
|
485
|
-
intersection_xs = [x for x, y in valid_intersections]
|
|
486
|
-
|
|
487
|
-
# Use searchsorted instead of exact equality.
|
|
488
|
-
boundaries = [np.searchsorted(levels, x) for x in intersection_xs]
|
|
489
|
-
boundaries = [max(0, min(idx, len(levels))) for idx in boundaries]
|
|
490
|
-
boundaries = sorted(set(boundaries))
|
|
491
|
-
|
|
492
|
-
for i in range(len(boundaries)):
|
|
493
|
-
idx_start = boundaries[i]
|
|
494
|
-
|
|
495
|
-
if i == len(boundaries) - 1:
|
|
496
|
-
idx_end = len(levels)
|
|
497
|
-
else:
|
|
498
|
-
idx_end = boundaries[i + 1]
|
|
499
|
-
|
|
500
|
-
if idx_end <= idx_start:
|
|
501
|
-
continue
|
|
502
|
-
|
|
503
|
-
seg_levels = levels[idx_start:idx_end]
|
|
504
|
-
seg_corrected = corrected_curve[idx_start:idx_end]
|
|
505
|
-
seg_phase = phase_rand_curve[idx_start:idx_end]
|
|
506
|
-
|
|
507
|
-
if len(seg_levels) < 2:
|
|
508
|
-
continue
|
|
509
|
-
|
|
510
|
-
finite_segment = (
|
|
511
|
-
np.all(np.isfinite(seg_levels))
|
|
512
|
-
and np.all(np.isfinite(seg_corrected))
|
|
513
|
-
and np.all(np.isfinite(seg_phase))
|
|
514
|
-
)
|
|
515
|
-
|
|
516
|
-
if not finite_segment:
|
|
517
|
-
continue
|
|
518
|
-
|
|
519
|
-
above = seg_corrected >= seg_phase
|
|
520
|
-
|
|
521
|
-
plt.fill_between(
|
|
522
|
-
seg_levels,
|
|
523
|
-
seg_corrected,
|
|
524
|
-
seg_phase,
|
|
525
|
-
where=above,
|
|
526
|
-
color='pink',
|
|
527
|
-
alpha=0.5,
|
|
528
|
-
)
|
|
482
|
+
frequency = 1 / self.randomise_from()
|
|
529
483
|
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
484
|
+
# ============================================================
|
|
485
|
+
# FEATURE ZONE (PINK)
|
|
486
|
+
# ============================================================
|
|
487
|
+
# Feature area is independent of the randomization frequency.
|
|
488
|
+
#
|
|
489
|
+
# Count ALL area between the two curves wherever:
|
|
490
|
+
#
|
|
491
|
+
# corrected FSC > phase-randomized FSC
|
|
492
|
+
#
|
|
493
|
+
# over the entire available frequency range.
|
|
494
|
+
|
|
495
|
+
feature_delta = corrected_curve - phase_rand_curve
|
|
496
|
+
|
|
497
|
+
feature_area = np.trapz(
|
|
498
|
+
np.clip(feature_delta, 0, None),
|
|
499
|
+
levels
|
|
500
|
+
)
|
|
536
501
|
|
|
537
|
-
|
|
502
|
+
plt.fill_between(
|
|
503
|
+
levels,
|
|
504
|
+
corrected_curve,
|
|
505
|
+
phase_rand_curve,
|
|
506
|
+
where=(corrected_curve >= phase_rand_curve),
|
|
507
|
+
interpolate=True,
|
|
508
|
+
color='pink',
|
|
509
|
+
alpha=0.5,
|
|
510
|
+
)
|
|
538
511
|
|
|
539
|
-
|
|
512
|
+
# ============================================================
|
|
513
|
+
# OVERFIT ZONE (BLUE)
|
|
514
|
+
# ============================================================
|
|
515
|
+
# Blue area DOES depend on randomization frequency.
|
|
516
|
+
# It starts exactly at:
|
|
517
|
+
#
|
|
518
|
+
# frequency = 1 / self.randomise_from()
|
|
519
|
+
#
|
|
520
|
+
# and is the positive area between phase-randomized FSC
|
|
521
|
+
# and the x-axis.
|
|
522
|
+
|
|
523
|
+
overfit_area = 0.0
|
|
524
|
+
|
|
525
|
+
if levels[0] <= frequency < levels[-1]:
|
|
526
|
+
# Find the first original data point AFTER the exact
|
|
527
|
+
# randomization frequency.
|
|
528
|
+
start_idx = np.searchsorted(
|
|
529
|
+
levels,
|
|
530
|
+
frequency,
|
|
531
|
+
side='right'
|
|
532
|
+
)
|
|
540
533
|
|
|
541
|
-
|
|
542
|
-
|
|
534
|
+
# Interpolate the phase-randomized FSC at the exact
|
|
535
|
+
# randomization frequency.
|
|
536
|
+
phase_at_frequency = np.interp(
|
|
537
|
+
frequency,
|
|
538
|
+
levels,
|
|
539
|
+
phase_rand_curve
|
|
540
|
+
)
|
|
543
541
|
|
|
544
|
-
|
|
542
|
+
# Explicitly insert the exact randomization frequency
|
|
543
|
+
# as the first point.
|
|
544
|
+
overfit_x = np.concatenate(
|
|
545
|
+
([frequency], levels[start_idx:])
|
|
546
|
+
)
|
|
545
547
|
|
|
546
|
-
|
|
547
|
-
|
|
548
|
+
overfit_phase = np.concatenate(
|
|
549
|
+
([phase_at_frequency], phase_rand_curve[start_idx:])
|
|
550
|
+
)
|
|
548
551
|
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
+
# Count only positive phase-randomized FSC as blue area.
|
|
553
|
+
overfit_area = np.trapz(
|
|
554
|
+
np.clip(overfit_phase, 0, None),
|
|
555
|
+
overfit_x
|
|
556
|
+
)
|
|
552
557
|
|
|
558
|
+
# Draw blue area starting exactly at randomization frequency.
|
|
553
559
|
plt.fill_between(
|
|
554
560
|
overfit_x,
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
where=(
|
|
561
|
+
overfit_phase,
|
|
562
|
+
0,
|
|
563
|
+
where=(overfit_phase >= 0),
|
|
564
|
+
interpolate=True,
|
|
558
565
|
color='blue',
|
|
559
566
|
alpha=0.5,
|
|
560
567
|
)
|
|
561
|
-
|
|
562
|
-
|
|
568
|
+
|
|
569
|
+
# feature_area = 0.0
|
|
570
|
+
#
|
|
571
|
+
# if valid_intersections:
|
|
572
|
+
# intersection_xs = [x for x, y in valid_intersections]
|
|
573
|
+
#
|
|
574
|
+
# # Use searchsorted instead of exact equality.
|
|
575
|
+
# boundaries = [np.searchsorted(levels, x) for x in intersection_xs]
|
|
576
|
+
# boundaries = [max(0, min(idx, len(levels))) for idx in boundaries]
|
|
577
|
+
# boundaries = sorted(set(boundaries))
|
|
578
|
+
#
|
|
579
|
+
# for i in range(len(boundaries)):
|
|
580
|
+
# idx_start = boundaries[i]
|
|
581
|
+
#
|
|
582
|
+
# if i == len(boundaries) - 1:
|
|
583
|
+
# idx_end = len(levels)
|
|
584
|
+
# else:
|
|
585
|
+
# idx_end = boundaries[i + 1]
|
|
586
|
+
#
|
|
587
|
+
# if idx_end <= idx_start:
|
|
588
|
+
# continue
|
|
589
|
+
#
|
|
590
|
+
# seg_levels = levels[idx_start:idx_end]
|
|
591
|
+
# seg_corrected = corrected_curve[idx_start:idx_end]
|
|
592
|
+
# seg_phase = phase_rand_curve[idx_start:idx_end]
|
|
593
|
+
#
|
|
594
|
+
# if len(seg_levels) < 2:
|
|
595
|
+
# continue
|
|
596
|
+
#
|
|
597
|
+
# finite_segment = (
|
|
598
|
+
# np.all(np.isfinite(seg_levels))
|
|
599
|
+
# and np.all(np.isfinite(seg_corrected))
|
|
600
|
+
# and np.all(np.isfinite(seg_phase))
|
|
601
|
+
# )
|
|
602
|
+
#
|
|
603
|
+
# if not finite_segment:
|
|
604
|
+
# continue
|
|
605
|
+
#
|
|
606
|
+
# above = seg_corrected >= seg_phase
|
|
607
|
+
#
|
|
608
|
+
# plt.fill_between(
|
|
609
|
+
# seg_levels,
|
|
610
|
+
# seg_corrected,
|
|
611
|
+
# seg_phase,
|
|
612
|
+
# where=above,
|
|
613
|
+
# color='pink',
|
|
614
|
+
# alpha=0.5,
|
|
615
|
+
# )
|
|
616
|
+
#
|
|
617
|
+
# if np.all(above):
|
|
618
|
+
# cur_area = np.trapz(
|
|
619
|
+
# seg_corrected - seg_phase,
|
|
620
|
+
# seg_levels,
|
|
621
|
+
# )
|
|
622
|
+
# feature_area += cur_area
|
|
623
|
+
#
|
|
624
|
+
# frequency = 1 / self.randomise_from()
|
|
625
|
+
#
|
|
626
|
+
# closest_idx = int(np.argmin(np.abs(levels - frequency)))
|
|
627
|
+
#
|
|
628
|
+
# overfit_x = levels[closest_idx:]
|
|
629
|
+
# overfit_y = phase_rand_curve[closest_idx:]
|
|
630
|
+
#
|
|
631
|
+
# valid_overfit = np.isfinite(overfit_x) & np.isfinite(overfit_y)
|
|
632
|
+
#
|
|
633
|
+
# overfit_x = overfit_x[valid_overfit]
|
|
634
|
+
# overfit_y = overfit_y[valid_overfit]
|
|
635
|
+
#
|
|
636
|
+
# if len(overfit_x) >= 2:
|
|
637
|
+
# y_values = np.zeros(len(overfit_x))
|
|
638
|
+
# overfit_area = np.trapz(overfit_y, overfit_x)
|
|
639
|
+
#
|
|
640
|
+
# plt.fill_between(
|
|
641
|
+
# overfit_x,
|
|
642
|
+
# overfit_y,
|
|
643
|
+
# y_values,
|
|
644
|
+
# where=(overfit_y >= 0),
|
|
645
|
+
# color='blue',
|
|
646
|
+
# alpha=0.5,
|
|
647
|
+
# )
|
|
648
|
+
# else:
|
|
649
|
+
# overfit_area = 0.0
|
|
563
650
|
|
|
564
651
|
plt.legend(loc='best', fontsize='x-small')
|
|
565
652
|
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|